This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to download NCBI sequences using a list of Refseq IDs?

I have a list of Refseq IDs such as:

[1] "NM_010220"    "NM_001290393" "NM_007743"    "NM_175344"    "NM_029432"  
[6] "NM_001111121" "NM_153399"    "NM_007592"    "NM_181402"    "NM_013737"  
11] "NM_007737"    "NM_029967"    "NM_146062"    "NM_019477"    "NM_172746"  
16] "NM_024188"    "NM_001294143" "NM_178642"    "NM_001081007" "NM_011359"

What I wanted is to download the sequences (RNA) of these Refseq IDs. How to do this in R or through Linux terminals?

r

Hi ddzhangzz,

There is no need to delete your post, definitely not after it received an answer.

If an answer was helpful you should upvote it, if the answer resolved your question you should mark it as accepted. Upvote|Bookmark|Accept

Cheers,
Wouter

1 answer

Using NCBI eUtils:

esearch -db nucleotide -query "Your_acc_#" | efetch -format fasta > Your_acc.fa

or

 efetch -db nucleotide -id Your_acc_# -format fasta > Your_acc.fa

Edit: As @Pierre mentions below, you could get all of them via a single query, but will have to split the files up afterwards if you need them in individual files.

Log in to answer this question.