IUBio

FASTA format - proposed max line limit

tendo tendo at fas.harvard.edu
Wed Dec 2 00:30:31 EST 1998


I found that C++ standard template library (STL) allows you to access
unlimited length of string when you read a file.  So, as long as you use C++
as well as perl, the max line length limit is not necessary.

However, I still think it's a good idea to have secondary comment line which
is free from context....

Here's an example:

#include <cctype>
#include <string>

addseq(string& s, string& a) {
    for (long i=0; i<a.length(); a++)
        if (isalpha[i])
            s += a[i];
}

string readseq (istream& is) {
    string buffer;
    string seq;
    while (getline(is, buffer)) {
        if (buffer[0]=='>') {
            if (!seq.empty()) {
                something();
            }
            another();
        } else if (buffer[0] != ';')
            addseq(seq, buffer);
    }
}


toshi





More information about the Bio-soft mailing list

Send comments to us at biosci-help [At] net.bio.net