[Bioperl-l] Bio::Annotation::SimpleValue

Paul Mooney pjm at sanger.ac.uk
Wed Nov 16 16:03:16 EST 2005


Hi,

I have stumbled on a problem when writing out an EMBL file. If my input
is;

FT   repeat_region   5..963
FT                   /colour="0"

when I try to write it out I get

FT   repeat_region   5..963
FT                   /colour=""

I think this is down to Bio::Annotation::SimpleVal doing a 'truth test'
on the value of the qualifier (zero is false), hence I get an empty
string. The code in SimpleValue.pm is;

use overload '""' => sub { $_[0]->value || ''};

Thanks,
Paul.

PS, its the same on 1.5.1 and live. Heres a simple test;

use strict;
use Bio::Annotation::SimpleValue;

my $simple = Bio::Annotation::SimpleValue->new(
                                               -tagname => 'colour',
                                               -value   => '0',
                                               );
print "SimpleValue = $simple\n";




More information about the Bioperl-l mailing list