[Biopython] Biopython error

Damian Menning dmenning at mail.usf.edu
Mon Aug 22 21:07:55 UTC 2016


Hello everyone,

  I am running a Python 2.7 script that has worked in the past but now is
throwing an error.  I am wondering if there has been a change recently that
may be causing the problem.

  My script searches NCBI using each Genus species name for a list
(species), a general category like bony fish (cat), and a search term like
16S (add_term) and returns a list of non-replicated ids.  The script is
below:

def ncbi_search(species_list):
    global full_gi_list
    print "\nSearching NCBI for"+str(species)+' and '+str(add_term)+' and
'+str(cat)+'\n'
    search_handle=Entrez.esearch(db="nucleotide", term=cat + ' AND ' +
add_term + ' AND ' + species, usehistory="y", RetMax=9999)
    search_results=Entrez.read(search_handle)
    search_handle.close()
    gi_list=search_results["IdList"]
    full_gi_list.extend(gi_list)
    return full_gi_list

    for species in species_list:
        ncbi_search(species_list)

The error I am getting is:

Traceback (most recent call last):
  File "D:\Python27\0
eDNA\02_GenBank_get_fasta_or_gb_no_repeats_1_search_criter
ia.py", line 98, in <module>
    ncbi_search(species_list)
  File "D:\Python27\0
eDNA\02_GenBank_get_fasta_or_gb_no_repeats_1_search_criter
ia.py", line 49, in ncbi_search
    search_results = Entrez.read(search_handle)
  File "C:\Python27\lib\site-packages\Bio\Entrez\__init__.py", line 376, in
read

    record = handler.read(handle)
  File "C:\Python27\lib\site-packages\Bio\Entrez\Parser.py", line 205, in
read
    self.parser.ParseFile(handle)
  File "C:\Python27\lib\site-packages\Bio\Entrez\Parser.py", line 343, in
endEle
mentHandler
    raise RuntimeError(value)
RuntimeError: Invalid db name specified: nuccore

  Any ideas on what is going wrong?

  Thanks for the help

  Damian

-- 
Damian Menning, Ph.D.

"There are two types of academics. Those who use the Oxford comma, those
who don't and those who should."

Standard comma - You know Bob, Sue and Greg? They came to my house.
Oxford comma - You know Bob, Sue, and Greg? They came to my house.
Walken Comma - You know, Bob, Sue, and Greg? They came, to my house.
Shatner comma - You, know, Bob, Sue, and Greg? They, came, to my house.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/biopython/attachments/20160822/8772fdd3/attachment.html>


More information about the Biopython mailing list