API
The EXPANSION API — available at https://api.expansion.bioinfolab.sns.it — is our new API that allows for programmatic access to our data, along with other key benefits:
- You can construct a query that returns only the analysis that you need
- You only have to use POST requests with a simple variables object
- You can access the playground with built-in documentation and schema showing required
Available endpoints
The base URL endpoint is:
https://api.expansion.bioinfolab.sns.it
You can then access relevant data from the following endpoints:
- /de: Differentially expressed (DE) protein-coding transcripts from cancer genomics
- /da: Provides information about splicing variation (i.e. insertion, deletion or divergence) affecting domain architecture as well as PTMs
- /ppi: PPI Interaction networks (IntAct) mediated by the protein isoform
- /ora: Over-representation analysis (ORA) of isoform-specific interactors categories computed via the g:Profiler
- /all: Provides a JSON of all analysis available in our web server for given a gene
Sample scripts
Below is an example script written for Python:
#!/usr/bin/env python3
# Import relevant libraries to make HTTP requests and parse JSON response
import requests
import json
# Set variables object of arguments to be passed to endpoint
variables = {
"gene_symbol": "LRRK2",
"interaction_type": "all"
}
# Set base URL
base_url = "https://api.expansion.bioinfolab.sns.it"
# Set endpoint
endpoint = "/all/"
# Perform POST request and check status code of response
r = requests.post(base_url + endpoint, json=variables)
print(r.status_code)
# Transform API response from JSON into Python dictionary and print in console
api_response = json.loads(r.text)
print(api_response)
Below is an example script written for R:
# Load required library for making HTTP requests
library(httr)
library(jsonlite)
# Set variables object of arguments to be passed to endpoint
variables <- list("gene_symbol" = "LRRK2", "interaction_type" = "all")
# Set base URL
base_url <- "https://api.expansion.bioinfolab.sns.it"
# Set endpoint
endpoint <- "/all/"
# Perform POST request and store the response
r <- httr::POST(url = paste0(base_url, endpoint), body = toJSON(variables), encode = "json")
# Check status code of the response
print(httr::status_code(r))
# Transform API response from JSON into R list and print in console
api_response <- httr::content(r, "parsed")
print(api_response)