[Bioperl-l] Problem: Can't call method "features" on an undefined value at BIO::DB::GFF.pl

Scott Cain cain.cshl at gmail.com
Sun Jan 20 04:08:04 UTC 2008


Hi Jon,

Well, seeing the error message would be helpful, but my first guess
without is that there are a few things you can try:

  * removing the "sequence-region" line from the GFF file, adding a line
like this:

  4   FlyBase  chromosome_arm  1  1351857 .  .  .  ID=4;Name=4

and then reloading the database.

  * Or, you may want to consider using Bio::DB::SeqFeature::Store, since
Bio::DB::GFF3 doesn't always behave correctly with complex GFF3 (that
is, with three levels of features (like gene, mRNA and CDS)).

Scott

On Sat, 2008-01-19 at 19:49 -0800, Hang wrote:
> 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
> > 
> > 
> 
-- 
------------------------------------------------------------------------
Scott Cain, Ph. D.                                         cain at cshl.edu
GMOD Coordinator (http://www.gmod.org/)                     216-392-3087
Cold Spring Harbor Laboratory




More information about the Bioperl-l mailing list