[Bioperl-l] getting pubmed id from genbank files

Nathan Haigh n.haigh at sheffield.ac.uk
Tue Jul 26 10:49:22 EDT 2005


Yeah, I tried this after I found a previous post from someone wanting to do
the same thing and you suggested the same thing that time.

However, it doesn't return anything!

My script is simply:

-- snip --
use Bio::DB::GenBank;
use Data::Dumper;

my $db = Bio::DB::GenBank->new;

while (<STDIN>) {
        chomp;
        my $seq = $db->get_Seq_by_gi($_);
        my $ac = $seq->annotation;
        
        for my $ref ($ac->get_Annotations('reference')) {
                print "Reference :", $ref->title,"\t";
                print "PubMed :", $ref->pubmed,"\n";
        }
}
-- snip --

if I pass 46367591 on STDIN I get the following output:

-- snip --
Reference :Functional divergence in tandemly duplicated Arabidopsis thaliana
trypsin inhibitor genes        PubMed :
Reference :Direct Submission        PubMed :
Reference :Direct Submission        PubMed :
-- snip --

If I do Data::Dumper on $ref I get:

-- snip --
$VAR1 = bless( {
       'authors' => 'Clauss,M.J. and Mitchell-Olds,T.',
       'location' => 'Genetics 166 (3), 1419-1436 (2004) PUBMED   15082560',
       'title' => 'Functional divergence in tandemly duplicated Arabidopsis
thaliana trypsin inhibitor genes',
       'tagname' => 'reference'
     }, 'Bio::Annotation::Reference' ); 
-- snip --

The pubmed id doesn't seem to be getting parsed out! Any ideas?

Nathan

-----Original Message-----
From: Jason Stajich [mailto:jason.stajich at duke.edu] 
Sent: 26 July 2005 15:28
To: Bioperl-l at portal.open-bio.org
Cc: Nathan Haigh
Subject: [Bioperl-l] getting pubmed id from genbank files



Here is part of the synopsis in Bio::Seq:

     foreach my $ref ( $ann->get_Annotations('reference') ) {
         print "Reference ",$ref->title,"\n";
     }

  so do $ref->pubmed instead of $ref->title.


-jason
> On Jul 26, 2005, at 6:02 AM, Nathan Haigh wrote:
>
>> I want to be able to supply a list of GI's, retrieve the genbank 
>> files and
>> parse out the pubmed id's.
>>
>>
>>
>> I know I can do the first steps of retrieving the genbank files 
>> directly,
>> but how do I get the pubmed id's? I've been playing around with 
>> things and
>> haven't yet found out if this can be done.
>>
>>
>>
>> Cheers,
>>
>> Nathan
>>
>>
>>
>> ----------------------------------
>>
>> Nathan Haigh
>>
>> Bioinformatics PostDoctoral Research Associate
>>
>>
>>
>> Room B2 211
>>
>> Department of Animal and Plant Sciences
>>
>> University of Sheffield
>>
>> Western Bank
>>
>> Sheffield
>>
>> S10 2TN
>>
>>
>>
>> Tel: +44 (0)114 22 20112
>>
>> Mob: +44 (0)7742 533 569
>>
>> Fax: +44 (0)114 22 20002
>>
>>
>>
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at portal.open-bio.org
>> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>>
> --
> Jason Stajich
> http://www.duke.edu/~jes12
> jason.stajich -at- duke.edu
>
>
--
Jason Stajich
http://www.duke.edu/~jes12
jason.stajich -at- duke.edu





More information about the Bioperl-l mailing list