This R package is part of our publication called “The Immunometabolic Atlas: a tool for design and interpretation of metabolomics studies in immunology”. It is able to construct immune system-related protein-metabolite interaction networks. The package features an RShiny application and a set of tools for constructing graphs and identifying biological processes associated with metabolites.
Use the devtools
package to install our package and dependencies.
install.packages("devtools")
devtools::install_github("vanhasseltlab/IMatlas")
To link the Python and R scripts, a configuration file is used, called
config.yaml
. This file needs to contain the following fields:
By default, the following settings are used.
folder: Data
relative_path: True
GO_ID: GO:0002376
Before using this package, you will need to obtain data using our Python scripts. These are located in the Python folder and only have to be executed once. The scripts will download and extract all data to the given folder in the configuration file. Preprocessing is done by running the following code:
library(IMatlas)
run_preprocessing("path/to/config.yaml")
Once the preprocessing is done, the Immunometabolic Atlas can be used.
load_data(config = "path/to/config.yaml")
run_shiny()
Example, static graph
library(IMatlas)
load_data(config = "path/to/config.yaml")
graph <- example_graph(omit_lipids = T)
plot(graph)
To get a similar interactive graph as in the Shiny app, you can convert the graph to a Plotly object.
to_plotly(graph)
To function get_graph()
is the main function for obtaining a
graph-structure representing your search. It takes the following
parameters, see the documentation for additional descriptions and
examples.
Immune process by name
, Metabolites by name
, Metabolite by HMDB identifier
, Biochemical pathway by name
, Immune process by name (without proteins)
, Metabolite superclass by name
, Metabolite class by name
.
search_mode
Interacts
Determines how interactions are found. Interacts
(default) will find all possible interactions, while Between
will only find interactions between the given metabolites / proteins. Shortest Path
will find the shortest route between the metabolites / proteins given, including indirect interactions.
verbose
TRUE
If TRUE
prints a small summary of the graph including the number of metabolites / proteins and interactions.
If the argument simple = FALSE
(default), metadata is included in the
returned igraph object. This includes the following:
Metabolite
, Protein
, Enzyme
or Transporter
.
color
Color of the node
enzyme
Enzyme code if the node is an enzyme.
cofactor
Metabolite ID that functions as a cofactor to the protein.
confidence
Confidence (0-1000) of the interaction. Only for protein-protein interactions this number is representive. All other interactions have a confidence score of 1000.
However, when simple = TRUE
, only the id
, name
, and confidence
are stored. Several helpers functions exist that can be chained to
obtain metadata. These have support for the dplyr
pipe notation. A
complete example that mimics the example_graph()
function is showed
below. However, optional helper functions exist, as mentioned in the
table below the example.
graph <- get_graph("positive regulation of T cell mediated immunity", simple = TRUE) %>%
add_closeness() %>%
add_gos() %>%
add_metadata() %>%
add_node_types() %>%
add_vertice_colors() %>%
add_layout()
Function
Description
add_closeness
Calculates the Harmonic Closeness per node to determine it’s importance in the graph
add_gos
Calculates p-values for each Gene Ontology present in the current graph
add_metadata
Adds vertice metadata about pathways, classes and superclasses
add_node_types
Adds the type of each node
add_vertice_colors
Adds colors to each type of node and edge.
add_layout
Calculates a Fruchterman-Reingold layout so each node is placed visually pleasing.
remove_unconnected
Removes any node that has no interaction with other nodes.
metabolite_go_graph
Convert the graph to a graph where Gene Ontologies are represented by nodes. Requires add_gos
to be run first.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.