Skip to content

Commit

Permalink
Merge pull request #3 from rki-mf1/feature/docker
Browse files Browse the repository at this point in the history
Feature/docker
  • Loading branch information
chkirschbaum authored Feb 19, 2025
2 parents ecb519c + 924c26c commit 34e251a
Show file tree
Hide file tree
Showing 14 changed files with 113 additions and 53 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ results/
conda/
.conda/

# Singularity
singularity/

# nextflow
.nextflow/
.nextflow.log*
Expand Down
53 changes: 44 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
<h3 align="center"> Mutation-Based Early Warning System to Prioritize Concerning Influenza Variants from Sequencing Data </h3>
</div>

[![Nextflow](https://img.shields.io/badge/nextflow%20DSL2-%E2%89%A522.10.1-23aa62.svg)](https://www.nextflow.io/)
[![run with conda](https://img.shields.io/badge/run%20with-conda-3EB049?labelColor=000000&logo=anaconda)](https://docs.conda.io/en/latest/)
[![run with docker](https://img.shields.io/badge/run%20with-docker-0db7ed?labelColor=000000&logo=docker)](https://www.docker.com/)
[![run with singularity](https://img.shields.io/badge/run%20with-singularity-1d355c.svg?labelColor=000000)](https://sylabs.io/docs/)

The goal of VirusWarn-Flu is to detect concerning Influenza variants from sequencing data.
It does so by parsing Influenza genomes and detecting amino acids mutations in the spike proteins that can be associated with a phenotypic change. The phenotypic changes are annotated according to the knowledge accumulated on previous variants.
The tool is based on <a href="https://github.com/rki-mf1/VirusWarn-SC2"><strong>VirusWarn-SC2</strong></a>, which was invented for SARS-CoV-2.
Expand All @@ -23,16 +28,24 @@ VirusWarn-Flu is part of *VirusWarn*

## Quick Installation

To run the pipeline, you need to have `conda` and `Nextflow` installed and set up.
All other dependencies will be installed over `conda` in the pipeline.
To run the pipeline, you need to have `Nextflow` and either `conda`, `Docker` or `Singularity`.

<details><summary><strong>Click!</strong> If you want to install <code>Nextflow</code> directly, you can use the following one-liner. </summary>

```bash
wget -qO- https://get.nextflow.io | bash
```
</details>

<details><summary><strong>Click!</strong> If you want to set up <code>conda</code> to run the pipeline and install all other dependencies through it, you can use the following steps. </summary>

To install `conda`, use the following bash commands if you are working on **Linux**:
Use the following bash commands if you are working on **Linux**:
```bash
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
```

To install `conda`, use the following bash commands if you are working on **Mac**:
Use the following bash commands if you are working on **Mac**:
```bash
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh
bash Miniconda3-latest-MacOSX-arm64.sh
Expand All @@ -43,31 +56,53 @@ Then, `Nextflow` an be installed over `conda`:
conda create -n nextflow -c bioconda nextflow
conda activate nextflow
```
</details>

### Get / Update VirusWarn-Flu

The VirusWarn-Flu repository can be cloned from Git:
```bash
git clone https://github.com/rki-mf1/VirusWarn-Flu.git
nextflow pull rki-mf1/VirusWarn-Flu
```

### Call help

```bash
nextflow run main.nf --help
nextflow run rki-mf1/VirusWarn-Flu -r <version> --help
```

## Running VirusWarn-Flu

With a `conda`, please run:

```bash
nextflow run main.nf \
nextflow run rki-mf1/VirusWarn-Flu -r <version> \
-profile conda,local \
--fasta 'test/openflu_h1n1.fasta' \
--metadata 'test/metadata_h1n1.xlsx'
```

With a `Docker`, please run:

```bash
nextflow run rki-mf1/VirusWarn-Flu -r <version> \
-profile docker,local \
--fasta 'test/openflu_h1n1.fasta' \
--metadata 'test/metadata_h1n1.xlsx'
```

With a `Singularity`, please run:

```bash
nextflow run rki-mf1/VirusWarn-Flu -r <version> \
-profile singularity,local \
--fasta 'test/openflu_h1n1.fasta' \
--metadata 'test/metadata_h1n1.xlsx'
```

### Running VirusWarn-Flu with splitting (Input from OpenFlu)

```bash
nextflow run main.nf \
nextflow run rki-mf1/VirusWarn-Flu -r <version> \
-profile conda,local \
--fasta 'test/openflu_combi.fasta' \
--metadata 'test/metadata_combi.xlsx' \
Expand Down
5 changes: 2 additions & 3 deletions config/conda.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
process {
withLabel: split { conda = "$projectDir/envs/split.yml" }
withLabel: qc { conda = "$projectDir/envs/qc.yml" }
withLabel: biopython { conda = "$projectDir/envs/biopython.yml" }
withLabel: nextclade { conda = "$projectDir/envs/nextclade.yml" }
withLabel: annotation { conda = "$projectDir/envs/annotation.yml" }
withLabel: qc { conda = "$projectDir/envs/qc.yml" }
withLabel: report { conda = "$projectDir/envs/report.yml" }
}
6 changes: 6 additions & 0 deletions config/container.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
process {
withLabel: biopython { container = "rkimf1/viruswarn-biopython:1.79--6875bf5" }
withLabel: nextclade { container = "rkimf1/viruswarn-flu-nextclade:3.0.1--32ead72" }
withLabel: qc { container = "rkimf1/viruswarn-flu-qc:2.25--f0db0b4" }
withLabel: report { container = "rkimf1/viruswarn-flu-report:2.25--782b9d7" }
}
3 changes: 1 addition & 2 deletions envs/annotation.yml → envs/biopython.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: annotation
name: biopython
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- python=3.9.7
- biopython=1.79
Expand Down
1 change: 0 additions & 1 deletion envs/nextclade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: nextclade
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- nextclade=3.0.1
- python=3.9.7
Expand Down
2 changes: 1 addition & 1 deletion envs/qc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: qc
channels:
- conda-forge
- bioconda
- defaults
- r
dependencies:
- python=3.9.7
- pandas=1.5.3
Expand Down
1 change: 0 additions & 1 deletion envs/report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ channels:
- conda-forge
- bioconda
- r
- defaults
dependencies:
- r-base=4.3.2
- r-optparse=1.7.3
Expand Down
8 changes: 0 additions & 8 deletions envs/split.yml

This file was deleted.

2 changes: 1 addition & 1 deletion modules/local/annotation.nf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
process ANNOTATION {
label 'annotation'
label 'biopython'

publishDir "${params.output}/${params.annot_dir}", mode: params.publish_dir_mode

Expand Down
2 changes: 1 addition & 1 deletion modules/local/split.nf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
process SPLIT {
label 'split'
label 'biopython'

publishDir "${params.output}/${params.split_dir}", mode: params.publish_dir_mode

Expand Down
14 changes: 14 additions & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ params {

// location for engines' cache
conda_cache_dir = 'conda'
singularity_cache_dir = 'singularity'

cloudProcess = false
}
Expand Down Expand Up @@ -95,6 +96,19 @@ profiles {
}
includeConfig 'config/conda.config'
}
docker {
docker { enabled = true }
includeConfig 'config/container.config'
}
singularity {
singularity {
enabled = true
autoMounts = true
cacheDir = params.singularity_cache_dir
envWhitelist = "HTTPS_PROXY,HTTP_PROXY,http_proxy,https_proxy,FTP_PROXY,ftp_proxy"
}
includeConfig 'config/container.config'
}

// no config for stub runs
stub {
Expand Down
16 changes: 8 additions & 8 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ With the following commands and data set, the mode subtype can be tested for Inf
### Running test set

```bash
nextflow run main.nf \
nextflow run rki-mf1/VirusWarn-Flu -r <version> \
-profile conda,local \
--fasta 'test/openflu_h1n1.fasta'
```

### Running test set with metadata

```bash
nextflow run main.nf \
nextflow run rki-mf1/VirusWarn-Flu -r <version> \
-profile conda,local \
--fasta 'test/openflu_h1n1.fasta' \
--metadata 'test/metadata_h1n1.xlsx'
Expand All @@ -46,7 +46,7 @@ With the following commands and data set, the mode subtype can be tested for Inf
### Running test set

```bash
nextflow run main.nf \
nextflow run rki-mf1/VirusWarn-Flu -r <version> \
-profile conda,local \
--fasta 'test/openflu_h3n2.fasta' \
--subtype 'h3n2'
Expand All @@ -55,7 +55,7 @@ nextflow run main.nf \
### Running test set with metadata

```bash
nextflow run main.nf \
nextflow run rki-mf1/VirusWarn-Flu -r <version> \
-profile conda,local \
--fasta 'test/openflu_h3n2.fasta' \
--metadata 'test/metadata_h3n2.xlsx' \
Expand Down Expand Up @@ -83,7 +83,7 @@ With the following commands and data set, the mode subtype can be tested for Inf
### Running test set

```bash
nextflow run main.nf \
nextflow run rki-mf1/VirusWarn-Flu -r <version> \
-profile conda,local \
--fasta 'test/openflu_vic.fasta' \
--subtype 'vic'
Expand All @@ -92,7 +92,7 @@ nextflow run main.nf \
### Running test set with metadata

```bash
nextflow run main.nf \
nextflow run rki-mf1/VirusWarn-Flu -r <version> \
-profile conda,local \
--fasta 'test/openflu_vic.fasta' \
--metadata 'test/metadata_vic.xlsx' \
Expand All @@ -119,7 +119,7 @@ With the following commands and data set, the mode split can be tested for OpenF
### Running test set

```bash
nextflow run main.nf \
nextflow run rki-mf1/VirusWarn-Flu -r <version> \
-profile conda,local \
--fasta 'test/openflu_combi.fasta' \
--split 'OpenFlu'
Expand All @@ -128,7 +128,7 @@ nextflow run main.nf \
### Running test set with metadata

```bash
nextflow run main.nf \
nextflow run rki-mf1/VirusWarn-Flu -r <version> \
-profile conda,local \
--fasta 'test/openflu_combi.fasta' \
--metadata 'test/metadata_combi.xlsx' \
Expand Down
Loading

0 comments on commit 34e251a

Please sign in to comment.