This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Retrieve genus and species info using NCBI-EUtils

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

0 answers

No answers yet.

Log in to answer this question.