This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How To Download .Gbk Files From Ncbi Website

How to download .gbk files from ncbi website?

ncbi genbank

This is a much older question but I am having the same issue and have followed the posted answers. NCBI seems to only be providing me with GenBank flat format files not regular gb/gbk, which I need for annotations when importing into MauveAligner.

Please advise.

NCBI seems to only be providing me with GenBank flat format files not regular gb/gbk

What does that mean? A GenBank format file will contain annotation but will still be plain text.

For example using EntrezDirect (truncated for space):

$ efetch -db nuccore -id NM_001123229 -format gb
LOCUS       NM_001123229            4047 bp    mRNA    linear   VRT 19-SEP-2021
DEFINITION  Danio rerio insulin receptor b (insrb), mRNA.
ACCESSION   NM_001123229 XM_685977
VERSION     NM_001123229.1
KEYWORDS    RefSeq.
SOURCE      Danio rerio (zebrafish)
  ORGANISM  Danio rerio
            Eukaryota; Metazoa; Chordata; Craniata; Vertebrata; Euteleostomi;
            Actinopterygii; Neopterygii; Teleostei; Ostariophysi;
            Cypriniformes; Danionidae; Danioninae; Danio.
REFERENCE   1  (bases 1 to 4047)
  AUTHORS   Helal M, Yan C and Gong Z.
  TITLE     Stimulation of hepatocarcinogenesis by activated cholangiocytes via
            Il17a/f1 pathway in kras transgenic zebrafish model

when the GB file contains more data the format has to be gbwithparts otherwise just a skeleton file with top level annotation will be returned.

the best way to get GenBank files in 2021 is with bio

pip install bio --upgrade

then

bio fetch NM_001123229 > data.gb

nothing needs to be set, bio will all figure it out. If you want the gff file do:

bio fetch NM_001123229 --format gff > data.gff

Then use the rest of bio to manipulate the file to your hearts content.

Hi, why did you delete this post, especially after it was replied to?

Thought I had deleted it before anyone replied, I had figured it out, although it was not intuitive.

You could just add what you figured out, especially if it's not intuitive. Other people (including your future self) could benefit from the time you spent addressing this problem.

1 answer

Search for the sequence that you want. The "display settings" link at the upper left hand corner will allow you to display the entry in various formats. Choose genbank. The upper right hand corner has a "send to" button that'll let you send to file and download the entry in genbank format.

No other answer required :)

Log in to answer this question.