How to download specific sets of genes from different taxonomic groups from ncbi?
2
0
Entering edit mode
6.9 years ago
Dramapeach • 0

Hello, I need to download sets of specific genes (their nucleotide sequences) from different taxonomic groups from ncbi. What is the best way to do it quickly? By the way, I have list of Gene IDs but can't download fasta file througt Batch Entrez. Thanking you in advance.

gene sequence ncbi • 2.2k views
ADD COMMENT
0
Entering edit mode
6.9 years ago

Hi,

You can download the fasta files from a list of gene IDs at "https://www.ncbi.nlm.nih.gov/sites/batchentrez". You have to give a file with list of gene IDs and then save the records using "send to" option to a file in fasta format (by default it shows "summary" filed which can be changed to "FASTA").

ADD COMMENT
0
Entering edit mode
6.9 years ago
Ramaraj K • 0

Hi, you can use the simple Python script to download the nucleotide sequence in FASTA format. Before that, you need to keep all the Entrez gene IDs in a text (.txt) file like,

11820
351
54226

To simplify the script, Biopython package was used in the following code.

from Bio import Entrez
id = open ('\gene_id_list.txt').readlines() # Rediret to the .txt directory
for i in id:
    i = i.strip()
    seq = open (i + '.fasta', 'w')
    handle = Entrez.efetch(db = "nucleotide", id=i, rettype = 'fasta')
    seq.write(handle.read())
ADD COMMENT

Login before adding your answer.

Traffic: 1046 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6