Function
readFasta
Read first sequence from a FASTA file.
This function is meant for demo programs and allows to read the first sequence from a FASTA file very easily.
int readFasta(seq, filename)
Include Headers
seqan/seq_io.h
Parameters
seq
String to store the result.
Types: String
filename
Path to the file to read from.
Types: char const *
Return Values
int with status code, 0 for success, 1 for error.
Examples
Read the file given by the first parameter to the program and print it to the screen.
#include <iostream>
#include <seqan/sequence.h>
#include <seqan/seq_io.h>
 
int main(int argc, char const ** argv)
{
    if (argc != 2)
        return 1;
 
    seqan::Dna5String seq;
    if (readFasta(seq, argv[1]) != 0)
        return 1;
 
    std::cout << seq << '\n';
    return 0;
}
SeqAn - Sequence Analysis Library - www.seqan.de
 

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