[Bioperl-l] Bio::DB::SeqFeature::Segment problem
Jon Flowers
jonathanmflowers at gmail.com
Thu Apr 30 20:22:23 UTC 2009
Jason,
I used the Bio::DB::SeqFeature::Store::GFF3Loader rather than the
bp_seqfeature_load.pl script. You were right, however. It looks like I had
populated the MySQL database with multiple fasta files. I cleared the
database, ran the GFF3Loader twice (once for the fasta, once for the GFF3).
Segment objects are appear to be working fine now.
THANKS!
Jonathan
Jason Stajich-3 wrote:
>
> One would have to see some of your GFF to know better. It sounds like
> you have chr1 defined in multiple places.
>
> Did you use the bp_seqfeature_load script to load the data in one go -
> it should catch it if you have non-unique IDs.
>
> -jason
> On Apr 30, 2009, at 9:40 AM, Jon Flowers wrote:
>
>>
>> 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.
>>
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>
> Jason Stajich
> jason at bioperl.org
>
>
>
> _______________________________________________
> 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/Bio%3A%3ADB%3A%3ASeqFeature%3A%3ASegment-problem-tp23319982p23322607.html
Sent from the Perl - Bioperl-L mailing list archive at Nabble.com.
More information about the Bioperl-l
mailing list