Edgewall Software
Modify

Opened 7 years ago

Closed 7 years ago

#11207 closed defect (invalid)

seqan::SequenceStream cannot open FASTQ files

Reported by: d.lyberg@… Owned by:
Priority: normal Milestone:
Component: general Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Jun Omae)

Using Seqan v. 1.4, I was trying to open a FASTQ file with SequenceStream using this pseudocode:

#include <seqan/sequence.h>
#include <seqan/seq_io.h>

typedef sq::Iterator<sq::StringSet<sq::Dna5String>>::Type SeqIterator;
typedef sq::Iterator<sq::StringSet<sq::CharString>>::Type CharIterator;

SeqIterator it_seq;
CharIterator it_qual, it_id;
const int n_seqs = 10000;
int res;
std::string fastq_f_in = "reads.fastq";
seqan::StringSet<seqan::CharString> ids;
seqan::StringSet<seqan::Dna5String> seqs;
seqan::StringSet<seqan::CharString> quals;
seqan::SequenceStream fastq_ipt(fastq_f_in.c_str(),
    seqan::SequenceStream::READ,
    seqan::SequenceStream::FileFormat::FASTQ);

if (!seqan::isGood(fastq_ipt))
{
  cout << "error opening file " << fastq_f_in << endl;
  //return 1;
}

res = seqan::readBatch(ids, seqs, fastq_ipt, n_seqs);

if (!res)
{
  cout << "error reading file " << fastq_f_in << endl;
  //return 1;
}

for (it_id = sq::begin(ids), it_seq = sq::begin(seqs), it_qual = sq::begin(quals);
    it_id != sq::end(ids), it_seq != sq::end(seqs), it_qual != sq::end(quals);
    it_id++, it_seq++, it_qual++)
{
  cout << *it_id;
  cout << "\t" << *it_seq;
  cout << "\t" << *it_qual;
  cout << endl;
}

But I end up with this output message:

error reading file reads.fastq
ERROR: Could not read from FASTA file

The return statements are canceled to display all error messages. Obviously, there is something that makes SequenceStream believe that I want to open a FASTA file. But on the example page http://trac.seqan.de/wiki/Tutorial/BasicSequenceIO, there are files ending with .fq indicating that FASTQ files should work too.

Attachments (0)

Change History (1)

comment:1 by Jun Omae, 7 years ago

Description: modified (diff)
Resolution: invalid
Status: newclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.