Michal Stolarczyk mjs5kd@virginia.edu
The ToyCon visualization app is an R shiny app that aids the basic understanding of concepts conveyed in the following publication: iNRG: A toy network capturing central energy metabolism for use with constraint-based methods.
- Network layout visualization, which is intended to graphically present the interconnections between metabolites and reactions in the genome-scale metabolic reconstruction. Nodes of the graph represent metabolites and reactions whereas egdes - connections between them.
- Network stoichiometry visualization, which is intended to depict the stoichiometric coefficients in view of the aforesaid network representation of the genome-scale metabolic reconstruction. The width of the edges correspond to the stoichiometic coefficients that determine ratios of each metabolite in the reactions.
- Reaction knockouts (KOs) impact visualization, which is intended to present the influence of the specific reaction KOs on genome-scale metabolic reconstruction architecture and fluxes in the model. By means of the Flux Balance Analysis (FBA) this functionality can be used to detect either essential (when removed render the model carry 0 flux through the objective function) or nonessential (when removed do not influence the effective flux value through the objective function) reactions. Additionaly, knockouts can simulate the complete enzyme inhibition that catalyzes the reaction being knocked out.
- Media changes impact visualization, which is intended to deptict the incluence of growth media changes on the model growth and fluxes through reactions. The media changes are performed by constraining the exchange reactions in the model during the FBA simulation. For example in order to check the influence of oxygen shortage on the model growth one needs to lower the upper (and lower) flux bound(s) of the oxygen exchange reaction.
- Gene expression influenece visualization, which is intended to depict the impact of the pseudo-gene expression changes in the model, which directly influences the flux that is carried by the reaction catalyzed by the enzyme encoded by the gene in question. It is indended to give the user an idea of how the algorithms for gene expression integration influence the fluxes in in the model.
The most reliable, safest and easiest installation approach is to use the Docker platform due to its intrisic characterisitics. In order to do it user needs to build the image from Dockerfile or run the pre-built Docker image (both provided with this application in docker/Dockerfile
and in the official Docker repository, respectively).
To follow either of these approaches install the Docker CE (community edition) software on your machine. The installation instructions can be found on the Docker website.
After installation the docker image can pulled from the repository with a following command:
docker pull [OPTIONS]
e.g
sudo docker pull mstolarczyk/toyconapp
Check the image status:
sudo docker images
or the docker image can be build with a following command:
docker build [OPTIONS] PATH | URL | -
Please note that image building may take 10-15 minutes
e.g
cd "path/to/the/Dockerfile/directory"
sudo docker build -t toyconapp .
Mind the dot at the end of the line!
Check the image status:
sudo docker images
Next, the container can be run using the built or loaded image with a following command:
docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
e.g
sudo docker run -p 8080:8080 mstolarczyk/toyconapp
The set of two numbers separated by the colon after the -p
flag specifies the port mapping. The application is programmed to listen on port 8080 (second number of the two) inside of the container. The port is then exposed outside of the container and it is redirected to the same port in your OS/network with the command above.
Subsequently, to run the application go to your favourite web browser and paste:
localhost:8080
The application is written in R programming language and uses COBRApy for under the hood Flux Balance Analysis (FBA) simulations, reaction knockouts and constraining fluxes through exchange reactions. Consequently an installation of libSBML, R and Python with functioning cobra package is required.
Install system libSBML programming library. Necessary files and instructions for installation under UNIX are available here
Install libSBML Python language interface
Install Python programming language (version of your choice, tested on 2.7.12) with following packages:
To install the packages using pip package management system type in the terminal:
sudo pip install <package name>
e.g.:
sudo pip install sys
Install R programming language (version of your choice, tested on 3.4.3) with following packages:
-
rPython: Package Allowing R to Call Python
Prior to the rPython package installation please read these instructions to choose the appropriate Python version (with cobra package installed) in systems where several Python versions coexist.
Optionally: Please note that in order to use the Python virtual environemnt within Linux OS you need to install the rPython package from command line after activation of the virtual environment. As follows:
Activate the Python virtual environment
source <path to Python virtual environemnt>/bin/activate
Install the rPython R package
R CMD INSTALL <path to rPython package source>
Subsequently launch the application from command line after activating the Python virtual environment every time. As shown here.
-
shinythemes: Themes for Shiny
-
intergraph: Coercion Routines for Network Data Objects
-
ggplot2: Create Elegant Data Visualisations Using the Grammar of Graphics
-
visNetwork: Network Visualization using 'vis.js' Library
-
xtable: Export Tables to LaTeX or HTML
Or you can use this script to automatically install all required R packages (except from the rPython package, which requires special attention) after the language installation.
The application is written in R programming language and uses COBRApy for under the hood Flux Balance Analysis (FBA) simulations, reaction knockouts and constraining fluxes through exchange reactions. Consequently an installation of libSBML, R and Python with functioning cobra package is required.
Install system libSBML programming library. Necessary files and instructions for installation under Windows are available here
Install libSBML Python language interface
Install Python programming language (version of your choice, tested on 2.7.12) with following packages:
To install the packages using pip package management system type in the Command Prompt:
<absolute path to pip.exe> install <package_name>
e.g.:
C:/Python27/Scripts/pip.exe install sys
(you may need to adjust the path accordingly)
Install R programming language (version of your choice, tested on 3.4.3) with following packages:
-
rPython-win: Package Allowing R to Call Python
The necessary instructions on how to install Windows version of this package are available on the package's GitHub page
-
shinythemes: Themes for Shiny
-
intergraph: Coercion Routines for Network Data Objects
-
ggplot2: Create Elegant Data Visualisations Using the Grammar of Graphics
-
visNetwork: Network Visualization using 'vis.js' Library
-
xtable: Export Tables to LaTeX or HTML
Or you can use this script to automatically install all required R packages (except from the rPython package, which requires special attention) after the language installation.
Besides the installation of packages for both R and Python no further app installation is needed. Simply download the contents of this repository and save them in the directory of your choice (represented as "path/to/the/shinyapp/directory"
below).
To launch the app just run the following line of code in your favourite R IDE, e.g. RStudio:
shiny::runApp(appDir = "path/to/the/shinyapp/directory")
R -e "shiny::runApp(appDir = 'path/to/the/shinyapp/directory', launch.browser=TRUE)"