<p>This has been answered before. See: <a href="https://stackoverflow.com/a/55402322/6262370">https://stackoverflow.com/a/55402322/6262370</a></p>

<p>In short, you need to either use <code>rettype='gbwithparts'</code> or <code>rettype='gb', style='withparts'</code> to download the entire genbank flat file.</p>

CC BY-SA 4.0
2019-05-15T13:37:36.537Z
Thanks, I also had to set `retmode='full'`, otherwise `SeqIO.read` would result in "ValueError: No records found in handle"
cmdoret
CC BY-SA 4.0
2019-05-12T11:29:44.107Z
2019-05-12T11:29:44.107Z
vkkodali
<p>I use the <code>efetch</code> bash command from <strong>edirect</strong>. </p>

<p>With <code>efetch -db nuccore -id CP001102.1 -format gb</code>, I get the <em>Candidatus Amoebophilus asiaticus 5a2</em>, complete genome in <strong>GenBank format</strong>.  </p>

<p>You might try your command with <code>CP001102.1</code> instead of <code>NC_010830</code></p>

CC BY-SA 4.0
2019-05-11T03:42:03.830Z
2019-05-11T03:42:03.830Z
aerijman
<p>I am using the biopython Entrez.efetch command to retrieve all features (CDS, mRNA, ...) of some genomes.</p>

<p>In this case (NC_014649, Acanthamoeba polyphaga mimivirus), it works as expected:</p>

<pre><code>from Bio import Entrez, SeqIO
handle = Entrez.efetch(id='NC_014649', db='nuccore', rettype='gb')
records = SeqIO.read(handle, 'gb')
records.features

[SeqFeature(FeatureLocation(ExactPosition(0), ExactPosition(1181549), strand=1), type='source'),
 SeqFeature(FeatureLocation(ExactPosition(191), ExactPosition(2609), strand=1), type='gene'),
 SeqFeature(FeatureLocation(ExactPosition(191), ExactPosition(2609), strand=1), type='mRNA'),
 SeqFeature(FeatureLocation(ExactPosition(191), ExactPosition(2579), strand=1), type='CDS'),
...
</code></pre>

<p>However in this case (NC_010830, Candidatus Amoebophilus asiaticus), it only returns one record for the whole genome.</p>

<pre><code>handle = Entrez.efetch(id='NC_010830', db='nuccore', rettype='gb')
records = SeqIO.read(handle, 'gb')
records.features
[SeqFeature(FeatureLocation(ExactPosition(0), ExactPosition(1884364), strand=1), type='source')]
</code></pre>

<p>However, if I check the corresponding file in the browser, it does have features: <a href="https://www.ncbi.nlm.nih.gov/nuccore/NC_010830.1" rel="nofollow noreferrer">https://www.ncbi.nlm.nih.gov/nuccore/NC_010830.1</a></p>

<p>What could be the reason for this inconsistency ? Did I  miss something ?</p>

CC BY-SA 4.0
2019-05-11T09:33:01.240Z
This happens and when I've encountered this I resolved it by digging the features out by a different method, @arijeman 'solution' if correct needs an explanation about why because it's funndamental.
M__
<genbank><entrez><efetch>
Entrez.efetch returns incomplete genbank records
# Entrez.efetch returns incomplete genbank records

(Asked by: username_0 on 2019-05-11)

I am using the biopython Entrez.efetch command to retrieve all features (CDS, mRNA, ...) of some genomes.
In this case (NC_014649, Acanthamoeba polyphaga mimivirus), it works as expected:
from Bio import Entrez, SeqIO
handle = Entrez.efetch(id='NC_014649', db='nuccore', rettype='gb')
records = SeqIO.read(handle, 'gb')
records.features

[SeqFeature(FeatureLocation(ExactPosition(0), ExactPosition(1181549), strand=1), type='source'),
 SeqFeature(FeatureLocation(ExactPosition(191), ExactPosition(2609), strand=1), type='gene'),
 SeqFeature(FeatureLocation(ExactPosition(191), ExactPosition(2609), strand=1), type='mRNA'),
 SeqFeature(FeatureLocation(ExactPosition(191), ExactPosition(2579), strand=1), type='CDS'),
...

However in this case (NC_010830, Candidatus Amoebophilus asiaticus), it only returns one record for the whole genome.
handle = Entrez.efetch(id='NC_010830', db='nuccore', rettype='gb')
records = SeqIO.read(handle, 'gb')
records.features
[SeqFeature(FeatureLocation(ExactPosition(0), ExactPosition(1884364), strand=1), type='source')]

However, if I check the corresponding file in the browser, it does have features: https://www.ncbi.nlm.nih.gov/nuccore/NC_010830.1
What could be the reason for this inconsistency ? Did I  miss something ?

**Tags:** genbank, entrez, efetch
> **Comments:**
> **username_1**: This happens and when I've encountered this I resolved it by digging the features out by a different method, @arijeman 'solution' if correct needs an explanation about why because it's funndamental.  

---

## 2 answers

### Answer by username_2 on 2019-05-12. Score: 5 | Accepted answer

This has been answered before. See: <https://stackoverflow.com/a/55402322/6262370>

In short, you need to either use `rettype='gbwithparts'` or `rettype='gb', style='withparts'` to download the entire genbank flat file.

> **Comments:**
> **username_0**: Thanks, I also had to set `retmode='full'`, otherwise `SeqIO.read` would result in "ValueError: No records found in handle"  

---

### Answer by username_3 on 2019-05-11. Score: 0

I use the `efetch` bash command from **edirect**.

With `efetch -db nuccore -id CP001102.1 -format gb`, I get the *Candidatus Amoebophilus asiaticus 5a2*, complete genome in **GenBank format**.

You might try your command with `CP001102.1` instead of `NC_010830`


---

