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 associated with gene

Method POST
URL https://maayanlab.cloud/geneshot/api/genepublications
Returns
PubMed_date PubMed id, publication date
filtered_pmid PubMed id, publication date that match searchterm
searchterm cached search term from previous query
count_filtered_pmid number of publications matching search term and gene
count_pmid PubMed id, publication date that match searchterm
Parameters
gene gene symbol
rif generif or autorif
term search term
Example code
import json
import requests

GENESHOT_URL = 'https://maayanlab.cloud/geneshot/api/genepublications'
payload = {"gene": "FOXM1", "rif": "autorif", "term": "cell cycle"}

response = requests.post(GENESHOT_URL, json=payload)

data = json.loads(response.text)
print(data)
Example results
{
  "PubMed_date": {
    "11971982": "2002-04-25",
    "11971982": "2002-04-25",
    "11971982": "2002-04-25",
    ...
  },
  "filtered_pmid": {
    "11971982": "2002-04-25",
    "11971982": "2002-04-25",
    "11971982": "2002-04-25",
    ...
  }
  "search_term": "wound healing",
  "count_pmid": 7231,
  "count_filtered_pmid": 123
}

Get genes associated with search terms

Method POST
URL https://maayanlab.cloud/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
return_size number of genes matchong search
query_time query time in seconds
Parameters
term search term
Example code
import json
import requests

GENESHOT_URL = 'https://maayanlab.cloud/geneshot/api/search'
payload = {"rif": "generif", "term": "hair loss"}

response = requests.post(GENESHOT_URL, json=payload)

data = json.loads(response.text)
print(data)
Example results
{
  "PubMedID_count": 34412,
  "gene_count": {
      "ABCC6P2": [
          1,
          0.25
      ],
      "ABI3": [
          2,
          0.125
      ],
      ...
    },
    "query_time": 1.121943712234497,
    "return_size": 298,
    "search_term": "hair loss"
}

Get publications counts for semiannual intervals for gene matching search term.

Method POST
URL https://maayanlab.cloud/geneshot/api/histogram
Returns
PubMed_date date interval and publication count
filtered_pmid date interval and publication count
search_term search term submitted in query
gene gene of query
Parameters
gene gene symbol
rif autorif or generif
term search term
Example code
import json
import requests

GENESHOT_URL = 'https://maayanlab.cloud/geneshot/api/histogram'
payload = {"rif": "autorif", "gene": "MYO7A", "term": "hair loss"}

response = requests.post(GENESHOT_URL, json=payload)

data = json.loads(response.text)
print(data)
Example results
{
  "filtered_pmid": {
    "1992-12": 0,
    "1994-6": 0,
    "1995-12": 1,
    ...
  },
  "gene": "MYO7A",
  "pubmed_date": {
    "1992-12": 1,
    "1994-6": 2,
    "1995-12": 2,
    ...
  },
  "search_term": "hair loss"
}

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

Method POST
URL https://maayanlab.cloud/geneshot/api/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
query_time query time for query in seconds
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 = 'https://maayanlab.cloud/geneshot/api/associate'
payload = {
  "gene_list": ["CRP","IL6","TNF","IL1B","TAC1","ALB","CALCA","TRPV1","INS","NGF","PTGS2","FOS","POMC","IL10","CD4","BDNF","ATP4A","ATP12A","ACE","CXCL8","GPT","OPRM1","TRPA1","GAPDH","F2","PTH","CCL2","CD34","CNR1","AKT1","F3","KLK3","OXT","SST","IL2","TLR4","CD8A","AFP","SCN9A","IL4","SCN10A","CEACAM5","NTRK1","KIT","AIF1","JUN"],
  "similarity": "coexpression" 
}
response = requests.post(GENESHOT_URL, json=payload)

data = json.loads(response.text)
print(data)
Example results
{
"association": {
    "A1CF": {
        "publications": 126,
        "simScore": 0.05238375919205802,
        "topGenes": {
            "0": "ALB",
            "1": "F2",
            ...
        },
        "topScores": {
            "0": 0.8976537585258484,
            "1": 0.8907041549682617, 
            ...
        }
    },
    ... 
},
"darkgpcr": [],
"darkionchannel": [
    "SLC26A1"
],
"darkkinase": [],
"gpcr": [],
"ionchannel": [
    "SLC26A1",
    "SCN10A",
    "SCN11A",
    "KCNK18"
],
"kinase": [
    "DGKH",
    "KHK"
],
"query_time": 2.161868095397949
}

Predict gene function

Method POST
URL https://maayanlab.cloud/geneshot/api/predict
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 gene symbol
similarity gene-gene similarity matrix (generif, tagger, coexpression, enrichr)
library Gene-set library
offset
limit
Example code
import json
import requests

GENESHOT_URL = 'https://maayanlab.cloud/geneshot/api/predict'

payload = {
  "gene": "FOXM1",
  "library": "WikiPathways_2016",
  "similarity": "coexpression",
  "offset": 0,
  "limit": 200
}

response = requests.post(GENESHOT_URL, json=payload)

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
    },
    ...
  }
}