source: getPubmednumberFromDescription.pl

Last change on this file was 1, checked in by maarten, 9 years ago

initial import

File size: 1.1 KB
Line 
1#!/usr/bin/perl
2use warnings;
3use strict;
4use Data::Dumper;
5# use SOAP::Lite;
6# my $protid = "Neuromusc. Disord. 13 501-507 (2003)";
7# my $efetch = SOAP::Lite
8# -> service('http://www.ncbi.nlm.nih.gov/entrez/eutils/soap/v2.0/eutils.wsdl');
9# my $result = $efetch -> run_eSearch(
10# SOAP::Data->name(db => "PubMed"),
11# SOAP::Data->name(term => $protid));
12# # print ">";
13# # print $result->{GBSeq}->{'GBSeq_primary-accession'};
14# # print "\n";
15# # print uc($result->{GBSeq}->{GBSeq_sequence});
16# # print "\n";
17# print($result);
18
19use Bio::DB::EUtilities;
20my $search="Neuromusc. Disord. 13 501-507 (2003)";
21my $result = Bio::DB::EUtilities->new(-eutil => 'esearch',
22                         -db => 'pubmed',
23                         -term => $search,
24                         -retmax => 10);
25 
26# query terms are mapped; what's the actual query?
27#print "Query translation: ",$factory->get_query_translation,"\n";
28# query hits
29
30# UIDs
31my $pumbedid="";
32if ($result->get_count == 1){
33  my @ids = $result->get_ids();
34  $pumbedid=join(" ",@ids);
35
36}else{
37$pumbedid=$search;
38}
39print($pumbedid)
40
41 
Note: See TracBrowser for help on using the repository browser.