[Bioperl-l] remote location support in BioSQL (bioperl-db) /Oracle

Razvan Sultana rsultana at jimmy.harvard.edu
Mon Dec 5 13:27:13 EST 2005

Hi !
I have a question regarding the bioperl-db implementation in Oracle.
I have created a BioSQL schema in Oracle and populated with the latest 
version of Genbank.
I used the "bleeding edge" version of bioperl, bioperl-db and 
bioperl-schema from the CVS repository.

When I try to extract the spliced sequences of the CDS features of 
entries that have remote locations (e.g., for AF327267: 
the appended  code complains that it
Can't locate object method "get_Seq_by_acc" via package 
and rightly so, because the above object doesn't implement the 
Bio::DB::RandomAccessI interface.
If I omit $db from the spliced_seq() method call, I obviously get the 
MSG: cannot get remote location for AF327268.1 without a valid 
Bio::DB::RandomAccessI database handle (like Bio::DB::GenBank)

My question is: is there an object to the BioSQL schema that implements 
Bio::DB::RandomAccessI ?
If there is, how do I get a handle to it?
If there isn't, I would be willing to help implementing it.

Thank you,
Razvan Sultana

use strict;
use Bio::DB::BioDB;
use Bio::Seq::RichSeq;
use Bio::DB::Query::BioQuery;
use Getopt::Long;

my $host = 'kevin';
my $dbuser = 'biosql';
my $dbpass;
my $dbname = 'biocompd';
my $driver = 'Oracle';
my $acc;
my $biodbname = 'genbank';

&GetOptions( 'host=s' => \$host,
             'driver=s' => \$driver,
         'dbuser=s' => \$dbuser,
         'dbpass=s' => \$dbpass,
         'dbname=s' => \$dbname,
         'accession=s' => \$acc);
$acc = 'AF327270' unless $acc;

my $db = Bio::DB::BioDB->new(-database => "biosql",
                 -host     => $host,
                 -dbname   => $dbname,
                 -driver   => $driver,
                 -user     => $dbuser,
                 -pass     => $dbpass,

my $seqadaptor = $db->get_object_adaptor('Bio::SeqI');
my $query = Bio::DB::Query::BioQuery->new(-datacollections => 
['Bio::PrimarySeqI e',
'BioNamespace=>Bio::PrimarySeqI db'],
                                          -where => ["e.accession_number 
= '$acc'",
my $seq_object = Bio::Seq::RichSeq->new();
my $query_result = $seqadaptor->find_by_query($query);

while ($seq_object = $query_result->next_object()) {
  for my $feature ($seq_object->get_SeqFeatures()) {
    my $full_sequence = $seq_object->seq();
    my $cds_seq = $feature->spliced_seq($db)->seq() if 
($feature->primary_tag() eq 'CDS');

More information about the Bioperl-l mailing list