fn() readFastaRead first sequence from a FASTA file.
Read first sequence from a FASTA file.
Defined in | <seqan/seq_io.h> |
---|---|
Signature |
int readFasta(seq, filename);
|
Parameters
seq
|
String to store the result. Type: String |
---|---|
filename
|
Path to the file to read from. Type: char const *. |
Return Values
int |
0 on success, non-0 value on error. |
---|
Detailed Description
This function is meant for demo programs and allows to read the first sequence from a FASTA file very easily.
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; }