Skip to content

Commit

Permalink
Merge pull request #97 from gagneurlab/dev
Browse files Browse the repository at this point in the history
First release on bioconda
  • Loading branch information
mumichae committed Jul 20, 2020
2 parents 7a68cb1 + 2a52a40 commit fd32ed3
Show file tree
Hide file tree
Showing 13 changed files with 290 additions and 274 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ auto
docs/build/*

# IDE project files
.idea/
*.project
readme.html
*.Rproj
.Rproj.user
.Rhistory
.RData

# other
*~
Expand All @@ -40,5 +42,3 @@ slurm-*.out
*_files
*.cache
tmp/

.RData
88 changes: 30 additions & 58 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,68 +1,40 @@
language: python
sudo: required
dist: xenial

cache:
- directories:
- $HOME/R/Library
- /usr/bin/R
- $HOME/miniconda
- $HOME/htslib
- $HOME/bcftools

env:
global:
- DROP_DIR=$(pwd)
- PROJECT_DIR="$HOME/project"
- MINICONDA_DIR="$HOME/miniconda"
- CONDA_SCRIPT="$MINICONDA_DIR/etc/profile.d/conda.sh"
- R_LIBS_USER="$HOME/R/Library"
- TAR="/bin/tar"
#cache:
# - directories:
# - $HOME/miniconda

python:
- "3.6.7"
- "3.7"

addons:
apt:
packages:
- r-base
- libxml2-dev
- libcurl4-openssl-dev
- libssl-dev
- libblas-dev
- liblapack-dev
- gfortran
- graphviz
- pandoc
- tabix
sources:
- sourceline: 'deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/'
key_url: 'http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0xe298a3a825c0d65dfd57cbb651716619e084dab9'
update: true

install:
- cd $DROP_DIR
# - R -e "if ('FRASER' %in% rownames(installed.packages())) remove.packages('FRASER')"
# - R -e "if ('tMAE' %in% rownames(installed.packages())) remove.packages('tMAE')"
- Rscript travis/installRPackages.R drop/requirementsR.txt
- bash travis/install_bcftools.sh
- export PATH="$HOME/bcftools:$PATH"
- bcftools --version
- bash travis/install_conda.sh
- source $CONDA_SCRIPT
- conda activate drop_env
- pip install .
# Install Anaconda
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh
- bash /tmp/miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda

- conda config --add channels bioconda
- conda config --add channels conda-forge

before_script:
- mkdir -p $PROJECT_DIR
- cd $PROJECT_DIR
- drop demo
# build package with cond
- conda install conda-build
- conda build conda.recipe --output-folder=$HOME/build
- conda config --add channels "file://${HOME}/build"

# test package
- source $HOME/miniconda/etc/profile.d/conda.sh
- conda create -q -n drop drop
- conda activate drop

script:
- cd $PROJECT_DIR
- snakemake -n
- snakemake aberrantExpression --cores 2
- snakemake aberrantSplicing --cores 2
- snakemake mae --cores 2
- snakemake --cores 2
- snakemake exportCounts --cores 2
- conda list
- java -version
- gatk --help
- samtools --version
- bcftools --version
- drop --version
- python --version
79 changes: 25 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,84 +1,55 @@
# Detection of RNA Outlier Pipeline
[![Pipeline status](https://travis-ci.org/gagneurlab/drop.svg?branch=master)](https://travis-ci.org/gagneurlab/drop)
[![Version](https://img.shields.io/badge/Version-0.9.0-green.svg)](https://github.com/gagneurlab/drop/master)
[![Version](https://readthedocs.org/projects/gagneurlab-drop/badge/?version=latest)](https://gagneurlab-drop.readthedocs.io/en/latest)

The manuscript main file, supplementary figures and table can be found in the manuscript folder or in [protocol exchange](https://protocolexchange.researchsquare.com/article/993ff4a5-38ce-4261-902a-600dbd528ba2/v1).


[DROP documentation](https://gagneurlab-drop.readthedocs.io/en/latest/)
The manuscript main file, supplementary figures and table can be found in the manuscript folder or in
[protocol exchange](https://protocolexchange.researchsquare.com/article/993ff4a5-38ce-4261-902a-600dbd528ba2/v1).

<img src="drop_sticker.png" alt="drop logo" width="200" class="center"/>

## Dependencies
Programming languages:

+ python >= 3.6.7
+ pip >= 19.1
+ we recommend using a virtual environment e.g. anaconda
+ R >= 3.5 (https://www.r-project.org/). We recomment not to install R and its packages through conda.

### R packages
Bioconductor and base R packages need to be installed. The packages are listed in `drop/requirementsR.txt`. A script for installing these packages is provided. From the repository root just execute:
```
Rscript drop/installRPackages.R drop/requirementsR.txt
```
### Other packages
+ samtools >= 1.7 (https://www.htslib.org/download/)
+ bcftools (newest) (https://github.com/samtools/bcftools)
+ tabix (https://www.htslib.org/download/)
+ GATK (https://software.broadinstitute.org/gatk/)
+ graphviz (https://www.graphviz.org/)
+ pandoc (https://pandoc.org/)

## Installation
Make sure that all of the above listed [dependencies](#dependencies) are installed.
Then install DROP from github using `pip`. For this you need to recursively clone the repository with all its submodules first.
```
git clone https://github.com/gagneurlab/drop.git --recurse-submodules
```
Install DROP (activate your python environment if you are using one)
```
# conda activate drop_env
cd drop
pip install .
```
Alternatively, you can also install it directly without cloning
```
pip install git+https://github.com/gagneurlab/drop.git
DROP is available on [bioconda](https://anaconda.org/bioconda/drop) for python 3.6 and above.
We recommend using a dedicated conda environment.

```
Installation time (including all dependencies): ~ 1h
# create environment
conda create -n drop_env python=3.6
conda activate drop_env
### Initialize a project
DROP projects are initialized in a separate directory dedicated to the analysis project. Calling the initialization command creates the necessary files.
# install drop
conda install -c bioconda drop
```
cd <project/path>
drop init
```
Installation time: ~ 10min

## Set up the demo project
Test whether the pipeline runs through by setting up the demo dataset in an empty directory (e.g. ``~/drop_demo``).

First, install the drop module according to [installation](#installation).
Initialize the demo directory with a custom test project path.
In the following we will use `$HOME/drop_demo` as <project/path>.
```
cd $HOME/drop_demo
mkdir ~/drop_demo
cd ~/drop_demo
# demo will download the necessary data and pipeline files
drop demo
```
This command downloads the demo data (10 BAM files and a VCF file with 10 samples from the GEUVADIS project subset to chromosome 21), initializes DROP and adapts the config file paths to your current project directory.
Now the pipeline is ready to be executed using `snakemake`.

The pipeline can be run using `snakemake` commands

```
snakemake -n # dryrun
snakemake
```
Once the pipeline has run through, you will find the output in the `$HOME/drop_demo/Output`. It will consist of processed data, results and HTML pages. In order to view the complete HTML summary, open `$HOME/drop_demo/Output/htmlOutput/drop_demo_index.html` in the browser. Please note that this is a very small subset of the data used in the manuscript (100 samples and all chromosomes).

Expected runtime: 25 min

For more information on different installation options, check out the
[documentation](https://gagneurlab-drop.readthedocs.io/en/latest/installation.html)

## Set up a custom project
Install the drop module according to [installation](#installation) and initialize the project in a custom project directory.
### Prepare the input data
Create a sample annotation that contains the sample IDs, file locations and other information necessary for the pipeline.
Edit the config file to set the correct file path of sample annotation and locations of non-sample specific input files. For these steps, please refer to the [documentation](https://drop-rna.readthedocs.io/en/latest/prepare.html).
Edit the config file to set the correct file path of sample annotation and locations of non-sample specific input files.
The requirements are described in the [documentation](https://gagneurlab-drop.readthedocs.io/en/latest/prepare.html).

### Execute the pipeline
Once these files are set up, you can execute a dry run from your project directory
Expand Down
106 changes: 106 additions & 0 deletions conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{% set name = "drop" %}
{% set version = "0.9.0" %}

package:
name: "{{ name|lower }}"
version: "{{ version }}"

source:
path: ..

build:
number: 0
script:
- "{{ PYTHON }} -m pip install -vv git+https://github.com/gagneurlab/wbuild.git#egg=wbuild"
- "${R} -e 'BiocManager::install(\"mumichae/tMAE\", dependencies=FALSE, update=FALSE, ask=FALSE)'"
- "{{ PYTHON }} -m pip install . -vv"
rpaths:
- lib/R/lib/
- lib/

requirements:
build:
- {{ compiler('c') }}

host:
- python
- pip

# wbuild requirements
- pyyaml>=4.2b1
- pytest-runner

# tMAE requirements
- r-base>=4.0.0
- r-devtools
- r-biocmanager
- r-data.table
- r-ggplot2
- r-dplyr
- bioconductor-DESeq2
- bioconductor-GenomicScores

run:
- python
- pandas
- Click>=7.0
- click-log
- python-dateutil

# snakemake/wbuild
- snakemake=>5.5.2
- pandoc
- graphviz
- pyyaml>=4.2b1

# command line tools
- tabix
- samtools>=1.7
- bcftools>=1.7
- gatk4>=4.0.4
- star>=2.7

# R dependencies
- r-base>=4.0.0
- r-rmarkdown
- r-knitr
- r-ggplot2
- r-ggthemes
- r-cowplot
- r-data.table
- r-dplyr
- r-tidyr
- r-magrittr
- r-devtools

# bioconductor packages
- bioconductor-deseq2
- bioconductor-GenomicScores
- bioconductor-outrider
- bioconductor-fraser
- bioconductor-variantannotation
- bioconductor-bsgenome.hsapiens.ucsc.hg19
#- bioconductor-mafdb.gnomad.r2.1.hs37d5
#- bioconductor-mafdb.gnomad.r2.1.grch38

test:
imports:
- drop
- wbuild
commands:
- ${R} -e "library(tMAE)"
- wbuild --version
- drop --version

about:
home: "https://gagneurlab-drop.readthedocs.io"
license: MIT
license_family: MIT
license_file: ../LICENSE
summary: "Detection of RNA Outliers Pipeline"
doc_url:
dev_url:

extra:
recipe-maintainers:
- mumichae
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
author = 'Michaela Müller'

# The full version, including alpha/beta/rc tags
release = '0.0.9'
release = '0.9.0'


# -- General configuration ---------------------------------------------------
Expand Down
31 changes: 18 additions & 13 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
DROP - Detection of RNA Outliers Pipeline
==========================================

DROP is intended to help researchers use RNA-Seq data in order to detect genes with aberrant expression, aberrant splicing and mono-allelic expression. It consists of three independent modules for each of those strategies.
After installing DROP, the user needs to fill in the config file and sample annotation table (Preparing Input Data). Then, DROP can be executed in multiple ways (Executing the Pipeline).
DROP is intended to help researchers use RNA-Seq data in order to detect genes with aberrant expression,
aberrant splicing and mono-allelic expression. It consists of three independent modules for each of those strategies.
After installing DROP, the user needs to fill in the config file and sample annotation table (:ref:`prepare`).
Then, DROP can be executed in multiple ways (:ref:`pipeline`).

.. toctree::
:maxdepth: 2
Expand All @@ -17,20 +19,23 @@ After installing DROP, the user needs to fill in the config file and sample anno
Quickstart
-----------

Install via pip
DROP is available on `bioconda <https://anaconda.org/bioconda/drop>`_ for python 3.6 and above.
We recommend using a dedicated conda environment.

pip install drop
.. code-block:: bash
conda install -c bioconda drop
Initialize project

.. code-block:: bash
cd <path-to-project>
drop demo
Initialize the project
Call the pipeline

.. code-block:: bash
cd <project/path>
drop init
Indices and tables
==================
snakemake
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

0 comments on commit fd32ed3

Please sign in to comment.