Skip to content

stowersinstitute/libpb-1699-metabolomics

Repository files navigation

Introduction

This repository contains the analysis pipeline and Shiny app from the paper "Untargeted Metabolomics of the Cavefish Astyanax mexicanus Reveals the Basis of Metabolic Strategies in Adaptation to Extreme Conditions". It should be thought of as a self-contained resource for reproducing the results of the manuscript. The input consists of metabolomics data post peak-calling and normalization in the data/primary and data/lipids directories.

Tested Environments

The pipeline has been tested on Fedora Linux 32 and macOS Mojave 10.14.6.

Before You Begin

If you received the software with an out directory residing in this directory, the pipeline has already been run. Delete the out directory (make a backup if you wish) and run the following command to clean out the directory before attempting to rerun:

git clean -fXd

Required Software

  • GHC 8.6.5 (or later) and Cabal 2.4.1.0 (or later)
  • Can be obtained from ghcup.
  • Python 3.8.3 or later (if running 3.9 or later see below)
  • pipenv 2018.11.26 or later
  • Can usually be obtained by running sudo pip install pipenv or conda install pipenv if using Anaconda.
  • R (specifically the Rscript command, which needs to be on the PATH) 3.6.3 or later.

Installing dependencies

First, install all required Python packages:

python3 -m pipenv install

Then install all required R packages. Some R packages require certain system header files to be present, e.g. the png package requires header files for libpng. If the following command fails consult the documentation of the respective packages that fail to install.

Rscript -e "renv::restore()"

Running the Pipeline

Run the following three commands:

cabal new-update
cabal new-build
cabal new-run pipeline

This will generate all figures under out/fig, and supplementary information under out/supp.

Running the Shiny App

Be sure that you first run the pipeline (above), as the Shiny app requires datafiles generated by the pipeline. The included .Rprofile file is links to an renv that contains all packages necessary for the app. Simply run

Rscript ./src/R/shiny/app.R

and point your browser to the appropriate port number (which will be displayed on the console). The script will install phantomjs if it is not already installed.

This app is currently hosted at https://cavefin.shinyapps.io/shiny/.

Notes

Newer Python Versions (3.9+)

If running a newer version of Python, you may need to edit the Pipfile and change the line:

python_version = "3.8"

to (substitute your Python version)

python_version = "3.9"

However, some packages may not work with newer versions of Python or may have different behavior.

Outliers

An earlier version of the pipeline was applied in parallel to identify outliers and run analysis with and without these datapoints. Currently, no points are excluded as outliers. Directories may still have "with-outliers" in the name in reference to this scheme.