[Bioperl-l] how to get unigene-cluster with bio-db

stephan.rosecker stephan.rosecker at ish.de
Mon Mar 10 16:27:57 UTC 2008


Dear list,

I try to understand how to fetch unigene-cluster with help of bio-db and a local 
biosql-db, but without success.
I have transfered "Hs.data" with help of "bp_load_seqdatabase.pl".

#!/usr/local/bin/perl -w

use strict;
use Bio::DB::BioDB;
use Bio::DB::Query::BioQuery;

my $db = Bio::DB::BioDB->new(
         -database => 'biosql',
         -user   => 'postgres',
         -pass   => 'foo',
         -dbname   => 'bioseqdb',
         -host     => 'foo.bar',
         -port     => 5435,    # optional
         -driver   => 'Pg'
);

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

$query->datacollections(
          ["Bio::PrimarySeqI c::subject",
          "Bio::PrimarySeqI p::object",
         "Bio::PrimarySeqI<=>Bio::ClusterI<=>Bio::Ontology::TermI"]);
$query->where(["p.accession_number = 'Hs.2'"]);

my $adp = $db->get_object_adaptor('Bio::PrimarySeqI');
my $adp2 = $db->get_object_adaptor('Bio::ClusterI');
my $qres = $adp->find_by_query($query);
my $qres2 = $adp2->find_by_query($query);

while(my $pseq = $qres->next_object()) {
         print $pseq->accession_number,”\n”;
}
while(my $pseq = $qres2->next_object()) {
         print $pseq->accession_number,”\n”;
}

Maybe this way is wrong.
Hope you can help me.

stephan
  



More information about the Bioperl-l mailing list