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.
Include Headers
seqan/seq_io.h
Parameters
The SequenceStream object to write to. Types: SequenceStream | |
The identifier to write. Types: CharString | |
The sequence to write. Types: String | |
The qualities to write out. Types: CharString | |
The configuration for writing FASTA and FASTQ files. Types: SequenceOutputOptions |
Return Values
An integer, 0 on success, 1 on errors.
Types: int
Member of
Examples
Write out two sequences to a FASTQ file.
{
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