[BioSQL-l] (no subject)
Hilmar Lapp
hlapp at gnf.org
Thu Nov 6 17:48:44 EST 2003
On 11/6/03 1:26 AM, "matthieu CONTE" <m_conte at hotmail.com> wrote:
> Hello,
>
> We just transfered Arabidospsis Thalianias EMBL sequences via SwissProt in
> BioSQL format.
> We are able to take out sequences and annotations (using a
> Bio::DB::PersitenceAdaptorI and the find_by_unique_key method) from a
> BioentryID.
> But from an entry, we are unable to take out the access number Pfam, Prosite
> and others... from the crossreferences table (BioentryDbxref).
>
> Could you please tell us wich adaptor can we use and how to do it ?
>
> In short, how can we use the Bio ::DB:: ...adaptor to access to all the
> tables in a BioSQLformat?!!
>
Generally speaking, you use adaptors to pull objects out or get objects into
the database, the idea being you don¹t have to care a lot about which tables
are involved.
Since you don't exactly explain what you're trying to do, there's multiple
answers and I'll give you three, hoping to hit a match with at least one.
A) If all you know is the database and accession of the dbxref, you can pull
it out by a unique key query:
$dbxref = Bio::Annotation::DBLink->new(-dbname => 'Genbank',
-primary_id => 'BC6256426');
$adp = $db->get_persistence_adaptor($dbxref);
$found = $adp->find_by_unique_key($dbxref);
B) If you want to pull out all dbxrefs of a sequence entry, and you have the
seq object in hand, all annotation will have been loaded. Hence,
$seq = < ... e.g., find by unique key ...>
@dblinks = $seq->annotation->get_Annotations('dblink');
Will do the job.
C) Same as B) but you don't have the seq object and you don't want it
either.
$query = Bio::DB::Query::BioQuery->new(
-datacollections => ["Bio::SeqI s",
"Bio::Annotation::DBLink dbx",
"Bio::SeqI<=>Bio::Annotation::DBLink"],
-where => ["s.accession_number = 'BC236452'"]);
$adp = $db->get_persistence_adaptor("Bio::Annotation::DBLink");
$result = $adp->find_by_query($query);
while(my $dbx = $result->next_object()) {
# do something with $dbx
}
I may have forgotten a parameter or so, especially for C), check out the
documentation in Bio::DB::PersistenceAdaptorI (and possibly also
Bio::DB::BioSQL::BasePersistenceAdaptor, the base class for all
implementors).
Hth,
-hilmar
> Many thanks in advance,
>
> M
>
>
>
>
> Matthieu CONTE
> 23 route d'EUS
> 66500 CATLLAR
> Tel
> 0468962854
> m_conte at hotmail.com
>
> _________________________________________________________________
> MSN Search, le moteur de recherche qui pense comme vous !
> http://search.msn.fr/worldwide.asp
>
> _______________________________________________
> BioSQL-l mailing list
> BioSQL-l at open-bio.org
> http://open-bio.org/mailman/listinfo/biosql-l
>
--
-------------------------------------------------------------
Hilmar Lapp email: lapp at gnf.org
GNF, San Diego, Ca. 92121 phone: +1-858-812-1757
-------------------------------------------------------------
More information about the BioSQL-l
mailing list