REST API & scripting

Reference patterns, clickable examples, a live try-it panel, Python snippets, and a JSON layer glossary — all in one place. Genome-wide bulk files are on the separate Downloads page.

Statistics data

JSON backing the Statistics charts: statistics/api/

PPI network graph

Graph payload for PPI network: browse/ppi/api/

Batch cohort analysis

JSON in/out, same engine as Batch Analysis: api/v1/batch/analyze/ — details in reference below.

REST API

Reference and live /rest/… requests on this site.

Identifiers. Default: Gencode protein accession (DisCanVis primary key), as in the summary URL. Other options use search_type (same pattern as the home page):

You providesearch_typeNotes
Gencode protein accession(default)From summary / protein page URL
HGNC gene symbolgene_namee.g. RAF1
UniProt accessionuniprote.g. Q96J92
Ensembl transcript (with version)transcriptFrom the protein record when applicable

menu_bookReference

Click a row to open the matching Try the API tab and pre-fill the form. Use open_in_new to open the URL in a new tab.

/rest/<identifier>.<format>

Formats: json, txt, fasta.

open_in_new
open_in_new
open_in_new

/rest/<identifier>/<annotation>
open_in_new
open_in_new

/rest/<id>/<start>-<end>.<format>
open_in_new
open_in_new

/rest/<id>/<position>.<format>
open_in_new
open_in_new
open_in_new

Batch analysis API

POST /api/v1/batch/analyze/ with Content-Type: application/json. No CSRF token required. Returns the same shape as the Batch Analysis form response: rois, header, errors, threshold (applied filters), and cohort_statistics when enabled.

Core fields: roi (string, newline-separated lines: IDENTIFIER or IDENTIFIER start end), search_type (gene_name | uniprot | gencode — Gencode protein accession as in the Summary URL), search_mode (region | full), discovery_method (annotation | prediction), find_region (e.g. Elm, PEM, PSSM with prediction + pssm_json), regex_input, motif_mode (regex | pssm), columns (array of output column keys; if omitted, a rich default set is used).

GO → protein list: use GET /ajax/go-genes/?id=GO:0005813 (no CSRF). Response includes accessions (main isoforms, same rule as Statistics → dynamic GO) and genes (distinct symbols). For batch, paste accessions with search_type: "gencode".

PPI → protein list: GET /ajax/ppi-proteins/?hub=SIAH1 (optional &ppi_sources=intact,hippie,biogrid). Same hub+neighbour logic as Statistics → PPI neighbourhood. Paste accessions with search_type: "gencode".

Regex / PSSM: with discovery_method: "prediction" and no coordinates, the entire sequence is scanned; each match is one row. Use search_mode: "full" or "region" — both run motif discovery the same way. Plain search_mode: "full" without regex/PSSM still returns one whole-protein row per line. Example STP-like regex (proline-directed): [ST].{0,2}P.

Filter / options (root or nested under batch_options): enforce_disorder_cutoff, disorder_min_percent (default 60), island_pathogenicity, island_metric (alphamissense | conservation), island_conservation_field (phastcons | global), island_conservation_delta, island_conservation_core_min, island_flank_mode (motif = flank width per side = motif length, termini-clamped; fixed = use island_flank aa each side), island_flank_aggregate (max | mean — how N- and C-flanks combine vs core), island_flank (used when mode is fixed), island_score_delta, island_am_mean, include_cohort_statistics, pssm_json, pssm_min_score.

dbNSFP-style columns in columns: patho_sift, patho_clinpred, patho_polyphen2_hvar, … (region mean over PathogenicityPredictors).

GET /api/v1/batch/analyze/ returns a short JSON description of the endpoint.

cURL — GO or PPI main-isoform helpers (no CSRF)

curl -s "http://v2.discanvis.elte.hu/ajax/go-genes/?id=GO:0005813"
curl -s "http://v2.discanvis.elte.hu/ajax/ppi-proteins/?hub=SIAH1"

cURL — annotation discovery (ELM)

curl -s -X POST "http://v2.discanvis.elte.hu/api/v1/batch/analyze/" \
  -H "Content-Type: application/json" \
  -d '{
    "roi": "TP53\nMYC",
    "search_type": "gene_name",
    "search_mode": "region",
    "discovery_method": "annotation",
    "find_region": "Elm",
    "columns": ["identifier", "gene", "region_name", "start", "end", "disorder_combined", "am", "tcgam", "elm", "pem"]
  }'

