Hi,
You can use NCBI Datasets for that query.
If you install datasets
using conda, both datasets
and dataformat
will be installed. If you prefer to download the binaries yourself, just be sure to download both.
For example: TP53
datasets summary gene symbol tp53 --as-json-lines | \
dataformat tsv gene --fields symbol,gene-id,ensembl-geneids,name-id,omim-ids,swissprot-accessions,synonyms,replaced-gene-id
The datasets
command will retrieve metadata information for the requested symbol. The default taxon here is human. If you want information for another species (dog, for example), you should add the flag --taxon dog
to the first command. You also have options to retrieve metadata by accession or gene-id.
The dataformat
command will print the output as tsv (options are tsv or excel). Since this is a gene summary, you need to add gene
and here I selected the fields that I think were relevant for your query. For more information about the available fields and other dataformat
options, please check out the documentation in this link.
This command will print the following output (that can be redirected to a file). To make it easier to read on the terminal, I added the column
command, but that's not necessary obviously.
datasets summary gene symbol tp53 --as-json-lines | \
dataformat tsv gene \
--fields symbol,gene-id,ensembl-geneids,name-id,omim-ids,swissprot-accessions,synonyms,replaced-gene-id | \
column -t -s$'\t'
Symbol NCBI GeneID Ensembl GeneIDs Nomenclature ID OMIM IDs SwissProt Accessions Synonyms Replaced NCBI GeneID
TP53 7157 ENSG00000141510 HGNC:11998 191170 P04637 P53,BCC7,LFS1,BMFS5,TRP53
Please feel free to reach out if you have any additional questions. I hope this helps!
Do not delete posts that have received feedback - this one even has an answer that works really well. To acknowledge a post as resolved, accept the answer(s) that work for you (I've done it for you this time). Deleting a post is not something you should do unless it was a mistake to ask the question in the first place (inappropriate content or confidential information etc.)