[Bioperl-l] Re: [Bioperl-guts-l] bioperl commit

Chris Mungall cjm at fruitfly.org
Thu Jul 15 17:10:08 EDT 2004


> 	$gffio->allow_features_attached_to_seqs(1)

OK, I like this suggestion

Right, I tried switching my code to use the fasta parser once a ^\> is
reached

How do you think I should tackle this thorny problem:

I use $self->_pushback($line) to feed back the original header line to the
fasta parser.

However, the fasta parser sets the input record seperator $/=">\n", so I
actually have to read in up to but NOT including the next ^\> (or end of
file). Which means I actually have to switch $/ within the GFF parser!

Not only does this seem awkward and wrong, but the GFF parser will break
if someone decides to switch the fasta implementation to use standard
newline record seperators!

The simple solution is to force everyone to preceed the fasta section with
a ##FASTA directive - however, the spec says this is optional.

Another solution would be to ban setting of $/ within parsers as dangerous
(despite the "local" declaration, the effect is definitely NOT local); I'm
not sure what the ramifications of this are in terms of speed and
efficiency.

Of course, I could just go back to my own 8-line fasta parsing code
within GFF.pm.....

On Wed, 14 Jul 2004, Lincoln Stein wrote:

> I like the idea of the toggle, but we don't use the term "toggle"
> anywhere in bioperl right now.  How about "allow" as in:
>
> 	$gffio->allow_features_attached_to_seqs(1)
>
> It won't be used more than once per script, so not much overhead in
> having a long name.
>
> Lincoln
>
>
> On Wednesday 14 July 2004 10:37 am, Aaron J. Mackey wrote:
> > On Jul 13, 2004, at 12:42 PM, Chris Mungall wrote:
> > >>> +  $gffio->features_attached_to_seqs_toggle(1)
> > >>
> > >> Again, $gffio->attach_features(1) seems sufficient ...
> > >
> > > OK; although one might be led to expect that the argument for a
> > > method with that name would be a list of SeqFeatures. Is the BP
> > > method name syntax enshrined anywhere, or is it more a general
> > > set of principles shared by the authors?
> >
> > You're right.  No, there is no shrine, I think it's like the
> > difference between art and pornography; we know it when we see it.
> > Perhaps "$gffio->features_attached_to_seqs(1)" is the
> > necessarily-long-but-best answer?
> >
> > > So perhaps I should reeingineer it a bit so that it rejects
> > > anything that
> > > doesn't follow the spec. This makes it easier to use the FASTA
> > > parser.
> >
> > I think that'd be great, and should simplify matters a bit.
> >
> > Thanks again,
> >
> > -Aaron
> >
> > _______________________________________________
> > Bioperl-l mailing list
> > Bioperl-l at portal.open-bio.org
> > http://portal.open-bio.org/mailman/listinfo/bioperl-l
>
>



More information about the Bioperl-l mailing list