Retrieve genus and species info using NCBI-EUtils
0
0
Entering edit mode
9.2 years ago
Sej Modha 5.3k

I am using following code in a perl script to retrieve ScientificName for a taxid. I would also like to retrieve other fields such as species and genus but when I used the get_contents_by_name method for any other item it gives me Can't call method "get_contents_by_name" on an undefined value error.

Any help would be appreciated.

my $factory = Bio::DB::EUtilities->new(-eutil => 'esummary',
                                            -email => 'mymail@foo.bar',
                                            -db    => 'taxonomy',
                                            -id    => $taxid );
my ($name)  = $factory->next_DocSum->get_contents_by_name('ScientificName');

# print "$name\n";
my ($genus) = $factory->next_DocSum->get_contents_by_name('Genus');
print "$genus\n";
NCBI EUtilities • 1.9k views
ADD COMMENT

Login before adding your answer.

Traffic: 5772 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6