This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Downloading nucleotide sequences using command line

I am trying to find some help for command-line download of NCBI datasets. I came across the following: https://www.ncbi.nlm.nih.gov/books/NBK179288/

I wish to download a certain number of nucleotide sequences for which I have the accession numbers. However, I cannot find the correct command to use for a list of such sequences in the above link.

What I am currently using is the following:

epost -db nucleotide -input <Accessions file>  | efetch -format fasta  > <OUTPUT FASTA file>

Is this the correct way to do this? Are there better ways to accomplish the same thing?

Thanks!

entrez direct

1 answer

Yes that is the correct way of doing this. Make sure your accessions are one per line in the Accession file. You should also sign up for NCBI_API_KEY if you are going to download a few hundred of them.

Thanks. Will look into API keys, since I am thinking of scripting my requests.

Log in to answer this question.