Skip to content

Commit

Permalink
Merge branch 'dev' into 'main'
Browse files Browse the repository at this point in the history
Dev into master

See merge request tron/easyfuse-pipeline!19
  • Loading branch information
patricksorn committed Aug 11, 2023
2 parents 7ecc666 + a4dc0d8 commit 3f5612f
Show file tree
Hide file tree
Showing 17 changed files with 754 additions and 53 deletions.
7 changes: 7 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
easyfuse-pipeline:
image: continuumio/miniconda3:23.5.2-0
stage: build
script:
- conda install -c bioconda nextflow=20.10.0
- bash test/scripts/test_00.sh

4 changes: 0 additions & 4 deletions .gitmodules

This file was deleted.

13 changes: 13 additions & 0 deletions CONTRIBUTE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,16 @@
After the EasyFuse Python package is installed as described in the README, run the integration tests with `make`.

You may need to edit the test scripts to use an appropriate reference folder in `--reference`.

## Prepare a new release

Increase the version in the property `VERSION` in the file `nextflow.config`.

## Test the integration of easyfuse-src

The Python and R code are distributed as a Python package and this is imported in
EasyFuse pipeline via conda. But, for development purposes the import of this
package can be skipped while all other dependencies are still managed via conda.

Use the flag `--disable_pyeasyfuse_conda`, this will rely on whatever version of
pyeasyfuse has been installed on your environment.
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ For maximal sensitivity, we recommend using an older EasyFuse release with five
- Publication: [Weber D, Ibn-Salem J, Sorn P, et al. Nat Biotechnol. 2022](https://doi.org/10.1038/s41587-022-01247-9)




## Usage

### Dependencies
Expand All @@ -37,29 +35,21 @@ tar xvfz easyfuse_ref_v2.tar.gz
```


### Download nextflow pipeline and install EasyFuse package
### Install the nextflow pipeline

Next, you have to download the nextflow pipeline including the EasyFuse package source dir.
There are two alternatives, manually install the workflow or let Nexftlow handle this via the GitHub repository.

To install manually:
```
git clone --recurse-submodules https://github.com/TRON-Bioinformatics/EasyFuse.git
git clone https://github.com/TRON-Bioinformatics/EasyFuse.git
cd EasyFuse
```

cd easyfuse_src
# Create virtual environment using Python3.7 (only works on Python3.7)
python3.7 -m venv env/
# Activate environment
source env/bin/activate
# Install poetry for easy installation
pip install poetry
# Install EasyFuse package using poetry
poetry install
To install with Nextflow (only available from release 2.0.1):
```
nextflow run tron-bioinformatics/easyfuse -r x.y.z --help
```
where x.y.z corresponds to an EasyFuse release.


### Run the pipeline
Expand All @@ -74,11 +64,21 @@ sample_01 /path/to/sample_01_R1.fastq.gz /path/to/sample_01_R2.fastq.gz
```


Start the pipeline as follows
Start the pipeline as follows if you installed manually

```
nextflow main.nf \
-profile conda \
-profile conda -with-conda \
--reference /path/to/reference/folder \
--input_files /path/to/input_table_file \
--output /path/to/output_folder
```


Or as follows if you installed it via Nextflow (only available from release 2.0.1):
```
nextflow run tron-bioinformatics/easyfuse -r x.y.z \
-profile conda -with-conda \
--reference /path/to/reference/folder \
--input_files /path/to/input_table_file \
--output /path/to/output_folder
Expand Down
1 change: 0 additions & 1 deletion easyfuse_src
Submodule easyfuse_src deleted from 6e37df
8 changes: 8 additions & 0 deletions environments/easyfuse_src.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: easyfuse_src
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- bioconda::pyeasyfuse=2.0.3
- bioconda::skewer=0.2.2
1 change: 0 additions & 1 deletion environments/qc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ channels:
- defaults
dependencies:
- bioconda::fastqc=0.11.9
- bioconda::skewer=0.2.2
2 changes: 1 addition & 1 deletion environments/requantification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ channels:
- defaults
dependencies:
- bioconda::star=2.6.1d
- bioconda::samtools=1.9.0
- bioconda::pyeasyfuse=2.0.3
8 changes: 8 additions & 0 deletions environments/requantification_wo_easyfuse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: requantification
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- bioconda::star=2.6.1d
- bioconda::samtools=1.9.0
12 changes: 0 additions & 12 deletions environments/summarize_data.yml

This file was deleted.

6 changes: 3 additions & 3 deletions modules/01_qc.nf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ process FASTQC_PARSER {
memory "8g"
tag "${name}"

// conda (params.enable_conda ? "bioconda::fastqc=0.11.9" : null)
conda (params.enable_conda && ! params.disable_pyeasyfuse_conda ? "${baseDir}/environments/easyfuse_src.yml" : null)

input:
tuple val(name),
Expand All @@ -40,7 +40,7 @@ process FASTQC_PARSER {
path("qc_table.txt"), emit: qc_table

"""
easy-fuse qc-parser -i $fastq1_qc_data $fastq1_qc_data -o qc_table.txt
easy-fuse qc-parser -i $fastq1_qc_data $fastq2_qc_data -o qc_table.txt
"""
}

Expand All @@ -49,7 +49,7 @@ process SKEWER {
memory "8g"
tag "${name}"

conda (params.enable_conda ? "${baseDir}/environments/qc.yml" : null)
conda (params.enable_conda ? "${baseDir}/environments/easyfuse_src.yml" : null)

input:
tuple val(name),
Expand Down
2 changes: 1 addition & 1 deletion modules/02_alignment.nf
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ process READ_FILTER {
memory "8g"
tag "${name}"

//conda (params.enable_conda ? "bioconda::easyfuse=0.1.0" : null)
conda (params.enable_conda && ! params.disable_pyeasyfuse_conda ? "${baseDir}/environments/easyfuse_src.yml" : null)

input:
tuple val(name), path(bam)
Expand Down
4 changes: 2 additions & 2 deletions modules/04_joint_fusion_calling.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ process FUSION_PARSER {
memory "8g"
tag "${name}"

//conda (params.enable_conda ? "bioconda::easyfuse=0.1.0" : null)
conda (params.enable_conda && ! params.disable_pyeasyfuse_conda ? "${baseDir}/environments/easyfuse_src.yml" : null)

input:
tuple val(name), path(fusion_catcher_1), path(fusion_catcher_2), path(star_fusion)
Expand All @@ -30,7 +30,7 @@ process FUSION_ANNOTATION {
memory "8g"
tag "${name}"

//conda (params.enable_conda ? "bioconda::easyfuse=0.1.0" : null)
conda (params.enable_conda && ! params.disable_pyeasyfuse_conda ? "${baseDir}/environments/easyfuse_src.yml" : null)

input:
tuple val(name), path(fusions)
Expand Down
16 changes: 11 additions & 5 deletions modules/05_requantification.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ process STAR_INDEX {
memory "8g"
tag "${name}"

//conda (params.enable_conda ? "bioconda::easyfuse=0.1.0" : null)
conda (params.enable_conda ? "${baseDir}/environments/requantification.yml" : null)
// NOTE: we really need STAR and samtools here, these are not added as dependencies to the bioconda package
if (params.disable_pyeasyfuse_conda) {
conda (params.enable_conda ? "${baseDir}/environments/requantification_wo_easyfuse.yml" : null)
}
else {
conda (params.enable_conda ? "${baseDir}/environments/requantification.yml" : null)
}

input:
tuple val(name), path(annot_csv), path(annot_fasta)
Expand All @@ -30,7 +35,7 @@ process FUSION_FILTER {
memory "8g"
tag "${name}"

//conda (params.enable_conda ? "bioconda::easyfuse=0.1.0" : null)
conda (params.enable_conda && ! params.disable_pyeasyfuse_conda ? "${baseDir}/environments/easyfuse_src.yml" : null)

input:
tuple val(name), path(bam), path(annot_fusions_1), path(annot_fusions_2), path(read_stats)
Expand All @@ -54,7 +59,7 @@ process STAR_CUSTOM {
memory "32g"
tag "${name}"

conda (params.enable_conda ? "${baseDir}/environments/requantification.yml" : null)
conda (params.enable_conda ? "${baseDir}/environments/requantification_wo_easyfuse.yml" : null)

input:
tuple val(name), path(fastq1), file(fastq2), path(star_index)
Expand Down Expand Up @@ -87,7 +92,8 @@ process READ_COUNT {
cpus 6
memory "50g"
tag "${name}"
//publishDir "${params.output}/${name}", mode: 'copy'

conda (params.enable_conda && ! params.disable_pyeasyfuse_conda ? "${baseDir}/environments/easyfuse_src.yml" : null)

input:
tuple val(name), path(bam), path(bam_index), path(read_stats)
Expand Down
2 changes: 1 addition & 1 deletion modules/06_summarize.nf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ process SUMMARIZE_DATA {
tag "${name}"
publishDir "${params.output}/${name}", mode: 'copy'

conda (params.enable_conda ? "${baseDir}/environments/summarize_data.yml" : null)
conda (params.enable_conda && ! params.disable_pyeasyfuse_conda ? "${baseDir}/environments/easyfuse_src.yml" : null)

input:
tuple val(name), path(fusions), path(annot_csv), path(annot_fasta), path(cpms), path(counts), path(read_stats)
Expand Down
5 changes: 4 additions & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env {
// Capture exit codes from upstream processes when piping
process.shell = ['/bin/bash', '-euo', 'pipefail']

VERSION = '2.0.0a1'
VERSION = '2.0.1'

manifest {
name = 'TRON-Bioinformatics/easy-fuse-workflow'
Expand All @@ -43,6 +43,9 @@ params.annotation_db = "${params.reference}/Homo_sapiens.GRCh38.86.gff3.db"
params.reference_tsl = "${params.reference}/Homo_sapiens.GRCh38.86.gtf.tsl"
params.model_pred = "${baseDir}/data/model/Fusion_modeling_FFPE_train_v35.random_forest.model_full_data.EF_requant_type.rds"

// use this to avoid
params.disable_pyeasyfuse_conda = false



params.help_message = """
Expand Down

0 comments on commit 3f5612f

Please sign in to comment.