[Bioperl-l] Problem: Can't call method "features" on an undefined value at BIO::DB::GFF.pl
Hang
hangsyin at gmail.com
Sun Jan 20 03:49:59 UTC 2008
Hi, Scott,
After adding die $!, I know something is wrong at line:
"my $segment = $db->segment(-name => '4', -start => 20000, -end => 25000);"
my gff file is like this:
##gff-version 3
##sequence-region 4 1 1351857
4 FlyBase transposable_element 2 611 . + .
ID=FBti0062890;Name=ninja-Dsim-like{}4829;Dbxref=FlyBase_Annotation_IDs:TE62890;derived_cyto_location=-;
4 repeatmasker_dummy match 2 347 . + .
ID=:1395923_repeatmasker_dummy;Name=1%2C347-AE003845.4-dummy-RepeatMasker;
4 repeatmasker_dummy match_part 2 347 2367 + .
ID=:5142029_dummy;Name=:5142029;Parent=:1395923_repeatmasker_dummy;target_type=so;Target=D83207
5860 6210 +;
...
...
I really got confused. Any further suggestion? Thank you!
Jon
Scott Cain-3 wrote:
>
> Hi Jon,
>
> I think it's funny that you have "or die" on the database opening line,
> "or die" on the @features line, but you didn't put one on the $segment
> line. Try adding "or die: $!" to the $segment line to see what it says,
> also add a 'print $segment' after you create it and before you try to
> get the features from it.
>
> Clearly, the problem is that $segment is not defined (that is, nothing
> is in it, not that the wrong thing is in it). The next trick is to find
> out why. My first guess, without looking at the data set, is that the
> arm is not really named '4'.
>
> Scott
>
> On Sat, 2008-01-19 at 10:25 -0800, Hang wrote:
>> Hi, everyone,
>>
>> I met this problem when I was running this script to extract features
>> overlaps with 4:20,000..25,000. It always responds like "Can't call
>> method
>> "features" on an undefined value at BIO::DB::GFF.pl line XX".
>> ==============================================================
>> use Bio::DB::GFF;
>> use Bio::Tools::GFF;
>> my $db = Bio::DB::GFF->new(-adaptor => 'dbi::mysql',
>> -dsn =>
>> 'dbi:mysql:dmel_gff:localhost',
>> -user => 'XXXX',
>> -pass => 'XXXX') || die "database
>> open failed";
>>
>> my $segment = $db->segment(-name => '4', -start => 20000, -end => 25000);
>> my @features = $segment->features(-types => ['gene', 'exon', 'intron',
>> 'five_prime_UTR', 'three_prime_UTR', 'CDS']) or die "no features";
>> print(scalar(@features)."\n");
>>
>> ================================================================
>> I am using activeperl 5.8.8 and bioperl 1.5.2 under Win32. I loaded
>> dmel_5.4.gff into mysql database by bulk_load_gff.pl without any error.
>> Other methods failed also.
>>
>> Any help will be deeply appreciated!
>>
>> Best,
>> Jon
>>
> --
> ------------------------------------------------------------------------
> Scott Cain, Ph. D. cain at cshl.edu
> GMOD Coordinator (http://www.gmod.org/) 216-392-3087
> Cold Spring Harbor Laboratory
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>
>
--
View this message in context: http://www.nabble.com/Problem%3A-Can%27t-call-method-%22features%22-on-an-undefined-value-at-BIO%3A%3ADB%3A%3AGFF.pl-tp14971922p14978241.html
Sent from the Perl - Bioperl-L mailing list archive at Nabble.com.
More information about the Bioperl-l
mailing list