[BioSQL-l] SeqFeature scores

Mark Johnson johnsonm at gmail.com
Mon Oct 13 18:29:18 UTC 2008


I just noticed that instances of Bio::SeqFeature::Generic
round-tripped through BioSQL (via bioperl-db) seem to be loosing their
scores.

Stored thusly:

my $dbadp = Bio::DB::BioDB->new(
                                -database => 'biosql',
                                -user        => $user,
                                -pass        => $pass,
                                -dbname   => $oracle_instance,
                                -driver       => 'Oracle'
                            );

my $adp = $dbadp->get_object_adaptor("Bio::SeqI");

my $seq = Bio::Seq->new(
                        -id               => 'DEBUG001',
                        -accession_number => 'DBG001',
                        -desc             => 'Debug Sequence',
                        -seq              => 'GATTACA',
                        -namespace        => 'DEBUG',
                       );

my $feature = Bio::SeqFeature::Generic->new(
                                            -seq_id           => 'DEBUG001',
                                            -display_name     => 'FEAT0001',
                                            -primary          => 'debug',
                                            -source           => 'mjohnson',
                                            -start            => 1,
                                            -end              => 1000,
                                            -strand           => 1,
                                            -score            => 100
                                           );

$seq->add_SeqFeature($feature);

my $pseq = $dbadp->create_persistent($seq);

$pseq->store();
$adp->commit();

Fetched thusly:

my $dbadp = Bio::DB::BioDB->new(
                                -database => 'biosql',
                                -user        => $user,
                                -pass        => $pass,
                                -dbname   => $oracle_instance,
                                -driver       => 'Oracle'
                            );

my $adp = $dbadp->get_object_adaptor("Bio::SeqI");

my $query = Bio::DB::Query::BioQuery->new();

$query->datacollections([
                         "Bio::PrimarySeqI s",
                        ]);

$query->where(["s.display_id = 'DEBUG001'"]);

my $result = $adp->find_by_query($query);

while (my $seq = $result->next_object()) {

    my @features = $seq->get_SeqFeatures();

    foreach my $feature (@features) {

        print join(
                   "\t",
                   $feature->display_name(),
                   $feature->score()
                  ), "\n";

    }

}

It seems that $feature->score() is returning undef.

I foresee three possibilities, in order of decreasing liklihood:

1) I'm doing something dumb
2) I'm expecting the wrong behaviour
3) I'm seeing some kind of odd bug

I'm not opposed to spending some time in the debugger if it's 3, but I
think 1 or 2 is far more likely.

Comments/advice/rotten vegetables?



More information about the BioSQL-l mailing list