Thread overview | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
November 11, 2012 Fasta parser | ||||
---|---|---|---|---|
| ||||
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 |
November 11, 2012 Re: Fasta parser | ||||
---|---|---|---|---|
| ||||
Posted in reply to bioinfornatics | 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 > minor update http://pastebin.geany.org/OgUHg/ is now a forwardRange |
November 11, 2012 Re: Fasta parser | ||||
---|---|---|---|---|
| ||||
Posted in reply to bioinfornatics | On 2012-34-11 18:11, bioinfornatics <bioinfornatics@fedoraproject.org> wrote: > 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 Not available (anymore). That's a bummer. Also, obligatory 'Red unz go fasta!' -- Simen |
November 11, 2012 Re: Fasta parser | ||||
---|---|---|---|---|
| ||||
Posted in reply to Simen Kjaeraas | Le dimanche 11 novembre 2012 à 19:58 +0100, Simen Kjaeraas a écrit : > On 2012-34-11 18:11, bioinfornatics <bioinfornatics@fedoraproject.org> wrote: > > > 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 > > Not available (anymore). That's a bummer. > > Also, obligatory 'Red unz go fasta!' > oops sorry http://dpaste.dzfl.pl/dae66c94 |
November 11, 2012 Re: Fasta parser | ||||
---|---|---|---|---|
| ||||
Posted in reply to bioinfornatics | 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? |
November 12, 2012 Re: Fasta parser | ||||
---|---|---|---|---|
| ||||
Posted in reply to bioinfornatics | 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
|
November 12, 2012 Re: Fasta parser | ||||
---|---|---|---|---|
| ||||
Posted in reply to bioinfornatics | 11/11/2012 9:34 PM, bioinfornatics пишет: > 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 > I'd like to spread the word of the proper toString signature that doesn't need appender. void toString(scope delegate(const(char)[]) sink) const{ //same code, but replace fasta.put(x) with sink(x) } -- Dmitry Olshansky |
November 12, 2012 Re: Fasta parser | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dmitry Olshansky | On Monday, 12 November 2012 at 09:16:54 UTC, Dmitry Olshansky wrote:
> 11/11/2012 9:34 PM, bioinfornatics пишет:
>> 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
>>
>
> I'd like to spread the word of the proper toString signature that doesn't need appender.
>
> void toString(scope delegate(const(char)[]) sink) const{
> //same code, but replace fasta.put(x) with sink(x)
> }
Is there any documentation for this signature?
|
November 12, 2012 Re: Fasta parser | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tobias Pankrath | 11/12/2012 2:14 PM, Tobias Pankrath пишет: > On Monday, 12 November 2012 at 09:16:54 UTC, Dmitry Olshansky wrote: >> 11/11/2012 9:34 PM, bioinfornatics пишет: >>> 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 >>> >> >> I'd like to spread the word of the proper toString signature that >> doesn't need appender. >> >> void toString(scope delegate(const(char)[]) sink) const{ >> //same code, but replace fasta.put(x) with sink(x) >> } > > Is there any documentation for this signature? Now that could be why nobody uses it :) This hole in documentation must be filled because it is a solution to allocation happiness of toString. AFAIK it supposed to be the new way of string conversion and the old one eventually deprecated. -- Dmitry Olshansky |
November 12, 2012 Re: Fasta parser | ||||
---|---|---|---|---|
| ||||
Posted in reply to bioinfornatics | 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 > Tanks to all this one http://dpaste.dzfl.pl/1f0aef89 works has bidirectional range :-) I will take a look to Dmitry comment about toString. at Ali about fasta, fasta format is as an array where is wrote into a plain text file. So they are no restriction in more it is not more harder to parse it from forward or reverse with mmfile i do not know how do same this regular file struct. |
Copyright © 1999-2021 by the D Language Foundation