[Bioperl-l] Bio::FeatureIO::gff bug?

Hilmar Lapp hlapp at gmx.net
Mon Sep 24 13:41:34 EDT 2007


I'd lean toward this or a similar approach too. Writing stuff out in  
the constructor doesn't feel like the best design.

	-hilmar

On Sep 24, 2007, at 9:35 AM, Chris Fields wrote:

>
> On Sep 24, 2007, at 8:20 AM, Sendu Bala wrote:
>
>> Chris Fields wrote:
>>> It looks like the first is a cut-and-paste revision of the second,
>>> so I would say the second independent if block is redundant.
>>
>> I agree. I'll make that change.
>>
>>
>>> Should we be printing output in _initialize()?  I would think any
>>> output would be handled in a write_* method of some sort and not
>>> in a common method used for initializing both input and output
>>> stream data.  What happens here if you use '-fh' and want output
>>> redirected to STDOUT?
>>
>> I think the problem is that the method is write_feature(), which
>> can be called many times for a single output file, but the version
>> should only be printed once at the very start of the file.
>>
>> I suppose it just needs better capturing of when we're intending to
>> write... Hmmm... didn't I fix a method related to that?...
>>
>> Yes, yes I did:
>> Bio::Root::IO->mode
>> ;)
>>
>> Any objections to me replacing the if clause with one using that
>> method?
>
> I think that'll work fine.  The other option would be call a
> print_gff_header() function within write_feature() with the intent to
> print the header only once, using a flag or similar:
>
> if (!$self->header_printed) {
>      $self->print_gff_header;
>      $self->header_printed(1);
> }
>
> chris
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l

-- 
===========================================================
: Hilmar Lapp  -:-  Durham, NC  -:-  hlapp at gmx dot net :
===========================================================







More information about the Bioperl-l mailing list