[Bioperl-l] How to extract xref information from seq object that isfetched from GenBank?

Chris Fields cjfields at uiuc.edu
Wed Aug 30 22:14:27 UTC 2006


You may want to upgrade to at least bioperl v. 1.5.1.  I'm not sure how
DBSOURCE is handled in v 1.4 but it looks like the data is stored in a
Bio::Annotation::DBLink in CVS.  So, you should be able to do something like
this:

use Bio::SeqIO;
use Bio::DB::GenBank;

my $seqin = Bio::DB::GenBank->new();

my $seq = $seqin->get_Seq_by_acc('P38038');

my @annotations = $seq->get_Annotations('dblink');
for my $value (@annotations) {
    print "Tagname :", $value->tagname,"\n";
    print "Annotation value :", $value->as_text,"\n";
}

Chris

> -----Original Message-----
> From: bioperl-l-bounces at lists.open-bio.org [mailto:bioperl-l-
> bounces at lists.open-bio.org] On Behalf Of Sang Chul Choi
> Sent: Wednesday, August 30, 2006 2:25 PM
> To: bioperl-l
> Subject: [Bioperl-l] How to extract xref information from seq object that
> isfetched from GenBank?
> 
> Hi,
> 
> I am trying to fetch protein-coding DNA sequence from the public database.
> I used Bio::DB::GenBank to fetch firstly protein sequence using SwissProt
> ID
> or GenBank ID. Then, I am trying to look for DBSOURCE, which points to
> where I can fetch the DNA sequence. But, I don't know how to get that
> information.
> Often, there are many links in 'xrefs' of DBSOURCE. For example,
> ---------------------
> DBSOURCE    swissprot: locus CYSJ_ECOLI, accession P38038;
>             class: standard.
>             extra accessions:P14782,Q2MA65,created: Oct 1, 1994.
>             sequence updated: Jun 27, 2006.
>             annotation updated: Jun 27, 2006.
>             xrefs: M23008.1, AAA23650.1, U29579.1, AAA69274.1, U00096.2,
>             AAC75806.1, AP009048.1, BAE76841.1, H65057, 1DDGA, 1DDGB,
> 1DDIA,
>             1YKGA
> ----------------------
> 
> I thought I could use Annotation object like this to have information
> of DBSOURCE,
> but I am starting to think I may be wrong because I could not get that
> DBSOURCE
> information using Annoation object.
> 
> ----------------------------------------
> use Bio::DB::GenBank;
> $gb = new Bio::DB::GenBank;
> 
> $seq = $gp->get_Seq_by_acc('P38038');
> $ann_coll = $seq->annotation;
> for $ann ($ann_coll->get_Annotations) {
>    print $ann->tagname, " ", $ann->as_text, "\n";
> }
> ----------------------------------------
> 
> How can I get this DBSOURCE information?
> 
> Thank you,
> 
> Sang Chul
> 
> --
> ===============================
> Live, Learn, and Love!
> E-mail : goshng at empal dot com
>             goshng at gmail dot com
> ===============================
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l




More information about the Bioperl-l mailing list