[Bioperl-l] Bio::DB::SeqFeature::Segment problem

Jon Flowers jonathanmflowers at gmail.com
Thu Apr 30 16:40:42 UTC 2009


Dear colleagues,

I have set up a mySQL database and loaded a GFF3 and fasta file using
Bio::DB::SeqFeature::Store::GFF3Loader.  Everything appears to be working
normally except when I attempt to create a Bio::DB::SeqFeature::Segment
object.

The following works as expected:

my $db = Bio::DB::SeqFeature::Store->new(-adaptor => 'DBI::mysql',
				                                 -dsn => 'dbi:mysql:foo',
				                                 -user => 'myuser',
				                                 -pass => 'mypassword',
				                                 -write => '1');

my @features = $db->features(-seq_id=>'chr1',
                                              -start=>1,
                                              -end=>10000,
                                              -types=>['gene']);

However, when I try to create a segment object using either of the two
following method calls I get an error:

my $segment  = $db->segment('chr1',1=>10000);

my $segment  = $db->segment( -seq_id => 'chr1', -start => '1', -end =>
'10000');

-------------------------------- EXCEPTION
------------------------------------

MSG: segment() called in a scalar context but multiple features match.
Either call in a list context or narrow your search using the -types or
-class arguments

STACK Bio::DB::SeqFeature::Store::segment
/usr/share/perl5/Bio/DB/SeqFeature/Store.pm:1178
STACK toplevel trial.pl:42
-------------------------------------------------------

Calling in list context (which is not defined in the documentation) produces
an array of 22 identical scalars = 'chr1:1..10000'.  

Any ideas?

Thanks

Jonathan

-- 
View this message in context: http://www.nabble.com/Bio%3A%3ADB%3A%3ASeqFeature%3A%3ASegment-problem-tp23319982p23319982.html
Sent from the Perl - Bioperl-L mailing list archive at Nabble.com.




More information about the Bioperl-l mailing list