Function
readRecord
Read the next sequence record from SequenceStream.
Read the next sequence record from SequenceStream.
Include Headers
seqan/seq_io.h
Parameters
The identifier of the sequence is written here. The identifier of the sequence is written here. | |
The sequence of the record is written here. The sequence of the record is written here. | |
The qualities of the sequence is written here. Optional. The qualities of the sequence is written here. Optional. If the sequence has no qualities, clear is called on | |
The SequenceStream object to read from. The SequenceStream object to read from. |
Return Values
An integer, 0 on success, 1 on errors.
An integer, 0 on success, 1 on errors.
Types: int , int
Member of
Examples
Read the first sequence of a FASTA file.
Read the first sequence of a FASTA file.
{
seqan::SequenceStream seqIO("in.fasta", seqan::SequenceStream::READ_SINGLE);
seqan::CharString id;
seqan::Dna5String seq;
if (atEnd(seqIO))
{
std::cerr << "ERROR: File does not contain any sequences!\n";
return 1;
}
int res = readRecord(id, seq, seqIO);
if (res != 0)
{
std::cerr << "ERROR: Could not read first record!\n";
return 1;
}
return 0;
}
{
seqan::SequenceStream seqIO("in.fasta", seqan::SequenceStream::READ_SINGLE);
seqan::CharString id;
seqan::Dna5String seq;
if (atEnd(seqIO))
{
std::cerr << "ERROR: File does not contain any sequences!\n";
return 1;
}
int res = readRecord(id, seq, seqIO);
if (res != 0)
{
std::cerr << "ERROR: Could not read first record!\n";
return 1;
}
return 0;
}
SeqAn - Sequence Analysis Library - www.seqan.de