The prerequisites for LeafCutter are
To download the code (you’ll need this for the leafcutter scripts)
git clone https://github.com/davidaknowles/leafcutter
If you just want to get leafcutter quantifications (junction counts for each splicing cluster) e.g. for sQTL analysis, then you just need the python scripts in scripts
and clustering
.
If you want to do differential splicing analysis and visualization you’ll need to install the leafcutter R package.
Leafcutter relies on stan and its R interface rstan
. Installing this can be tricky. If you’re lucky
install.packages("rstan")
will just work for you. If not, there are instructions that should help you. On Linux I seem to need
CXX14FLAGS=-O3 -march=native -mtune=native -fPIC
CXX14=g++
in ~/.R/Makevars
.
For now we also need a version of rstantools
(2.0.0) that is not yet on CRAN, so do:
if (!require("devtools")) install.packages("devtools", repos='http://cran.us.r-project.org')
devtools::install_github("stan-dev/rstantools")
You can use remotes
instead of devtools
if you don’t want to wait on the long devtools
install.
To compile the R package to perform differential splicing analysis and make junction plots we recommend you install using devtools (this should install the required R package dependencies for you).
devtools::install_github("davidaknowles/leafcutter/leafcutter")
We’ve had a report (thanks to Peter Carbonetto) that it may be necessary to restart R before trying to load leafcutter
because dplyr
may get updated during the installation process.
Alternatively you can install from source. You’ll need to manually install the following R packages: Rcpp, rstan, rstantools, foreach, ggplot2, R.utils, gridExtra, reshape2, Hmisc, dplyr, doMC, optparse, shiny, intervals, shinycssloaders, DT, gtable, shinyjs, DirichletMultinomial, TailRank, magrittr, stringr
. Then make sure you’re in the leafcutter
package sub-directory (you should see subdirectories called src, R, tests
etc) and run
R CMD INSTALL --build .
If you see errors try installing the roxygen2
package and running
R CMD INSTALL --preclean --build .
which will attempt to use stan
to rebuild the C++ code from the .stan
files in exec
.
If you are a 64-bit Linux conda
user ( installation instructions ) we have an experimental package which can be installed using
conda install -c davidaknowles r-leafcutter
We will build macOS and Windows packages if there is demand for this.