Genesht

Introduction

This document describes the REST APIs provided by Geneshot. These APIs are for developers who want to programmatically retrieve genes associated with search terms of interest.

In this documentation, we will use Python to demo the API requests. The code can be used as is or as a template for your own modifications in Python or another language. We use the requests library, which can be installed with pip.


API section


Get PubMed IDs for genes from AutoRIF annotations

Method GET
URL /geneshot/api/geneauto
Returns
PubMed_date PubMed id, publication date
searchterm cached search term from previous query
filtered_pmid PubMed id, publication date that match searchterm
Parameters
gene gene symbol
Example code
import json
import requests

GENESHOT_URL = 'http://amp.pharm.mssm.edu/geneshot/api'
query_string = '/geneauto/%s'
gene_symbol = 'FLII'
response = requests.get(
    GENESHOT_URL + query_string % (gene_symbol)
)
if not response.ok:
    raise Exception('Error during query')

data = json.loads(response.text)
print(data)
Example results

{
  "PubMed_date": {
    11971982: "2002-04-25",
    11971982: "2002-04-25",
    11971982: "2002-04-25",
    ...
  },
  "search_term": "wound healing",
  "filtered_pmid": {
    11971982: "2002-04-25",
    11971982: "2002-04-25",
    11971982: "2002-04-25",
    ...
  }
}

Get PubMed IDs for genes from GeneRIF annotations

Method GET
URL /geneshot/api/gene
Returns
PubMed_date PubMed id, publication date
searchterm cached search term from previous query
filtered_pmid PubMed id, publication date that match searchterm
Parameters
gene gene symbol
Example code
import json
import requests

GENESHOT_URL = 'http://amp.pharm.mssm.edu/geneshot/api'
query_string = '/gene/%s'
gene_symbol = 'FLII'
response = requests.get(
    GENESHOT_URL + query_string % (gene_symbol)
 )
if not response.ok:
    raise Exception('Error during query')

data = json.loads(response.text)
print(data)
Example results

{
  "PubMed_date": {
    11971982: "2002-04-25",
    11971982: "2002-04-25",
    11971982: "2002-04-25",
    ...
  },
  "search_term": "wound healing",
  "filtered_pmid": {
    11971982: "2002-04-25",
    11971982: "2002-04-25",
    11971982: "2002-04-25",
    ...
  }
}

Get genes associated with search terms and GeneRIF annotations

Method GET
URL /geneshot/api/search
Returns
PubMedID_count number of publications matching term
gene_count gene symbols with total number of matching PubMed ids and fraction of matching
PubMed ids relative to all PubMed ids the gene matches in GeneRIF.
search_term search term submitted in query
Parameters
search search term
Example code
import json
import requests

GENESHOT_URL = 'http://amp.pharm.mssm.edu/geneshot/api'
query_string = '/search/%s'
search_term = 'wound healing'
response = requests.get(
    GENESHOT_URL + query_string % (search_term)
 )
if not response.ok:
    raise Exception('Error during query')

data = json.loads(response.text)
print(data)
Example results

