Skip to main content
edited tags
Link
M__
  • 13k
  • 5
  • 29
  • 46
edited title
Link
gringer
  • 15.1k
  • 5
  • 24
  • 83

Entrez (Biopython) esearch and efetch not retuningreturning sequence as expected

Source Link

Entrez (Biopython) esearch and efetch not retuning sequence as expected

I'm trying to use Entrez (through Biopython) to download the sequence of a TMV replicase gene.

I have the following code:

# Lookup ID
search = Entrez.esearch(db='gene', term='Tobacco mosaic virus[Orgn] AND replicase')
read = Entrez.read(search)
idlist = read["IdList"]

# Fetch sequence
search = Entrez.efetch(db='gene', id=idlist[0], retmode='text', rettype='gb')
read = SeqIO.read(search, "genbank")
tmv_replicase = read.seq

But when I run it it throws the exception on the SeqIO.read line: ValueError: No records found in handle.

The IDs provided in idlist are: ['1494081', '1494082'].