This tutorial will teach you how to use the DISGENET Cytoscape App to retrieve data from DISGENET [1] using the R programming language. To run this tutorial, you need to register for a free trial account at DISGENET, and retrieve you API
Once you have completed the registration process, go to your user profile…
… and retrieve your API key
Copy your API key, and go to the Cytoscape Apps menu, click on DISGENET -> Set API key, and paste it. You would need to do this process just the first time.
About DISGENET
DISGENET is a discovery platform containing one of the largest publicly available collections of genes and variants associated with human diseases [1]. DISGENET integrates data from expert curated repositories, Clinical trials, GWAS catalogs, animal models and the biomedical literature. The data in the platform are homogeneously annotated with controlled vocabularies and community-driven ontologies. Additionally, several original metrics are provided to assist the prioritization of genotype–phenotype relationships. More information on the database contents, statistics and attributes is available at https://www.disgenet.com.
Requirements
To run the tutorial you will need to install RCy3:
if(!"RCy3" %in% installed.packages()){
if (!requireNamespace("BiocManager", quietly=TRUE))
install.packages("BiocManager")
BiocManager::install("RCy3")
}
library(RCy3)
You will also need to install and launch Cytoscape:
Finally, install the DISGENET App to access DISGENET from within Cytoscape. This can be done from the Cytoscape App Store.
Then, install and load the library httr
if (!requireNamespace("httr", quietly = TRUE)) {
install.packages("httr")
}
library(httr)
This tutorial will guide you on how to use the DISGENET Cytoscape App to:
We will create an object for the REST calls to the DISGENET automation module. The parameters are:
The function returns a string in url format (url), with the given parameters.
disgenetRestUrl<-function(netType,host="127.0.0.1",port=1234,version="v8"){
if(is.null(netType)){
print("Network type not specified.")
}else{
url<-sprintf("http://%s:%i/disgenet/%s/%s",host,port,version,netType)
}
return (url)
}
# Creating the url for GDAs
disgenetRestUrl(netType = "gene-disease-net")
## [1] "http://127.0.0.1:1234/disgenet/v8/gene-disease-net"
Next, we will create an object that will execute the REST calls to the DISGENET automation module in Cytoscape and retrieve the operation results. The parameters are:
The function returns the object result, a list with the results of the operation.
disgenetRestCall<-function(netType,netParams){
url<-disgenetRestUrl(netType)
restCall<-POST(url, body = netParams, encode = "json")
result<-content(restCall,"parsed")
return(result)
}
In this example, we will create a gene-disease network for Asthma
(Concept C0004096
) using the CURATED data in DISGENET.
Below, an example of the object netParams to create the GDA
network. Notice that we are also filtering by the
DISGENET score
(0.8-1).
geneDisParams <- list(
source = "CURATED",
diseaseSearch = "C0004096",
geneSearch = " ",
geneProteinClass = "Any",
diseaseClass = "Any",
initialScoreValue = "0.8",
finalScoreValue = "1.0"
)
# Generate the gene-disease network
geneDisResult <- disgenetRestCall("gene-disease-net",geneDisParams)
The network has now been created in Cytoscape!
To change the layout, run the function layoutNetwork. This function receives as an input the network identifier, and a layout name. To investigate the names of the possible layouts, run the function getLayoutNames().
layoutNetwork("force-directed", network = as.numeric(geneDisResult$result$networkSUID))
You can also change the network title, for example:
title <- "my-asthma-GDA-network"
renameNetwork(title, network = as.numeric(geneDisResult$result$networkSUID))
Create a GDA network associated to a disease using a keyword as input
In this example, we will create a gene-disease network for the diseases containing the keyword Asthma using DISGENET CURATED data. Notice that 3 different concepts related to Asthma subtypes are retrieved.
geneDisParams <- list(
source = "CURATED",
diseaseSearch = "*Asthma*",
geneSearch = " ",
geneProteinClass = "Any",
diseaseClass = "Any",
initialScoreValue = "0.5",
finalScoreValue = "1.0"
)
geneDisResult <- disgenetRestCall("gene-disease-net",geneDisParams)
layoutNetwork("force-directed", network = geneDisResult$networkResult$networkName)
In this example, we will perform a query to DISGENET data (only the
Clinvar
subset) with a list of gehes. The list of genes is
separated using ,, but ; are also accepted as
separators.
list <- c( "PSEN1", "PSEN2", "TARDBP", "PRNP")
geneDisParams <- list(
source = "CLINVAR",
geneSearch = paste(list, collapse = ";"),
diseaseSearch= "",
geneProteinClass = "Any",
diseaseClass = "Any",
initialScoreValue = "0",
finalScoreValue = "1.0"
)
geneDisResult <- disgenetRestCall("gene-disease-net",geneDisParams)
In this example, we will create a VDA network associated to:
variantDisParams <- list(
source= "CURATED",
diseaseSearch= "Allergic asthma;Adult onset asthma;IgE-mediated allergic asthma",
initialScoreValue= "0.7",
finalScoreValue = "1.0",
showGenes= "false"
)
variantDisResult <- disgenetRestCall("variant-disease-net",variantDisParams)
layoutNetwork("kamada-kawai" , network = variantDisResult$networkResult$networkName)
For the following examples, we will use the data from the publication Eighty-eight variants highlight the role of T cell regulation and airway remodeling in asthma pathogenesis. The publication reports a genome-wide association meta-analysis of 69,189 cases and 702,199 controls from Iceland and UK biobank. They find 88 asthma risk variants at 56 loci.
We have made the data available with this tutorial. To read the list of variants, run
variants <-read.csv("https://raw.githubusercontent.com/jpinero/disgenet-app-notebook/main/data/variants.tsv")
variants <- variants$x
There are 88 variants in total
Create a VDA network associated to a list of variants
We will create the network of all the variants from the GWAS study in DisGeNET.
variantDisParams <- list(
source= "ALL",
variantSearch= paste(variants, collapse = ","),
initialScoreValue= "0.0",
finalScoreValue = "1.0",
showGenes= "false"
)
variantDisResult <- disgenetRestCall("variant-disease-net",variantDisParams)
layoutNetwork('force-directed defaultSpringCoefficient=0.0001 defaultSpringLength=10')
# We will store the network identifiers to perform the enrichment later
suid <- as.numeric(variantDisResult$result$networkSUID)
We can retrieve the information associated to the nodes like this:
nodes <-getTableColumns('node')
There are 88 variants from the dataset that are reported in DisGeNET, associated to 188 different diseases.
library(dplyr)
library(DT)
dt <- nodes %>% filter(nodeType=="disease") %>% arrange(desc(nrAssociatedVariants)) %>%
select(diseaseId,diseaseName, nrAssociatedVariants) %>% head(20)
datatable(dt, caption = "Table 1: Top diseases associated to the list of variants" , rownames = FALSE, class = 'cell-border stripe', filter = 'top',
options = list( pageLength = length(dt$diseaseName), autoWidth = TRUE, columnDefs = list(list(width = '100px', targets = c(0, 1,2))) ))
We can also check which of the variants from the GWAS study are already described as related to asthma.
variantDisParams <- list(
source= "ALL",
diseaseSearch= "*asthma*",
variantSearch= paste(variants, collapse = ", "),
initialScoreValue= "0.0",
finalScoreValue = "1.0",
showGenes= "false"
)
variantDisResult <- disgenetRestCall("variant-disease-net",variantDisParams)
layoutNetwork('force-directed defaultSpringCoefficient=0.0001 defaultSpringLength=10')
We can retrieve the information associated to the network edges like this:
edges <-getTableColumns('edge')
Let’s explore the evidence (represented as the edges in the network). We will show only the first 10 rows.
dt <- edges %>% select(score, `evidence index`, `initial year`, `final year`) %>% arrange(desc(score)) %>% unique() %>% head(10)
dt$score <- round(dt$score, digits = 2)
datatable(dt, caption = "Table 2: Details supporting the associations with Asthma" , rownames = FALSE, class = 'cell-border stripe', filter = 'top',
options = list( pageLength = 20, autoWidth = T,
columnDefs = list(list(width = '100px', targets = c(0, 2)))))
Next we will create a VDA network for a list of variants filtering by disease class. We will retrieve the network of diseases belonging to the class Respiratory Tract Diseases associated to the variants from the GWAS study. This time, we will specify the parameter showGenes as true. Notice that the genes annotated to the variants are now shown.
variantDisParams <- list(
source= "ALL",
diseaseClass= "Respiratory Tract Diseases",
variantSearch= paste(variants, collapse = ", "),
initialScoreValue= "0.0",
finalScoreValue = "1.0",
showGenes= "true"
)
variantDisResult <- disgenetRestCall("variant-disease-net",variantDisParams)
layoutNetwork('force-directed defaultSpringCoefficient=0.0001 defaultSpringLength=10')
Piñero, Janet and Ramírez-Anguita, Juan Manuel and Saüch-Pitarch, Josep and Ronzano, Francesco and Centeno, Emilio, Sanz, Ferran and Furlong, Laura I, {The DisGeNET knowledge platform for disease genomics: 2019 update , Nucleic Acids Research, 48, Issue D1, D845–D85508 (2020)
Olafsdottir, T.A., Theodors, F., Bjarnadottir, K. et al.Eighty-eight variants highlight the role of T cell regulation and airway remodeling in asthma pathogenesis. Nat Commun 11, 393 (2020).