Skip to content
This repository has been archived by the owner on Jan 27, 2020. It is now read-only.

Conda #718

Merged
merged 3 commits into from
Jan 31, 2019
Merged

Conda #718

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### `Added`
- [#712](https://github.com/SciLifeLab/Sarek/pull/712), [#718](https://github.com/SciLifeLab/Sarek/pull/718) - Added possibilities to run Sarek with `conda`

### `Changed`

- [#710](https://github.com/SciLifeLab/Sarek/pull/710) - Improve release checklist and script
Expand Down
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,14 @@ The Sarek pipeline comes with documentation in the `docs/` directory:
06. [Configuration and profiles documentation](https://github.com/SciLifeLab/Sarek/blob/master/docs/CONFIG.md)
07. [Intervals documentation](https://github.com/SciLifeLab/Sarek/blob/master/docs/INTERVALS.md)
08. [Running the pipeline](https://github.com/SciLifeLab/Sarek/blob/master/docs/USAGE.md)
09. [Command line parameters](https://github.com/SciLifeLab/Sarek/blob/master/docs/PARAMETERS.md)
10. [Examples](https://github.com/SciLifeLab/Sarek/blob/master/docs/USE_CASES.md)
11. [Input files documentation](https://github.com/SciLifeLab/Sarek/blob/master/docs/INPUT.md)
12. [Processes documentation](https://github.com/SciLifeLab/Sarek/blob/master/docs/PROCESS.md)
13. [Documentation about containers](https://github.com/SciLifeLab/Sarek/blob/master/docs/CONTAINERS.md)
14. [More information about ASCAT](https://github.com/SciLifeLab/Sarek/blob/master/docs/ASCAT.md)
15. [Output documentation structure](https://github.com/SciLifeLab/Sarek/blob/master/docs/OUTPUT.md)
09. [Running the pipeline using Conda](https://github.com/SciLifeLab/Sarek/blob/master/docs/CONDA.md)
10. [Command line parameters](https://github.com/SciLifeLab/Sarek/blob/master/docs/PARAMETERS.md)
11. [Examples](https://github.com/SciLifeLab/Sarek/blob/master/docs/USE_CASES.md)
12. [Input files documentation](https://github.com/SciLifeLab/Sarek/blob/master/docs/INPUT.md)
13. [Processes documentation](https://github.com/SciLifeLab/Sarek/blob/master/docs/PROCESS.md)
14. [Documentation about containers](https://github.com/SciLifeLab/Sarek/blob/master/docs/CONTAINERS.md)
15. [More information about ASCAT](https://github.com/SciLifeLab/Sarek/blob/master/docs/ASCAT.md)
16. [Output documentation structure](https://github.com/SciLifeLab/Sarek/blob/master/docs/OUTPUT.md)

## Contributions & Support

Expand Down Expand Up @@ -117,6 +118,7 @@ Helpful contributors:
* [Björn Nystedt](https://github.com/bjornnystedt)
* [Pall Olason](https://github.com/pallolason)
* [Aron Skaftason](https://github.com/arontommi)
* [Nilesh Tawari](https://github.com/nilesh-tawari)

--------------------------------------------------------------------------------

Expand Down
10 changes: 10 additions & 0 deletions conf/conda.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* -------------------------------------------------
* Nextflow config file for Sarek
* -------------------------------------------------
* Conda environments for every process
* All environment need to be set up
* -------------------------------------------------
*/

process.conda = 'environment.yml'
45 changes: 45 additions & 0 deletions docs/CONDA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Run Sarek using Conda

> /!\\
This functionality is still under development, so we would recommend to use it with care.

> /!\\
A conda environment is defined but does not contain all the tools needed for fully using Sarek.

To use Sarek with conda, first make sure that you have conda installed.
We recommend miniconda:
https://conda.io/miniconda.html

Sarek comes with a conda environment definition - a file called
[`environment.yml`](../environment.yml) which lists conda channels and package names/versions.

To run Sarek with Conda, you can use/modify the profile `conda`, or follow the following steps:

1. Create a new environment using the [`environment.yml`](../environment.yml) file:

```bash
# Download the environment.yml file
curl https://raw.githubusercontent.com/SciLifeLab/Sarek/master/environment.yml -o environment.yml

# Create a new conda environment using it
conda env create -f environment.yml
```

2. Create a nextflow config file as indicated below (Usually as `~/.nextflow/config` file):

```groovy
process {
beforeScript = { 'module load anaconda; set +u; source activate sarek-2.2.2; set -u;' }
}
```

3. While launcing Sarek specify the nextflow config file crreated in step 2 using `-c` option:

```bash
nextflow run SciLifeLab/Sarek/main.nf \
--sample samples_germline.tsv \
-profile conda \
--genome_base /sw/data/uppnex/ToolBox/hg38bundle \
--genome GRCh38 \
-c ~/.nextflow/config
```
13 changes: 13 additions & 0 deletions docs/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ Define usage limits and Singularity for BINAC cluster in Tuebingen.

Designed for usage with Singularity on CFC at QBic.

### [`conda.config`](https://github.com/SciLifeLab/Sarek/blob/master/conf/conda.config)

> /!\\ Under development.

Define conda environement.

### [`containers.config`](https://github.com/SciLifeLab/Sarek/blob/master/conf/containers.config)

Define Containers for all process.
Expand Down Expand Up @@ -107,6 +113,13 @@ This is the profile for use on the BTB server munin.

This is the profile for use on the CFC cluster in Tuebingen.

### `conda`

> /!\\ Under development.

This is the profile for conda testing on a small machine, or on Travis CI.
Conda environement will be built automatically.

### `docker`

This is the profile for docker testing on a small machine, or on Travis CI.
Expand Down
47 changes: 0 additions & 47 deletions docs/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ This guide will take you through your first run of Sarek.
It is divided into two steps corresponding to the two main types of analysis offered by Sarek:
- Run a Germline Analysis
- Run a Somatic Analysis
- Run Sarek using Bioconda

This guide assumes you have internet access on the server where the analysis will take place. If you do not have that, please look into the [installation instructions](INSTALL_BIANCA.md) for the restricted access server Bianca at Uppmax, which should give an idea on how to adjust the following examples accordingly.

Expand Down Expand Up @@ -183,49 +182,3 @@ nextflow run SciLifeLab/Sarek/runMultiQC.nf \
-profile slurm
--project <your uppmax project id> \
```

## Run Sarek using Bioconda

To use Sarek with conda, first make sure that you have conda installed. We recommend miniconda:
https://conda.io/miniconda.html

Sarek comes with a conda environment definition - a file called
[`environment.yml`](../environment.yml) which lists conda channels and package names/versions.
Follow the steps below to run Sarek with Conda:

- Step 1: Create a new environment using the [`environment.yml`](../environment.yml) file:

```bash
# Download the environment.yml file
curl https://raw.githubusercontent.com/SciLifeLab/Sarek/master/environment.yml -o environment.yml

# Create a new conda environment using it
conda env create -f environment.yml

```

- Step 2: Create a nextflow config file as indicated below (Usually as `~/.nextflow/config` file):

```
process {
beforeScript = { 'module load anaconda; set +u; source activate sarek-2.2.2; set -u;' }
// errorStrategy = { task.attempt < 2 ? 'retry' : 'finish' }
// Optionally executor/cluster specific details can be added as indicated below,
/*
executor='sge'
penv='smp'
*/
}
```

- Step 3: While launcing Sarek specify the nextflow config file crreated in step 2 using `-c` option:

```
nextflow run SciLifeLab/Sarek/main.nf \
--sample samples_germline.tsv \
-profile conda \
--project <your uppmax project id> \
--genome_base /sw/data/uppnex/ToolBox/hg38bundle \
--genome GRCh38
-c ~/.nextflow/config
```
3 changes: 2 additions & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@ profiles {
}
conda {
includeConfig 'conf/base.config'
includeConfig 'conf/travis.config'
includeConfig 'conf/genomes.config'
includeConfig 'conf/resources.config'
includeConfig 'conf/conda.config'
}
}

Expand Down