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

Chris Fields cjfields at uiuc.edu
Mon Sep 24 13:35:22 UTC 2007


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



More information about the Bioperl-l mailing list