Thank you both @Sej and @genomax. I needed something to use in Excel.
Hello,
To download the RefSeq genbank file for a given gene, I usually navigate to NCBI Gene database (e.g. for GH1 gene: https://www.ncbi.nlm.nih.gov/gene/2688), and then from the gene webpage I click on the "GenBank" link on top-right of the graphical presentation (which leads me here: https://www.ncbi.nlm.nih.gov/nuccore/NC_000017.11?report=genbank&from=63917193&to=63918852&strand=true). To save the genbank file on my computer, I use the "Send to" dropdown list and I select the File and then "Create File". This will save the genebank file on my computer. I can see the URL for the downloaded file as: https://www.ncbi.nlm.nih.gov/sviewer/viewer.cgi?tool=portal&save=file&log$=seqview&db=nuccore&report=genbank&id=568815581&from=63917193&to=63918852&strand=on&conwithfeat=on&basic_feat=on&withparts=on
In my opinion, it will be easy to construct this link and automate the download for those gene with known genomic coordinates (from=63917193&to=63918852). Does anyone know what "id=568815581" in this link refers to? Is it specifying a piece of a chromosome? Where can I find the list of these IDs for human genome?
Thanks in advance for your help. Best. Amir
2 answers
While @Sej referred to NCBI's unix utils if you strictly want to create web links then you should use NCBI's E-utilities. There is a quick start book available here. You will want to replace gi with Accession numbers since NCBI has mostly deprecated gi for external use.
Log in to answer this question.
This is an internal ID, as far as I know (might be the old outphased GI number), see
https://www.ncbi.nlm.nih.gov/nuccore/568815581
Maybe a batch search can help you https://www.ncbi.nlm.nih.gov/sites/batchentrez
There are more ways to have this automated, but none of those are trivial. Do you require this only occasionally?
Thanks, Carambakaracho for the quick reply. I am writing an excel macro and at one point I need to download the GenBank file for a given gene, and then annotate a list of features. To this end, I can parse the GenBank files and annotate my features. I have downloaded the genomic coordinates for genes, I only need to find a way to construct the download link. I think you already helped a lot. Best, Amir
It is possible to download the genbank file of interest using NCBI Eutils.
It is not advisable to use Excel for parsing Genbank file, I'd suggest that you look at BioPython instead.
Here are the ids for human and mouse chromosomes:
Human
Mouse
And here is the link to the Excel file that for a given gene symbol download the genbank file. https://github.com/Ghahfarokhi/sgRNA_Annotator
My goal was to develop an Excel file that could download genbank file and annotate CRISPR sgRNAs.