Function
readRecord
Read the next sequence record from SequenceStream.
Read the next sequence record from SequenceStream.
int readRecord(id, seq, seqIO)
int readRecord(id, seq, quals, seqIO)
int readRecord(id, seq, seqIO)
int readRecord(id, seq, quals, seqIO)
Include Headers
seqan/seq_io.h
Parameters
id
The identifier of the sequence is written here.
The identifier of the sequence is written here.
seq
The sequence of the record is written here.
The sequence of the record is written here.
Types: String, String
quals
The qualities of the sequence is written here. Optional.
The qualities of the sequence is written here. Optional.
Remarks: If the sequence has no qualities, clear is called on quals to indicate this.
If the sequence has no qualities, clear is called on quals to indicate this.
seqIO
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
Examples
Read the first sequence of a FASTA file.
Read the first sequence of a FASTA file.
int main()
{
    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;
}
int main()
{
    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
 

Page built @2012/10/02 11:10:30