I have a list of gi corresponding to the nucleotide sequence in NCBI. I need to compile a file of cds sequences of those gi. I attempted to use batch entrez but it yielded whole genome sequences.
Can anyone suggest a method to retrieve cds sequences from NCBI given I have a list of corresponding gi
2 answers
I believe this could be done using UCSC table browser just select the type of identifiers, input the list of ids, and select CDS output.
I haven't tried UCSC's tablebrowser for this, but my favorite tool is Ensembl's Biomart: http://www.ensembl.org/biomart
It 's a very useful tool for this kind of things any many other kind of queries, for example: finding homolog genes across species, convert one type of IDs to another. It's worth to familiarize yourself with it.
When it comes to coordinates, be sure to choose the correct version of assembly. For example if you are working with GRCh37/hg19, it is a good idea to go to this site instead: http://grch37.ensembl.org/biomart/
Log in to answer this question.
You can try the e-utilities, for example e-fetch.
A greedy solution could be to get the genbank file corresponding to your gi with efetch with get, something like that in Perl:
Then parse the genbank with BioPerl:
If you only need the CDS it may be a little bit to much. But if you are going to need other information from the genbank file it could be useful.
There is probably a simpler and more elegant solution.