Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem in LoadReads #1484

Closed
h-2 opened this issue Feb 22, 2016 · 11 comments
Closed

problem in LoadReads #1484

h-2 opened this issue Feb 22, 2016 · 11 comments
Assignees
Milestone

Comments

@h-2
Copy link
Member

h-2 commented Feb 22, 2016

From the mailing list:

Hi Seqan Devs,

I am currently working a project that used Seqan 1.4 and now I am updating
to Seqan 2.1. I think that maybe I have found a bug in Seqan. The problem
is that LoadReads from FragmentStore is not returning the same as in the
previous version for the same call, I did a little research comparing
both versions.

The code of loadReads have change from one version to the other, in both
versions it's defined in seqan/store/store_io.h at line 1159 for old
version and at line 1273 for the new version but the behave is different
and I think here is the problem.

in old version there is this part:

MultiSeqFile multiSeqFileL, multiSeqFileR;
if (!open(multiSeqFileL.concat, toCString(fileNameL), OPEN_RDONLY))
return false;
if (!open(multiSeqFileR.concat, toCString(fileNameR), OPEN_RDONLY))
return false;

The flow is working correctly and the ifs don't reach the return false but
in the new version the code is like this

SeqFileIn seqFileL, seqFileR;
if (!open(seqFileL, toCString(fileNameL)) || !open(seqFileR,
toCString(fileNameR)))
return false;

here the execution always always return false. I inspected and its because
a different open function its called and here is where I think is the
bug.

In seqan 1.4 the open function called is from string_map defined in
/include/seqan/file/string_mmap.h however in 2.x the open function that is
being called is from /include/seqan/stream/formatted_file.h. The open from
string_mmap.h exists in 2.x and I think is the function that wanted to be
called. LoadReads calls open with SeqFileIn in the new version while in
previous with MultiSeqFile but MultiSeqFile is not available in new
version

Can you please check if that is a bug

Thanks in Advance,
Luis Enrique

@h-2 h-2 added this to the Release 2.1.1 milestone Feb 22, 2016
@temehi
Copy link
Contributor

temehi commented Mar 8, 2016

I can not reproduce this bug, anyhow I will try to contact Luis Enrique.

@xenigmax
Copy link
Contributor

@temehi Did you contact the person?

@temehi
Copy link
Contributor

temehi commented Mar 16, 2016

@xenigmax yes, we had a couple of conversations on the mailing list. I asked Luis Enrique to send me his fastq files to locate the problem and I am still waiting.

@sccluisx
Copy link

@temehi Thanks here are the files that were working with previous version of seqan
seqan_issue_files.zip

@temehi
Copy link
Contributor

temehi commented Mar 17, 2016

@sccluisx Are you using the latest master of seqan? On which platform you are using SeqAn? windows? Because I have tested with your fastq files (OS X and linux), and LoadReads works just fine on both systems.

@cpockrandt Can you please test this on windows using the following code fragment and the files above? Thanks!

    CharString fileNameR = "SRR027877-small-p1.fastq";
    CharString fileNameL = "SRR027877-small-p2.fastq";

    typedef seqan::FragmentStore<> THMMFragStore;
    THMMFragStore fragStore;
    if (!loadReads(fragStore, fileNameL, fileNameR)){
         std::cout << "loadReads: [FAILED]" << std::endl;
         return false;
    }
    std::cout << "loadReads: [SUCCESSFUL)" << std::endl;

@cpockrandt
Copy link
Contributor

@temehi Works on Windows with VS 14 2015 Win64 with master branch.

@xenigmax
Copy link
Contributor

@temehi @cpockrandt

if (!loadReads(fragStore, fileNameR, fileNameR)){

Is this correct?

@temehi
Copy link
Contributor

temehi commented Mar 17, 2016

@xenigmax not really, but it still works with

     if (!loadReads(fragStore, fileNameL, fileNameR)){

on OS X and linux. @cpockrandt can you please check again?

@cpockrandt
Copy link
Contributor

@temehi Still works!

@temehi
Copy link
Contributor

temehi commented Mar 18, 2016

@xenigmax you may close this issue as we couldn't reproduce the error.

@sccluisx
Copy link

sccluisx commented Mar 9, 2017

Hi I am retaking this project, now I have isolated the problem and know what is what triggers the bug.
In the zip file I have a very simple code:

#include
#include <seqan/store.h>

int main(int argc, char * argv[]) {
seqan::FragmentStore<> fragStore;
const char *r1 = argv[1];
const char *r2 = argv[2];
auto c1 = loadReads(fragStore, r1, r2);
std::cout<<"call: "<<std::boolalpha<<c1<<std::endl;
}

And it contains seqan1.3 and seqan from the master branch I compile by
g++ -g3 -std=c++14 -Iseqan-master/ bug.cpp -o bug
for master and
g++ -g3 -std=c++14 -Iseqan-1_3_1/ bug.cpp -o bug

new SEQAN works fine if the input files have extension .fasta however if they have the extension is *.fastq_N it shows different behaviour as was in the old SEQAN

In this example r1.fasta, r2.fasta and r1.fastq_N, r2.fast1_N are the same file respectively

$ g++ -g3 -std=c++14 -Iseqan-old/ bug.cpp -o bug
$ ./bug r1.fasta r2.fasta
call: true
$ ./bug r1.fastq_N r2.fastq_N
call: true
$ g++ -g3 -std=c++14 -Iseqan-new/ bug.cpp -o bug
$ ./bug r1.fasta r2.fasta
call: true
$ ./bug r1.fastq_N r2.fastq_N
call: false

As you can see in seqan 1.3 the reads could be loaded even if they dont have extension fasta, but in latest seqan the reads are not loaded
Could you please kindly check this
seqan_bug.tar.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants