This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Informations for gene summary are missing in eutils api of NCBI?

I searched for the id 85009 in ncbi gene website. I got results from gene summary with informations

Gene type : ncRNA

ncbi_gene

But, when I tried for the same in eutils the ouput did not contain this information. I want to perform this for multiple genes.

esummary -db gene -id 85009 -mode json > 85009.json

json output was:

{"header":{"type":"esummary","version":"0.3"},"result":{"uids":["85009"],"85009":{"uid":"85009","name":"MGC16025","description":"uncharacterized LOC85009","status":"","currentid":"","chromosome":"2","geneticsource":"genomic","maplocation":"2q37.3","otheraliases":"","otherdesignations":"","nomenclaturesymbol":"","nomenclaturename":"","nomenclaturestatus":"","mim":[],"genomicinfo":[{"chrloc":"2","chraccver":"NC_000002.12","chrstart":239195456,"chrstop":239193330,"exoncount":1}],"geneweight":846,"summary":"","chrsort":"02","chrstart":239193330,"organism":{"scientificname":"Homo sapiens","commonname":"human","taxid":9606},"locationhist":[{"annotationrelease":"110","assemblyaccver":"GCF_000001405.40","chraccver":"NC_000002.12","chrstart":239195456,"chrstop":239193330},{"annotationrelease":"110","assemblyaccver":"GCF_009914755.1","chraccver":"NC_060926.1","chrstart":239686613,"chrstop":239684487},{"annotationrelease":"109.20211119","assemblyaccver":"GCF_000001405.39","chraccver":"NC_000002.12","chrstart":239195456,"chrstop":239193330},{"annotationrelease":"109.20210514","assemblyaccver":"GCF_000001405.39","chraccver":"NC_000002.12","chrstart":239195456,"chrstop":239193330},{"annotationrelease":"109.20210226","assemblyaccver":"GCF_000001405.39","chraccver":"NC_000002.12","chrstart":239195456,"chrstop":239193330},{"annotationrelease":"109.20201120","assemblyaccver":"GCF_000001405.39","chraccver":"NC_000002.12","chrstart":239195456,"chrstop":239193330},{"annotationrelease":"109.20200815","assemblyaccver":"GCF_000001405.39","chraccver":"NC_000002.12","chrstart":239195456,"chrstop":239193330},{"annotationrelease":"109.20200522","assemblyaccver":"GCF_000001405.39","chraccver":"NC_000002.12","chrstart":239195456,"chrstop":239193330},{"annotationrelease":"109.20200228","assemblyaccver":"GCF_000001405.39","chraccver":"NC_000002.12","chrstart":239195456,"chrstop":239193330},{"annotationrelease":"109.20191205","assemblyaccver":"GCF_000001405.39","chraccver":"NC_000002.12","chrstart":239195456,"chrstop":239193330},{"annotationrelease":"109.20190905","assemblyaccver":"GCF_000001405.39","chraccver":"NC_000002.12","chrstart":239195456,"chrstop":239193330},{"annotationrelease":"109.20190607","assemblyaccver":"GCF_000001405.39","chraccver":"NC_000002.12","chrstart":239195456,"chrstop":239193330},{"annotationrelease":"109","assemblyaccver":"GCF_000001405.38","chraccver":"NC_000002.12","chrstart":239195456,"chrstop":239193330},{"annotationrelease":"105.20220307","assemblyaccver":"GCF_000001405.25","chraccver":"NC_000002.11","chrstart":240117152,"chrstop":240115026},{"annotationrelease":"105.20201022","assemblyaccver":"GCF_000001405.25","chraccver":"NC_000002.11","chrstart":240117152,"chrstop":240115026},{"annotationrelease":"105","assemblyaccver":"GCF_000001405.25","chraccver":"NC_000002.11","chrstart":240117152,"chrstop":240115026},{"annotationrelease":"105","assemblyaccver":"GCF_000002125.1","chraccver":"AC_000134.1","chrstart":231888602,"chrstop":231886476},{"annotationrelease":"105","assemblyaccver":"GCF_000306695.2","chraccver":"NC_018913.2","chrstart":240123072,"chrstop":240120946}]}}}

Which did not contain Gene Type information. I have tried this for many genes, but results were the same.

Any help appreciated.. Thanks

ncbi esummary eutils gene

Maybe this command:

efetch -db gene -id 85009 -mode json -format full_report

I've never used this tool before, but it seems to me that playing a bit with options should get you what you want.

It's giving me the informations using your commands but the output is generated in txt format. How can I get the json of the same

1 answer

Hi,
You can use NCBI Datasets to retrieve gene information in JSON format. Using the gene id you used as an example, you can do this (I'm using jq here to make it easier to read, but it's not necessary and you can redirect the output to a file instead):

datasets summary gene gene-id 85009 | jq .

Output:

{
  "reports": [
    {
      "gene": {
        "annotations": [
          {
            "annotation_name": "NCBI Annotation Release 110",
            "annotation_release_date": "2022-02-25",
            "assembly_accession": "GCF_000001405.40",
            "assembly_name": "GRCh38.p14",
            "genomic_locations": [
              {
                "genomic_accession_version": "NC_000002.12",
                "genomic_range": {
                  "begin": "239193331",
                  "end": "239195457",
                  "orientation": "minus"
                },
                "sequence_name": "2"
              }
            ]
          },
          {
            "annotation_name": "NCBI Annotation Release 110",
            "annotation_release_date": "2022-02-25",
            "assembly_accession": "GCF_009914755.1",
            "assembly_name": "T2T-CHM13v2.0",
            "genomic_locations": [
              {
                "genomic_accession_version": "NC_060926.1",
                "genomic_range": {
                  "begin": "239684488",
                  "end": "239686614",
                  "orientation": "minus"
                },
                "sequence_name": "2"
              }
            ]
          }
        ],
        "chromosomes": [
          "2"
        ],
        "common_name": "human",
        "description": "uncharacterized LOC85009",
        "gene_id": "85009",
        "orientation": "minus",
        "symbol": "MGC16025",
        "tax_id": "9606",
        "taxname": "Homo sapiens",
        "transcript_count": 1,
        "transcript_type_counts": [
          {
            "count": 1,
            "type": "NON_CODING"
          }
        ],
        "type": "ncRNA"
      },
      "query": [
        "85009"
      ]
    }
  ],
  "total_count": 1
}

I hope this helps. Please let me know if you have any other questions.

Log in to answer this question.