[Bioperl-l] Use of uninitialized value in length at Bio/DB/SeqFeature/Store/DBI/mysql.pm line 1062

Dan Bolser dan.bolser at gmail.com
Mon Mar 28 16:08:52 EDT 2011

On 27 March 2011 21:13, Chris Fields <cjfields at illinois.edu> wrote:
> On Mar 27, 2011, at 12:55 PM, Dan Bolser wrote:
>> On 27 March 2011 18:28, Jason Stajich <jason at bioperl.org> wrote:
>>> Dan - not sure why you would need to do this as length on an undef should
>>> still return false (an undef).
>>> $ perl -e '$g=""; if( length($g)) { print "yes" } else { print "no"} print
>>> "\n"'
>>> no
>>> $ perl -e '$g=undef; if( length($g)) { print "yes" } else { print "no"}
>>> print "\n"'
>>> no
>> Doesn't the latter spew a warning? (The output before / after my 'bug
>> fix' is the same, I just don't see 100s of warnings about undefined
>> values).
> Only with later versions of perl (I think perl 5.12).
>>> Also, having no 'source' is probably not proper GFF3.
>> I'm quite sure it is, but by GFF does have a source. I'm just calling
>> 'features' with only a feature type and not a feature type and a
>> source (because I only care about source). My call is pretty similar
>> to the example here:
>> http://search.cpan.org/~cjfields/BioPerl-1.6.0/Bio/DB/SeqFeature/Store.pm#features
>> @features = $db->features(-seqid=>'Chr1',-start=>5000,-end=>6000,-types=>'mRNA');
> I think Jason is inferring that the GFF3 is invalid from your statement below re: $source_tag not being defined, which to me means the source attribute for the feature is not defined.
> Note: b/c something works with SF::Store does NOT mean the source is proper GFF3; it is quite possible to have invalid GFF3 loaded into the database w/o a hiccup.  I think the loader assumes the data loaded has already been validated; IIRC there is very little validation done on GFF3 loaded into SF::Store, particularly the 'type'.

As I said, my GFF3 does have a source. I'll try to put together a test
script, as it seems like the value should not be undef (but thanks for
the tip Roy).

I had a feeling that this relatively trivial fix was a sticking
plaster on a larger problem.

> chris

More information about the Bioperl-l mailing list