This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Download reference mitochondria sequence

Is there a way to download individual mitochondrial sequences from NCBI without having to scrape from their webpages or to download thousands of other sequences alongside. Is there some programmatic way to access these fasta data, for example:

https://www.ncbi.nlm.nih.gov/nuccore/NC_012920.1?report=fasta

sequence

2 answers

You can use "Send to" drop down on that page to send the data to a file. No scraping needed.

If you have many of these to get then using NCBI eUtils is the best option. For example for the link you posted you can do this

efetch -db nuccore -id NC_012920.1 -format fasta > NC_012920.fa

Thanks, but installing eutils as below failed with errors: "Is libxml2 installed?" (yes, it is...)

pip3 install eutils

Glad you mentioned eutils though, as it led me to find this post, which showed me how to build the URL in the answer below.

Log in to answer this question.