[Bioperl-l] Bio::FeatureIO::gff bug?
Chris Fields
cjfields at uiuc.edu
Mon Sep 24 13:09:46 UTC 2007
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.
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?
chris
On Sep 24, 2007, at 4:35 AM, Sendu Bala wrote:
> Hi,
>
> I'm finding that when writing GFF files the version header line gets
> printed out twice. This is because:
>
> sub _initialize {
> # [snip]
>
> if ($arg{-file} =~ /^>.*/ ) {
> $self->_print("##gff-version " . $self->version() . "\n");
> }
> else {
> my $directive;
> while(($directive = $self->_readline()) && ( $directive =~ /
> ^##/ ||
> $directive =~ /^>/)){
> $self->_handle_directive($directive);
> }
> $self->_pushback($directive);
> }
>
> if ($arg{-file} =~ /^>.*/ ) {
> $self->_print("##gff-version " . $self->version() . "\n");
> }
>
> # [snip]
> }
>
> Does it make sense for if ($arg{-file} =~ /^>.*/ ) to appear twice
> like
> that? If not, which one should be removed? The independent one, or the
> if/else one?
>
>
> Cheers,
> Sendu.
More information about the Bioperl-l
mailing list