Go Back   SEQanswers > Bioinformatics > Bioinformatics

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to convert UCSC gene names to gene symbol gigigou Bioinformatics 5 05-19-2015 05:23 AM
A script for Cuffdiff: extract differential expression gene sequences from genome.fa foxriverlin Bioinformatics 17 04-11-2013 03:46 AM
How do I extract partial sequence data (Fasta) from multiple hits in NCBI nucleotide? andtill Bioinformatics 1 11-09-2012 01:49 PM
Extract intergenics regions from ncbi RTK45 Bioinformatics 1 03-21-2012 02:24 PM
CUFF_id -> Gene symbol tool? Inti Bioinformatics 0 03-18-2011 03:58 AM

Thread Tools
Old 01-24-2013, 07:14 AM   #1
Giorgio C
Location: ITALY

Join Date: Oct 2010
Posts: 89
Default Extract multiple sequences on ncbi by gene symbol

Hi all,

I have a lot of gene symbols belonging to the same organism and I need to extract the corresponding sequences on ncbi.

The gene symbol are all like: NMB0001, NMB0010, NMB0015...

Is there any automated way (scripts, tools,..) in order to obtain the fasta sequences?

Thanks in advance,
Giorgio C is offline   Reply With Quote
Old 01-24-2013, 08:43 AM   #2
Richard Finney
Senior Member
Location: bethesda

Join Date: Feb 2009
Posts: 700

Download gene_info and gene2accession from NCBI.

run these :
"wget -nc"
"wget -nc"
Run gunzip to get these two files uncompressed and readable.

Get your genename(s) converted to entrez gene ids (second column), make sure taxonomy id is 122586 (. in your case).
Convert the gene names to GIs (gene info identifiers) or accessions.

Like this ...

bash-3.00# grep NMB0001 gene_info
122586 902103 NMB0001 NMB0001 - - - - acetyltransferase protein-coding - - - - 20120121

bash-3.00# grep "122586.902103" gene2accession
122586 902103 - - - AAF40480.1 7225226 AE002098.2 66731897 - - ? -
122586 902103 PROVISIONAL - - NP_273067.1 15675949 NC_003112.2 77358697 6 497 - -

Cut out the the accession(s) you want, either RNA or Protein. Put them into a flat text file as a list.
You'll want to program using bash/perl/c/command line utilities, whatever to automate the two basic commands above. Be careful.

There's supposedly "batch entrez" :

But I've found it to be unreliable. It drops some accessions. Sad but true. You're welcome to try it.

The absolute best utility for batch downloading is "idfetch" : . It's command line, takes parameters, you can give it a file of your accessions or GIs and crank it up. ....downloading ... downloading ... downloading ... wahlah ... your file appears ...just like you asked for. I keep an old copy from an old NCBI C toolkit around and ... apparently it's still available in ncbi-tools-bin package ...

I run this on Linux/Unix command line ...
sudo apt-get install ncbi-tools-bin
and idfetch is there !!! So you can install the ncbi-tools-bin package and get it.
sudo apt-get install ncbi-tools-bin

$ man idfetch | head
IDFETCH(1) NCBI Tools User's Manual IDFETCH(1)

idfetch - retrieve biological data from the NCBI ID1 server

idfetch [-] [-F str] [-G filename] [-Q filename] [-c N] [-d str] [-e N]
[-f str] [-g N] [-i N] [-l filename] [-n] [-o filename] [-q str] [-s str]

Last edited by Richard Finney; 01-24-2013 at 08:56 AM.
Richard Finney is offline   Reply With Quote
Old 01-24-2013, 09:49 AM   #3
Giorgio C
Location: ITALY

Join Date: Oct 2010
Posts: 89

Thank you so much for your time and suggestions. Actually I tried 'batch entrez' and as you reported, it's not so good; so you're right about that.

I really like your last option and I'm gonna try that.

Thanks again.

Giorgio C is offline   Reply With Quote
Old 01-24-2013, 06:49 PM   #4
Junior Member
Location: eastern part of this planet

Join Date: Jan 2013
Posts: 5

you might also wanna look into the BiomaRt package for R.
dexterslab is offline   Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -8. The time now is 05:57 AM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO