Question: How to download specific sets of genes from different taxonomic groups from ncbi?
0
gravatar for Dramapeach
2.3 years ago by
Dramapeach0
Dramapeach0 wrote:

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.

sequence ncbi gene • 860 views
ADD COMMENTlink modified 2.3 years ago by Ramaraj K0 • written 2.3 years ago by Dramapeach0
0
gravatar for Puli Chandramouli Reddy
2.3 years ago by
Pune, India
Puli Chandramouli Reddy180 wrote:

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 COMMENTlink written 2.3 years ago by Puli Chandramouli Reddy180
0
gravatar for Ramaraj K
2.3 years ago by
Ramaraj K0
India
Ramaraj K0 wrote:

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 COMMENTlink written 2.3 years ago by Ramaraj K0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1375 users visited in the last hour