README.md

Introduction

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.

Installation

Use the devtools package to install our package and dependencies.

install.packages("devtools")
devtools::install_github("vanhasseltlab/IMatlas")

Getting Started

Setting up the configuration file

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

Preprocessing data

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")

Start the RShiny app

Once the preprocessing is done, the Immunometabolic Atlas can be used.

load_data(config = "path/to/config.yaml")
run_shiny()

Non-Shiny usages

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)

Advanced usages

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.

Argument Default Description filter NA The search term for building the graph, must be provided. neighbours 0 Integer value representing the number of neighbours (steps) to be found. max_neighbours Inf Maximum number of edges a node allowed. Can be used to remove super hubs e.g. Water or ATP. simple FALSE Returns a barebone igraph object with only identifiers and names. Useful when only the graph structure is needed. omit_lipids FALSE Removes any metabolite with the superclass ‘Lipids and lipid-like molecules’. type Immune process by name Type of the search filter. Can be one of the following: 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:

Name Description id Identifier of the protein or metabolite. name Full name of the protein or metabolite. closeness Harmonic closeness score of the node. Indicates its importance in the graph. go Gene Ontologies associated to the node. type Type of the node, can be either 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.

vanhasseltlab/IMatlas documentation built on Jan. 31, 2023, 12:27 a.m.