News for hackers. Stuff that matters.
Re:Bioinformatics and the joy of Perl6 by dalke on Monday December 15, 2014 @06:45AM (#8751512)
I'm a bit surprised at the implied superiority to the other Bio* projects. None of them started as a copy of BioPerl (and btw, it's "Biopython", not "BioPython"), and none of them are trying to implement all of the features of BioPerl. For that matter, the other projects implement features that BioPerl doesn't have.

It's interesting that the example supports a comment in the FASTA record. I wonder why the author included it. I've never seen a comment used in the wild, but then again I haven't worked with FASTA files for some time. My experience was that nearly every tool would break if you give it a FASTA file with a comment. For example, the BioPerl FASTA parser is at https://github.com/bioperl/bioperl-live/blob/master/Bio/SeqI... , where you can see it doesn't support a comment.

Since the chance of breakage is so high, my belief 10 years ago was that this original feature from Pearson is dead, and will never be revived.

Re:Bioinformatics and the joy of Perl6 by Ultimatt on Monday December 15, 2014 @08:00AM (#8751714)
Update for the superiority, though that is part my flippant language use and some projection :P The comment section in the grammar isn't comments as in ; line comments but the per sequence comments usually used to encode extra meta information such as with GenBank. No idea if they should be called something else, I've always thought of them as comments.
Re:Bioinformatics and the joy of Perl6 by cjfields1 on Monday December 15, 2014 @10:36AM (#8752460)
Okay, I think I see the discrepancy. It's a nomenclature thing.

The Bio* refer to the additional stuff after the ID as the sequence 'description'. There is a subtle difference between that and a simple comment, though I have seen even NCBI use this as the 'junk drawer' for any additional seq information (such as the headers in the nr database).

Re:Bioinformatics and the joy of Perl6 by cjfields1 on Monday December 15, 2014 @10:31AM (#8752436)
Agreed re: implied superiority. I view all the Bio* are toolkits, frankly, and thus pieces of those toolkits are developed based on the wants/needs of users (some of whom simply do not know perl). BioPerl just happened to be one of the first out of the gates (~1997, in a primordial state), but Biopython and BioJava were also out around 2000 or so IIRC.

Re: FASTA comment support, I haven't ever seen it's use in the wild.

Re:Bioinformatics and the joy of Perl6 by chaosfox on Monday December 15, 2014 @08:16AM (#8751765)
comments go after blank space in the sequence name, for example:

    >ENST00000517143 ncrna:snRNA 
    ATGC...
"ncrna:snRNA" is a comment
Re:Bioinformatics and the joy of Perl6 by cjfields1 on Monday December 15, 2014 @10:23AM (#8752381)
Actually, in the Bio* langs that would be referred to as the 'description'. @dalke is referring to the very rarely-used ';' I believe, which I don't recall any modern-day FASTA parser supporting.
Re:Bioinformatics and the joy of Perl6 by dalke on Monday December 15, 2014 @03:02PM (#8754057)
Yes. You can see remnants of an old discussion of the point on the Wikipedia Talk page for "FASTA".

The problems comes to an ambiguity in the Pearson's original FASTA distribution, from http://faculty.virginia.edu/wrpearson/fasta/fasta3/ . In my copy of FASTA (fasta-35.1.5) in fasta20.doc is the following:

    0 Pearson/FASTA (>SEQID - comment/sequence)
       ...
    Standard library files.  These are the same as plain sequence
    files, each sequence is preceded by a comment line with a '>'
    in the first column.
       ...
    I have included several sample test files, *.AA.  The first
    line may begin with a '>'  or ';' followed by a comment.  The
    text after ';' in other lines will  be  ignored.   Spaces  and
    tabs  (and anything else that  is  not  an amino-acid code) are
    ignored.
    ...
    This is often referred to as "FASTA" or "Pearson" format. You
    can build your own library by concatenating several sequence
    files.  Just be sure that each sequence is preceded by a line
    beginning with a '>' with a sequence name.
For reference, this is the content of h10_human.aa:

    >H10_HUMAN | 90538   | HISTONE H1' (H1.0) (H1(0)).
    TENSTSAPAAKPKRAKASKKSTDHPKYSDMIVAAIQAEKNRAGSSRQSIQKYIKSHYKVGENADSQIKLSIKRLV
    TTGVLKQTKGVGASGSFRLAKSDEPKKSVAFKKTKKEIKKVATPKKASKPKKAASKAPTKKPKATPVKKAKKKLA
    ATPKKAKKPKTVKAKPVKASKPKKAKPVKPKAKSSAKRAGKKK
None of the '.aa' files have an example of a line starting with ';'.

(Also, there are '.seq' records with DNA in them, so the comment about ignoring non-amino-acid codes is only referring to protein FASTA files.)

Obviously the text after '>' is important, while the ignorable text after a ';' is not ... unless it's the first line of the file. If so, what name should be used to distinguish between one and another? The code calls the first line a title, for example.

Some people implemented ';' as a generic comment field, to be ignored. (See that Talk page for a couple of examples; "read.fasta in the seqinR package and by the function readFASTA in the Biostrings package") Most others did not.

After Pearson came NCBI. They describe a backwards compatible subset of the original FASTA at http://blast.ncbi.nlm.nih.gov/blastcgihelp.shtml . It calls the '>' line a "description line (defline)". The NCBI toolkit further break up the record into "sequence, description, and identifiers" (see http://www.ncbi.nlm.nih.gov/books/NBK21097/ ).

BioPerl and Biopython, and I assume the other Bio* languages, follow NCBI's lead and use the same, or similar, names.

I am a member of the NCBI FASTA camp, not the Pearson FASTA camp, so when I see the term "comment" I think it unambiguously refers to text after a ';' line in a Peason file. I can see how someone from a different intellectual heritage would call the description a "comment", but as most of the world uses NCBI FASTA and not Pearson FASTA, I think it's a bit confusing to do so.

Re:Bioinformatics and the joy of Perl6 by Ultimatt on Monday December 15, 2014 @12:13PM (#8753021)
Oh I've seen them used in the wild... I'd rather have a parser throw an exception than have that data go through though lol
Re:Bioinformatics and the joy of Perl6 by cjfields1 on Monday December 15, 2014 @01:50PM (#8753570)
Curious. Where have you run into them (so I can run the other way :)
Re:Bioinformatics and the joy of Perl6 by dalke on Monday December 15, 2014 @04:02PM (#8754444)
Same here! I did a pretty extensive search about 8 years ago for real-world examples, and no one could point to any, outside of test code to make sure that a given tool could handle these mythical files should they appear.
Re:Bioinformatics and the joy of Perl6 by Ultimatt on Tuesday December 16, 2014 @10:54AM (#8757635)
Hah I wouldn't worry it was a by-hand prepared sequence file of the sequence for a known structure I was emailed. The comment line had some interesting PDB data encoded :)