{
  "PubMedID_count": 651925,
  "search_term": "wound healing",
  "gene_count": {
  "HBA1" : [
    0: 29608,
    1: 0.9200459898697989
  ],
  "TNF" : [
    0: 6260,
    1: 0.04013540891954966
  ],
  ...
}

Get genes associated with search terms and AutoRIF annotations

Method GET
URL /geneshot/api/search/auto/
Returns
PubMedID_count number of publications matching term
gene_count gene symbols with total number of matching PubMed ids and fraction of
matching PubMed ids in AutoRIF.
search_term search term submitted in query
Parameters
search search term
Example code
import json
import requests

GENESHOT_URL = 'http://amp.pharm.mssm.edu/geneshot/api'
query_string = '/search/auto/%s'
search_term = 'wound healing'
response = requests.get(
    GENESHOT_URL + query_string % (search_term)
 )
if not response.ok:
    raise Exception('Error during query')

data = json.loads(response.text)
print(data)
Example results

{
  "PubMedID_count": 651925,
  "search_term": "wound healing",
  "gene_count": {
  "HBA1" : [
    0: 29608,
    1: 0.9200459898697989
  ],
  "TNF" : [
    0: 6260,
    1: 0.04013540891954966
  ],
  ...
  }
}

Get publications counts for semiannual intervals for gene matching previous search term query according to GeneRIF.

Method GET
URL /geneshot/api/gene/histogram
Returns
PubMed_date date interval and publication count
filtered_pmid date interval and publication count
search_term search term submitted in query
Parameters
gene symbol gene symbol
Example code
import json
import requests

GENESHOT_URL = 'http://amp.pharm.mssm.edu/geneshot/api'
query_string = '/gene/histogram/%s'
gene_symbol = 'FGF21'
response = requests.get(
    GENESHOT_URL + query_string % (gene_symbol)
 )
if not response.ok:
    raise Exception('Error during query')

data = json.loads(response.text)
print(data)
Example results

{
  "search_term": "diabetes",
  "PubMed_date": {
    2006-06: "0",
    2006-12: "1",
    2007-06: "1",
    ...
  },
  "filtered_pmid": {
    2006-06: "0",
    2006-12: "1",
    2007-06: "0",
    ...
  }
}

Get publications counts for semiannual intervals for gene matching previous search term query according to AutoRIF.

Method GET
URL /geneshot/api/geneauto/histogram
Returns
PubMed_date date interval and publication count
filtered_pmid date interval and publication count
search_term search term submitted in query
Parameters
gene symbol gene symbol
Example code
import json
import requests

GENESHOT_URL = 'http://amp.pharm.mssm.edu/geneshot/api'
query_string = '/geneauto/histogram/%s'
gene_symbol = 'FGF21'
response = requests.get(
    GENESHOT_URL + query_string % (gene_symbol)
 )
if not response.ok:
    raise Exception('Error during query')

data = json.loads(response.text)
print(data)
Example results

{
  "search_term": "diabetes",
  "PubMed_date": {
    2006-06: "0",
    2006-12: "1",
    2007-06: "1",
    ...
  },
  "filtered_pmid": {
    2006-06: "0",
    2006-12: "1",
    2007-06: "0",
    ...
  }
}

Predict associated genes using gene-gene similarity. The possible similarity matrices are generif, tagger, autorif, coexpression and enrichr.

Method GET
URL /associate/
Returns
associations genes with similarity to input gene list
kinase list of kinases associated to input list
darkkinase list of dark kinases associated to input list
ionchannel list of ionchannel associated to input list
darkionchannel list of dark ionchannel associated to input list
gcpr list of GCPR associated to input list
darkgcpr list of dark gcpr associated to input list
Parameters
similarity gene-gene similarity matrix (generif, tagger, autorif, coexpression, enrichr)
gene symbols comma separated gene symbols
Example code
import json
import requests

GENESHOT_URL = 'http://amp.pharm.mssm.edu/geneshot/api'
query_string = '/associate/%s/%s'
similarity_matrix = 'coexpression'
gene_symbols = ','.join([
  'PHF14', 'RBM3', 'MSL1', 'PHF21A', 'ARL10', 'INSR', 'JADE2'
])

response = requests.get(
    GENESHOT_URL + query_string % (similarity_matrix, gene_symbols)
 )
if not response.ok:
    raise Exception('Error during query')

data = json.loads(response.text)
print(data)
Example results

{
  "association": {
    "POLQ" : {
      "simScore" : 0.17795525,
      "topGenes" : {
        0 : "BRCA1",
        1 : "BRCA2",
        2 : "CD24",
        ...
      },
      "topScores" : {
        0 : 0.67036307,
        1 : 0.52137923,
        2 : 0.06447138,
        ...
      }
    },
    "ECT2" : {
      "simScore" :  0.17316519,
      "topGenes" : {
        0 : "BRCA1",
        1 : "BRCA2",
        2 : "CD24",
        ...
      },
      "topScores" : {
        0 : 0.59020823,
        1 : 0.4303045,
        2 : 0.20695324,
        ...
      }
    },
    ...
  },
  "kinase" : [
    0 : "CHEK1",
    1 : "PRKDC",
    ...
  ],
  "darkkinase" : [
    ...
  ],
  "ionchannel" : [
    ...
  ],
  "darkionchannel" : [
    ...
  ],
  "gcpr" : [
    ...
  ],
  "darkgcpr" : [
    ...
  ]
}

Predict associated genes using gene-gene similarity. The possible similarity matrices are generif, tagger, autorif, coexpression and enrichr.

Method GET
URL /associate/
Returns
tpcount total true positives for gene in library
auc Area under the curve of ROC
total library size
tprank rank of all true positives
tpkey list of dark ionchannel associated to input list
results library term predictions ranked by significance
Parameters
gene symbol gene symbol
similarity gene-gene similarity matrix (generif, tagger, autorif, coexpression, enrichr)
library
Example code
import json
import requests

GENESHOT_URL = 'http://amp.pharm.mssm.edu/geneshot/api'
query_string = '/predict/gene/%s/library/%s/similarity/%s/offset/%s/limit/%s'

gene_symbol = 'KRAS'
library = 'KEGG_2016'
similarity_matrix = 'coexpression'
offset = '0'
limit = '10'

response = requests.get(
    GENESHOT_URL + query_string % (gene_symbol, library, similarity_matrix, offset, limit)
)

if not response.ok:
    raise Exception('Error during query')

data = json.loads(response.text)
print(data)
Example results

{
  "tpcount": 60,
  "auc" : 0.7204209328782708,
  "total" : 293,
  "tprank" : [
    0 : 3,
    1 : 6,
    2 : 8,
    3 : 12,
    ...
  ],
  "tpkey" : {
    0 : "Dorso-ventral axis formation_Homo sapiens_hsa04320",
    1 : "Thyroid cancer_Homo sapiens_hsa05216",
    2 : "Long-term depression_Homo sapiens_hsa04730",
    ...
  },
  "results" : {
    0 : {
      "property" : "Nicotine addiction_Homo sapiens_hsa05033",
      "score" : 4.0014677,
      "tp" : 0
    },
    1 : {
      "property" : "Butirosin and neomycin biosynthesis_Homo sapiens_hsa00524",
      "score" : 2.922457,
      "tp" : 0
    },
    3 : {
      "property" : "Dorso-ventral axis formation_Homo sapiens_hsa04320",
      "score" : 2.539165,
      "tp" : 1
    },
    ...
  }
}