Fasta parser

Ali Çehreli acehreli at yahoo.com
Sun Nov 11 22:42:30 PST 2012


On 11/11/2012 03:55 PM, bioinfornatics wrote:
> Le dimanche 11 novembre 2012 à 18:34 +0100, bioinfornatics a écrit :
>> Hi,
>> I wrote a fasta parser for biology computing
>> http://pastebin.geany.org/yheQN/
>>
>> I would like to get your experience to know if the writer could be
>> better. The given parser use MmFile and Phobos range.
>>
>> fasta specification format =>  http://en.wikipedia.org/wiki/FASTA_format
>>
>
> Here i continue to enhance the parser i fail about reverse range:
> http://dpaste.dzfl.pl/1f0aef89
>
> i need to initialize the range:
> - popFront if we go forward
> - popBack if we go back
>
> how can i detect this instead to use the boolean isForward?
>

If a range provides back() and popBack() in addition to front() and 
popFront() then it looks like a BidirectionalRange. The users would 
expect to use a byFasta struct as a BidirectionalRange.

However, both front() and back() use the same member, _fasta, meaning 
that the front and back of the range are the same.

I am not familiar with the Fasta format but if it is not by nature 
bidirectional, I think you shouldn't provide back() and popBack().

Ali


More information about the Digitalmars-d-learn mailing list