Function
writeRecord
Write one sequence record from to a SequenceStream object.
The record is appended to the file if you have written out any previously. When writing out Dna5, qualities are automatically taken from the sequence characters.
int writeRecord(seqIO, id, seq, [options])
int writeRecord(seqIO, id, seq, quals, [options])
Include Headers
seqan/seq_io.h
Parameters
seqIO
The SequenceStream object to write to.
id
The identifier to write.
Types: CharString
seq
The sequence to write.
Types: String
quals
The qualities to write out.
Types: CharString
Remarks: If the sequence has no qualities, clear is called on quals to indicate this.
options
The configuration for writing FASTA and FASTQ files.
Return Values
An integer, 0 on success, 1 on errors.
Types: int
Examples
Write out two sequences to a FASTQ file.
int main()
{
    seqan::SequenceStream seqIO("in.fasta", seqan::SequenceStream::WRITE);
    seqan::StringSet<seqan::CharString> ids;
    appendValue(ids, "seq1");
    appendValue(ids, "seq2");
    seqan::StringSet<seqan::Dna5String> seqs;
    appendValue(seqs, "CGAT");
    appendValue(seqs, "TTTT");
 
    for (unsigned i = 0; i < length(ids); ++i)
    {
        int res = writeRecord(seqIO, ids[0], seqs[0]);
        if (res != 0)
        {
            std::cerr << "ERROR: Could not write records!\n";
            return 1;
        }
    }
 
    return 0;
}
SeqAn - Sequence Analysis Library - www.seqan.de
 

Page built @2013/07/11 09:12:17