cURL — regex motif (full-protein scope; STP-like pattern)

Use go-genes accessions + search_type: gencode to scan the centrosome catalogue; below is a single-gene illustration.

curl -s -X POST "http://v2.discanvis.elte.hu/api/v1/batch/analyze/" \
  -H "Content-Type: application/json" \
  -d '{
    "roi": "TP53",
    "search_type": "gene_name",
    "search_mode": "full",
    "discovery_method": "prediction",
    "motif_mode": "regex",
    "regex_input": "[ST].{0,2}P",
    "columns": ["identifier", "region_name", "start", "end", "disorder_combined", "am"]
  }'

experimentTry the API

Choose a tab, set parameters, then Send request. JSON responses are pretty-printed when possible. Plain-text and HTML-wrapped TSV from some endpoints are shown as raw text.

GET /rest/<id>.<format> — optional ?search_type=…

GET /rest/<id>/<annotation>

GET /rest/<id>/<start>-<end>.<format>

GET /rest/<id>/<position>.<format>

POST /api/v1/batch/analyze/ — JSON body (same fields as the Batch analysis form). Try-it uses fetch POST below.

Tip: GET /ajax/go-genes/?id=GO:0005813 or GET /ajax/ppi-proteins/?hub=SIAH1 then paste accessions into roi with "search_type": "gencode".

Run a request to see the response here.

Python examples

Set BASE to this site or another deployment.

import requests

BASE = "https://discanvis.elte.hu"

r = requests.get(
    f"{BASE}/rest/RAF1.json",
    params={"search_type": "gene_name"},
)
data = r.json()
import requests

BASE = "https://discanvis.elte.hu"

r = requests.get(
    f"{BASE}/rest/Q96J92.json",
    params={"search_type": "uniprot"},
)
data = r.json()
import requests

BASE = "https://discanvis.elte.hu"

r = requests.get(
    f"{BASE}/rest/RAF1/200.txt",
    params={"search_type": "gene_name"},
)
txt = r.text
# Section boundaries: lines starting with '#'
import json
import requests

BASE = "https://discanvis.elte.hu"

r = requests.get(
    f"{BASE}/rest/RAF1/200.json",
    params={"search_type": "gene_name"},
)
print(json.loads(r.text).get("protein"))
import json
import requests

BASE = "https://discanvis.elte.hu"
url = BASE.rstrip("/") + "/api/v1/batch/analyze/"
body = {
    "roi": "TP53\nMYC",
    "search_type": "gene_name",
    "search_mode": "full",
    "discovery_method": "prediction",
    "motif_mode": "regex",
    "regex_input": ".P.A.V.P[^P]",
    "enforce_disorder_cutoff": True,
    "disorder_min_percent": 60,
    "columns": [
        "identifier", "gene", "region_name", "start", "end",
        "disorder_combined", "am", "tcgam", "elm",
    ],
}
r = requests.post(url, json=body, headers={"Content-Type": "application/json"}, timeout=120)
r.raise_for_status()
data = r.json()
print(json.dumps(data, indent=2)[:4000])

BASE is the public site (DISCANVIS_PUBLIC_ORIGIN, default https://discanvis.elte.hu). For local Django, override BASE or set env DISCANVIS_PUBLIC_ORIGIN.

Annotation keys in JSON

Common model / layer names in REST payloads

Field availability depends on species, data load, and model; missing layers simply omit arrays in JSON.

  • sequence, exon — sequence and exon map
  • phastcons, conservation — genomic / alignment conservation
  • complexity-seg, complexity-dust, complexity-trf — low-complexity
  • polymorphism — common / all SNPs (UCSC / dbSNP class)
  • omim, clinvar — disease variants
  • pdb, pfam — structure and domain families
  • anchor, iupred, mobidb, alphafold — disorder & confidence
  • tcgam, tcgaf, tcgai — TCGA missense / truncating / indel
  • cosmicm, cosmicf, cosmici — COSMIC counterparts
  • roisig — significantly mutated regions (iSiMPRe)
  • elm, elmswitches, ptm — motifs, switches, PTMs
  • roi, binding, dibs, mfib, binding_domain, phasepro — regions & phase separation
  • PathogenicityPredictors, AlphaMissense — variant effect scores