I have following accession numbers of the 10 chromosomes of Theobroma cacao genome.

NC_030850.1
NC_030851.1
NC_030852.1
NC_030853.1
NC_030854.1
NC_030855.1
NC_030856.1
NC_030857.1
NC_030858.1
NC_030859.1


I need to download these FASTA files using the terminal because I'm working on a server. I'll be grateful if someone can help me. Thank you.

Alternatively, you can use the NCBI Entrez Direct UNIX E-utilities

In the terminal, install it using: source ./install-edirect.sh

esearch -db nucleotide -query "NC_030850.1" | efetch -format fasta > NC_030850.1.fasta

As you have several sequences to download, I think it will be quite easy to add this command into a little bash script to process all of them.

• Thank you very much for all the support. Nov 13 '19 at 18:02
• @MudithMMBc, you're welcome ;)
– dc37
Nov 13 '19 at 18:49
1. Go to the main FASTA sequence page, view source, and get the "ncbi_uidlist" value. In this case, it's 1061361601
https://www.ncbi.nlm.nih.gov/sviewer/viewer.fcgi?id=1061361601&db=nuccore&report=fasta&retmode=text&withmarkup=on&tool=portal&log$=seqview&maxdownloadsize=100000000 You can also get this link directly, by using Chrome's developer tools (F12), viewing the Network tab, then loading the page in (1). (Sorry, I can't post a comment with my reputation score). @vkkodali, interesting command I did not know about it ;). However, your command is downloading all sequences from the input file into a single fasta file. I believe that if you have a big bunch of sequences, it could be a little bit tricky after to manipulate that kind of file. Just by curiosity, do you have a trick to create one sequence per file using efetch ? • If you have a big bunch of sequences, you will end up with a lot of files. Whether you want a large number of files or just one file is, I guess, a personal choice. A multifasta file is fairly standard though. I don't think you can create individual files for each sequence using epost and efetch; you will have to either use a bash script or postprocess the efetch output using the unix tool split. Nov 8 '19 at 2:28 • Ok, I understand it. Thanks for your thoughts ;) – dc37 Nov 8 '19 at 2:31 ## Downloading entire genomes The best way to download FASTA sequences for an entire genome is to search for the genome, for example Theobroma cacao genome in the NCBI Assembly portal and use the big blue Download button. ## Downloading individual chromosomes For a given assembly, if you want to download the FASTA sequences for a bunch of chromosomes, you can do that by going to the Genomes FTP path highlighted in the screenshot: Once you are in the Genomes FTP path, you can navigate to the FASTA folder as follows: Theobroma FTP directory >> Assembly Structure >> Primary Assembly >> Assembled Chromosomes >> FASTA. ## Downloading a few sequences For this, you can use Entrez Direct as mentioned by @dc37. Why not always use Entrez Direct? While it is fine for a small number of sequences, it can be slow to download a large number of sequences. Entrez Direct by default will download uncompressed data so you will end up spending more time downloading a larger file instead of downloading a smaller, compressed file from FTP more quickly. If you were to use Entrez Direct for this purpose, I'd not bother with a bash script and use epost to first post the entire list of accessions and then pipe it to efetch as shown below: epost -db nuccore -input <file_with_accs> -format acc \ | efetch -format fasta > sequences.fasta  • Thank you very much for all the support. Nov 13 '19 at 18:02 Just wget or curl each as https://www.ncbi.nlm.nih.gov/nuccore/NC_030853.1?report=fasta&log$=seqview&format=text...
• This doesn’t seem to work (any longer?). For instance, curl -L 'https://www.ncbi.nlm.nih.gov/nuccore/NC_030853.1?report=fasta&log\$=seqview&format=text' downloads a HTML page with an (invisible) form on it, not a FASTA file. May 27 '21 at 15:30