Get gene metadata

Retrieve gene metadata by NCBI Gene ID, gene symbol or RefSeq accession.

Get gene metadata

Retrieve gene metadata by NCBI Gene ID, gene symbol or RefSeq accession.

Retrieve gene metadata as a gene data report from NCBI Datasets through the easy-to-use website, command line tool or programming languages. For an overview of available metadata, see Datasets gene data report schemas .

Using NCBI Gene IDs

One way to access gene data reports is by their numeric id, or gene-id.

  1. Visit the gene data table .
  2. Click Get Started.
  3. Paste 1,2,3,9,10,11,12,13,14,15,16,17 into the Gene IDs box.
  4. Click Add.
  5. Click Select Columns to add or remove metadata from the table.
  6. Select the checkboxes for each gene you wish to download.
  7. Click Download Table to download the columns you have displayed in tabular format.
  8. Name your file and click Download.
datasets summary gene gene-id 1,2,3,9,10,11,12,13,14,15,16,17

For more information, see the Datasets Python API reference documentation

In this example, we are using the print_gene_metadata_by_fields method from ncbi-datasets-pylib.

from typing import List

from ncbi.datasets.openapi import ApiClient as DatasetsApiClient
from ncbi.datasets.openapi import ApiException as DatasetsApiException
from ncbi.datasets.openapi import GeneApi as DatasetsGeneApi

from ncbi.datasets.metadata.gene import print_gene_metadata_by_fields

# Provide your own gene ids as a list of integers
input_gene_ids: List[int] = [1, 2, 3, 9, 10, 11, 12, 13, 14, 15, 16, 17]


def gene_infor_for_geneids(gene_ids: List[int]):
    if len(gene_ids) == 0:
        print('Please provide at least one gene-id')
        return

    with DatasetsApiClient() as api_client:
        gene_api = DatasetsGeneApi(api_client)
        try:
            gene_reply = gene_api.gene_metadata_by_id(gene_ids)
            for gene in gene_reply.genes:
                print_gene_metadata_by_fields(gene, fields=['gene_id', 'symbol'])
        except DatasetsApiException as e:
            print(f'Exception when calling GeneApi: {e}\n')
For more information, see the [Datasets R API reference documentation](/datasets/docs/languages/r/).
api.gene_instance <- GeneApi$new()
result_gene <- api.gene_instance$GeneMetadataById(
    '1,2,3,9,10,11,12,13,14,15,16,17',
    returned.content='COMPLETE',
    sort.schema.field='SORT_FIELD_GENE_ID'
)
prettify(result_gene$toJSONString())
for (gene_match in result_gene$genes)  {
    cat(gene_match$gene$gene_id, " - ", gene_match$gene$symbol, "\n")
}

Using gene symbols

Similarly, gene data reports may be retrieved by their gene symbol.

  1. Visit the gene data table .
  2. Click Get Started.
  3. Select Gene Symbol in the Identifier type dropdown.
  4. Paste ACRV1,A2M into the Gene Symbols box, and leave Human in the Organism field.
  5. Click Add.
  6. Click Select Columns to add or remove metadata from the table.
  7. Select the checkboxes for each gene you wish to download.
  8. Click Download Table to download the columns you have displayed in tabular format.
  9. Name your file and click Download.
datasets summary gene symbol ACRV1 A2M --taxon human

Using transcript or protein accessions

Finally, gene data reports may be retrieved by a RefSeq transcript or protein accession.

  1. Visit the gene data table .
  2. Click Get Started.
  3. Select Accession in the Identifier type dropdown.
  4. Paste NM_020107.5,NP_001334352.2 into the Accessions box. No Organism is required.
  5. Click Add.
  6. Click Select Columns to add or remove metadata from the table.
  7. Select the checkboxes for each gene you wish to download.
  8. Click Download Table to download the columns you have displayed in tabular format.
  9. Name your file and click Download.
datasets summary gene accession NM_020107.5 NP_001334352.2
Generated April 27, 2021