[Bioperl-l] pubmed

Brian Osborne osborne1 at optonline.net
Wed May 10 03:01:49 UTC 2006


Qunfeng,

I'm using bioperl-live, I'm able retrieve the single PubMed id found in the
56961711 entry using the pubmed() method. Note that there are 4 references,
only one of which has a Pubmed id. Also, the authors() method prints out the
authors, not the Pubmed id. If you have a problem please show your code and
tell us which version of Bioperl you're using.

Brian O.


use strict;

use lib "/Users/bosborne/bioperl-live";

use Bio::DB::GenBank;



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

my $seq = $db->get_Seq_by_id(56961711);

my $ann_coll = $seq->annotation;


foreach my $ann ($ann_coll->get_Annotations('reference')) {

  print "Author: ", $ann->authors, "\nPubmed id: ", $ann->pubmed, "\n";

}





On 5/9/06 9:35 PM, "Yu ZHOU" <zhouyubio at gmail.com> wrote:

> Qunfeng <qfdong <at> iastate.edu> writes:
> 
>> 
>> Hi there,
>> 
>> http://bioperl.org/HOWTOs/Feature-Annotation/anno_from_genbank.html
>> 
>> I am not very familiar with BioPerl. I tried to follow the example showing
>> in the above page to retrieve pubmed ID under each Reference tag , i.e.,
>> $value->pubmed(), but it doesn't work for me for the seq gi#56961711. The
>> authors() works for me.  Appreciate any suggestions.
>> 
>> Qunfeng 
>> 
> 
> 
> Hi, 
> 
> I have the same problem with you. Here is what I have done, by using regular
> expression to match the value of 'location' tag, if there is.
> 
> #------------------
> my $ann = $seqobj->annotation(); # annotation object
> foreach my $ref ( $ann->get_Annotations('reference') ) {
>     print "Title: ", $ref->title,"\n";
>     print "Location: ", $ref->location, "\n";
>     if ($ref->location =~ /PUBMED\s+(\d+)/) {
> my $pmid = $1;
> print "PMID: ", $pmid, "\n";
>     }
>     print "Authors: ", $ref->authors, "\n";
> }
> #------------------
> 
> 
> _______________________________________________
> 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