Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
60d6239
Add NEXTFLOW_RUN module
beatrizsavinhas Jun 24, 2026
0d39b0e
Merge branch 'dev' into add-cascade
beatrizsavinhas Jun 25, 2026
940a0f6
Merge branch 'dev' into add-cascade
beatrizsavinhas Jun 25, 2026
4c65c5d
Merge branch 'dev' into add-cascade
beatrizsavinhas Jun 25, 2026
9f11e74
Merge branch 'dev' into add-cascade
beatrizsavinhas Jun 25, 2026
aa9ef26
Merge branch 'dev' into add-cascade
beatrizsavinhas Jun 25, 2026
41e99ce
Merge branch 'dev' into add-cascade
beatrizsavinhas Jun 25, 2026
12e30c5
Merge branch 'dev' into add-cascade
beatrizsavinhas Jun 25, 2026
a0fedfa
Merge branch 'dev' into add-cascade
beatrizsavinhas Jun 26, 2026
ee6346b
Merge branch 'dev' into add-cascade
beatrizsavinhas Jun 26, 2026
ec21417
Merge branch 'dev' into add-cascade
beatrizsavinhas Jun 26, 2026
bed9bf3
Add module test and snapshot.
beatrizsavinhas Jun 26, 2026
2814025
Update snapshot to collet output only.
beatrizsavinhas Jun 29, 2026
c1b81b2
Update snapshot to collet stable_path and stable_content.
beatrizsavinhas Jun 29, 2026
93b17a6
Update changelog.
beatrizsavinhas Jun 29, 2026
447aee6
Update changelog.
beatrizsavinhas Jun 29, 2026
b137933
Update implementation to have flexible outdir.
beatrizsavinhas Jun 29, 2026
5e9c171
Update test to not snapshot unstable file.
beatrizsavinhas Jun 29, 2026
cef23c7
Fix revision in test.
beatrizsavinhas Jun 29, 2026
779d06e
Revert flexible outdir feature.
beatrizsavinhas Jun 29, 2026
f87c4cb
Update test to capture software versions.
beatrizsavinhas Jun 29, 2026
2e4665d
Update snapshots with arm64.
beatrizsavinhas Jun 29, 2026
025046a
Add main workflow with NFCORE_ONCOANALYSER.
beatrizsavinhas Jun 29, 2026
cdccf51
Add input parameters.
beatrizsavinhas Jun 29, 2026
69a9e55
Update main.nf
beatrizsavinhas Jun 29, 2026
e4fa06b
Update test config
beatrizsavinhas Jun 29, 2026
6a98cdb
Update default parameters to match val variable type.
beatrizsavinhas Jun 29, 2026
56e73ff
feat: Add `NEXTFLOW_RUN` local module (#2)
beatrizsavinhas Jun 29, 2026
7d8f214
Merge branch 'dev' into add-oncoanalyser
beatrizsavinhas Jun 29, 2026
9739d33
Merge branch 'dev' into add-cascade
beatrizsavinhas Jun 29, 2026
f318844
Merge branch 'add-cascade' into add-oncoanalyser
beatrizsavinhas Jun 29, 2026
9396785
Merge branch 'dev' into add-cascade
beatrizsavinhas Jun 29, 2026
6507e8f
Merge branch 'add-cascade' into add-oncoanalyser
beatrizsavinhas Jun 29, 2026
cfea055
Merge branch 'dev' into add-cascade
beatrizsavinhas Jun 29, 2026
f8b85aa
Merge branch 'add-cascade' into add-oncoanalyser
beatrizsavinhas Jun 29, 2026
cdab1c1
Update setting for cache_dir.
beatrizsavinhas Jun 29, 2026
6b549fa
Fix linting issue with block order in NEXTFLOW_RUN.
beatrizsavinhas Jun 29, 2026
2b6ef10
Merge branch 'add-cascade' into add-oncoanalyser
beatrizsavinhas Jun 29, 2026
c18879a
Remove cache_dir parameter from test.config.
beatrizsavinhas Jun 29, 2026
32350c5
Update pipeline test to match output directory strategy.
beatrizsavinhas Jun 29, 2026
ce915c4
Update test profile to use stub.
beatrizsavinhas Jun 30, 2026
2a2e26a
Remove unnecessary new line in main.nf
beatrizsavinhas Jun 30, 2026
1f22805
Update test config.
beatrizsavinhas Jun 30, 2026
6548d13
Update pipeline test to match output directory strategy.
beatrizsavinhas Jun 30, 2026
1d43712
Revert changes to default test to use params.outdir.
beatrizsavinhas Jul 1, 2026
43d01f5
Update test config to run in stub and remove unused arguments.
beatrizsavinhas Jul 2, 2026
d36495e
Fix indentation in test config
beatrizsavinhas Jul 2, 2026
ccd417c
Ad publish block to main.nf
beatrizsavinhas Jul 2, 2026
a90a887
Update test name.
beatrizsavinhas Jul 2, 2026
de4f08f
Merge branch 'dev' into add-cascade
beatrizsavinhas Jul 2, 2026
c031ff9
Merge branch 'dev' into add-cascade
beatrizsavinhas Jul 2, 2026
c9ca68b
Merge dev and move code to worfklows/oncoflow.nf
beatrizsavinhas Jul 2, 2026
f9fa106
Move code to worfklows/oncoflow.nf
beatrizsavinhas Jul 2, 2026
369f5c3
Add publish block.
beatrizsavinhas Jul 2, 2026
c7b4507
Fix bug in publish block.
beatrizsavinhas Jul 2, 2026
32162f2
Merge branch 'dev' into add-cascade
beatrizsavinhas Jul 2, 2026
be3090b
Merge add-cascade.
beatrizsavinhas Jul 2, 2026
cff68d5
Change NEXTFLOW_RUN module test to run nf-core/demo in stub.
beatrizsavinhas Jul 2, 2026
afd215a
Merge branch 'add-cascade' into add-oncoanalyser
beatrizsavinhas Jul 2, 2026
c21e966
Update test config name and description.
beatrizsavinhas Jul 2, 2026
05e9040
Update default test name.
beatrizsavinhas Jul 2, 2026
738c7c3
Update default test snapshot.
beatrizsavinhas Jul 2, 2026
7dbd938
Restore test.
beatrizsavinhas Jul 3, 2026
47f68d1
Update snapshot.
beatrizsavinhas Jul 3, 2026
aa51fbc
style: NEXTFLOW_RUN.
beatrizsavinhas Jul 3, 2026
c58cab1
Merge branch 'dev' into add-cascade
beatrizsavinhas Jul 3, 2026
fc4f3b1
Merge branch 'add-cascade' into add-oncoanalyser
beatrizsavinhas Jul 3, 2026
42d01eb
Update changelog.
beatrizsavinhas Jul 3, 2026
c7342c5
style: modules/local/nextflow/run/main.nf
beatrizsavinhas Jul 3, 2026
eaca0be
Update nftignore to also ignore `pipeline_info` files for all called …
beatrizsavinhas Jul 3, 2026
2d8c3db
Update default test to use ignore file.
beatrizsavinhas Jul 3, 2026
8679d89
Update snapshot.
beatrizsavinhas Jul 3, 2026
66eb6ff
Update changelog.
beatrizsavinhas Jul 3, 2026
d9b6e93
Update .nftignore to ignore pipeline_info, multiqc and vep files for …
beatrizsavinhas Jul 3, 2026
45ef5a4
Update default test to not capture `pipeline_info` files for run pipe…
beatrizsavinhas Jul 3, 2026
cc769a4
Update changelog.
beatrizsavinhas Jul 3, 2026
a3d94be
Update changelog.
beatrizsavinhas Jul 3, 2026
7152e7a
Add `Changed` header to changelog. Move relevant entries there.
beatrizsavinhas Jul 3, 2026
eb77d34
Update snapshot.
beatrizsavinhas Jul 3, 2026
8352e52
Merge branch 'add-cascade' into add-oncoanalyser
beatrizsavinhas Jul 3, 2026
db3cc04
Remove vep files from nftignore
beatrizsavinhas Jul 3, 2026
7244158
Update nftignore to ignore gzipped files from oncoanalyser.
beatrizsavinhas Jul 6, 2026
4b0c987
Update snapshot.
beatrizsavinhas Jul 6, 2026
df10611
Update changelog.
beatrizsavinhas Jul 6, 2026
09ccfb2
Update changelog.
beatrizsavinhas Jul 6, 2026
d4c0876
Ignore .command.log in tests
beatrizsavinhas Jul 6, 2026
898808d
Ignore all .command.* files in tests
beatrizsavinhas Jul 6, 2026
edb0d1f
Create oncoanalyser named parameters.
beatrizsavinhas Jul 6, 2026
8269760
Refiner nextflow_schema, organise input parameters and add info strin…
beatrizsavinhas Jul 6, 2026
6f21598
Update changelog.
beatrizsavinhas Jul 6, 2026
2479a3f
Remove commented out code.
beatrizsavinhas Jul 6, 2026
5c5c704
Style: refactor info strings.
beatrizsavinhas Jul 6, 2026
3941489
Add CREATE_ONCOREFINER_PARAMS_FILE local module.
beatrizsavinhas Jul 6, 2026
a6ef603
Change notation for take blocks to use .
beatrizsavinhas Jul 6, 2026
71b0ecf
Merge branch 'add-oncoanalyser' into add-create-oncorefiner-params-file
beatrizsavinhas Jul 6, 2026
4392a60
Add metadata parameters.
beatrizsavinhas Jul 6, 2026
a553d44
Publish oncorefiner params file.
beatrizsavinhas Jul 6, 2026
f712510
Fix bug with relative paths in params file.
beatrizsavinhas Jul 6, 2026
f2742ca
Update subject_id to match test data from oncoanalyser.
beatrizsavinhas Jul 6, 2026
6344ed8
Update module test and snapshot.
beatrizsavinhas Jul 6, 2026
589b6cc
Update default test snapshot.
beatrizsavinhas Jul 6, 2026
134607a
Rename oncoanalyser_config.
beatrizsavinhas Jul 6, 2026
b6d09f8
Update oncoanalyser_config description.
beatrizsavinhas Jul 6, 2026
e329f1a
Apply suggestion from @fellen31
beatrizsavinhas Jul 6, 2026
5ca66c9
Harshil alignment in oncoflow.nf
beatrizsavinhas Jul 6, 2026
f491a3f
Apply suggestion from @fellen31
beatrizsavinhas Jul 6, 2026
dd8490a
Harshil alignment in nextflow.config
beatrizsavinhas Jul 6, 2026
d5ff51d
Add pattern for oncoanalyser_params_file.
beatrizsavinhas Jul 6, 2026
f73a519
Simplify ignore statements in default test and nftignore. Update snap…
beatrizsavinhas Jul 6, 2026
8740f94
Update module test and snapshot.
beatrizsavinhas Jul 7, 2026
47ca313
Update changelog.
beatrizsavinhas Jul 7, 2026
266774f
Merge branch 'add-oncoanalyser' into add-create-oncorefiner-params-file
beatrizsavinhas Jul 7, 2026
a46f87d
Fix " in params file generation.
beatrizsavinhas Jul 7, 2026
955fb5f
Apply suggestions from code review
beatrizsavinhas Jul 7, 2026
ab378c5
Update test to replace "<output_directory>"
beatrizsavinhas Jul 7, 2026
59e6c78
Adjust default test to snapshot params file contente
beatrizsavinhas Jul 7, 2026
b465cb6
Remove ext.args from module.
beatrizsavinhas Jul 7, 2026
f9a9bb0
update variable names oncorefiner_params_file
beatrizsavinhas Jul 7, 2026
0ac04d6
Correct meta.yml
beatrizsavinhas Jul 7, 2026
6ca45a9
feat: Add `NFCORE_ONCOANALYSER` to main workflow (#3)
beatrizsavinhas Jul 7, 2026
d1ce895
Merge branch 'add-cascade' into add-create-oncorefiner-params-file
beatrizsavinhas Jul 7, 2026
43ca4cc
fix: Address review comments for `add-create-oncorefiner-params-file`…
beatrizsavinhas Jul 7, 2026
b5dc565
Fix bug with incorrect `snv_vcf_path` and `sv_vcf_path`.
beatrizsavinhas Jul 7, 2026
8cab2ce
Remove Additonal from info string.
beatrizsavinhas Jul 7, 2026
209a6c1
Correct order in changelog.
beatrizsavinhas Jul 7, 2026
4a1f2dc
Corrext changelog.
beatrizsavinhas Jul 7, 2026
a09f2d7
fix: `CREATE_ONCOREFINER_PARAMS_FILE` to add support for tumor only a…
beatrizsavinhas Jul 8, 2026
9346056
fix: `NFCORE_ONCOANALYSER` to run forked patched version of `oncoanal…
beatrizsavinhas Jul 9, 2026
8e30a7e
feat: Add `oncorefiner` (#4)
beatrizsavinhas Jul 9, 2026
64a6f65
Change to val_outdir.
beatrizsavinhas Jul 9, 2026
0499603
Add assets/test_oncoflow_params.yaml.
beatrizsavinhas Jul 9, 2026
066fda6
Add draft assets/test_oncoflow.config
beatrizsavinhas Jul 9, 2026
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
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,24 @@ Initial release of Clinical-Genomics/oncoflow, created with the [nf-core](https:

### `Added`

- [#2](https://github.com/Clinical-Genomics/oncoflow/pull/2) Added `NEXTFLOW_RUN` local module based on `mahesh-panchal/nf-cascade`.
- [#3](https://github.com/Clinical-Genomics/oncoflow/pull/3) Added `NFCORE_ONCOANALYSER` using the `NEXTFLOW_RUN` local module to run the `nf-core/oncoanalyser` pipeline in `ONCOFLOW` workflow.
- [#3](https://github.com/Clinical-Genomics/oncoflow/pull/3) Added input parameters for running `nf-core/oncoanalyser`: `oncoanalyser_config`, `oncoanalyser_nextflow_opts`, `oncoanalyser_params_file` and `oncoanalyser_samplesheet`.
- [#5](https://github.com/Clinical-Genomics/oncoflow/pull/5) Added `CREATE_ONCOREFINER_PARAMS_FILE` local module.
- [#5](https://github.com/Clinical-Genomics/oncoflow/pull/5) Added metadata parameters `case_id`, `sample_id_tumor`, `sample_id_normal`, `subject_id` and `sex`, necessary for creating the `oncoanalyser` params file using the `CREATE_ONCOREFINER_PARAMS_FILE` local module.
- [#5](https://github.com/Clinical-Genomics/oncoflow/pull/5) Added `CREATE_ONCOREFINER_PARAMS_FILE` module to `ONCOFLOW` workflow.
- [#4](https://github.com/Clinical-Genomics/oncoflow/pull/4) Added `CLINICAL_GENOMICS_ONCOREFINER` using the `NEXTFLOW_RUN` local module to run the `Clinical-Genomics/oncorefiner` pipeline in `ONCOFLOW` workflow.
- [#4](https://github.com/Clinical-Genomics/oncoflow/pull/4) Added input parameters for running `Clinical-Genomics/oncorefiner`: `oncorefiner_config` and `oncorefiner_nextflow_opts`.

### `Changed`

- [#3](https://github.com/Clinical-Genomics/oncoflow/pull/3) Changed default test to not capture `pipeline_info` files for all pipelines.
- [#3](https://github.com/Clinical-Genomics/oncoflow/pull/3) and [#4](https://github.com/Clinical-Genomics/oncoflow/pull/4) Updated `.nftignore` to ignore `pipeline_info`, `multiqc` and `vep` files for all pipelines.
- [#3](https://github.com/Clinical-Genomics/oncoflow/pull/3) Updated `.nftignore` to ignore gzipped output files from `oncoanalyser` due to https://github.com/nf-core/oncoanalyser/issues/299.
- [#3](https://github.com/Clinical-Genomics/oncoflow/pull/3) Updated `.nftignore` to ignore `*.command.*` output files from `oncoanalyser` since several files include the run directory and platform information which changes for each run and therefore cannot be snapshot.
- [#8](https://github.com/Clinical-Genomics/oncoflow/pull/8) Changed `NFCORE_ONCOANALYSER` to run forked fixed `Clinical-Genomics/oncoanalyser` instead, due to bug https://github.com/nf-core/oncoanalyser/issues/301.
- [#8](https://github.com/Clinical-Genomics/oncoflow/pull/8) Changed test config to run the above with revision `2.2.0-with-purple-tbi-fix` which includes the fix for https://github.com/nf-core/oncoanalyser/issues/301 and `nf-core/oncoanalyser` version 2.2.0 since this was the version used for previous test runs.

### `Fixed`

### `Dependencies`
Expand Down
93 changes: 93 additions & 0 deletions assets/test_oncoflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
//
// Oncoanalyser configuration
//

// TODO

//
// Oncorefiner configuration
//

// TODO
params {
// Parameters and options for tools
extra_args_cadd_annotate = '--columns Chrom,Pos,Ref,Alt,-,CADD'
extra_args_snv_clinical_filter = "--include '(INFO/GNOMADAF_grpmax <= 0.001 || INFO/GNOMADAF_grpmax == \".\")'"
extra_args_snv_research_filter = "--include '(INFO/GNOMADAF_grpmax <= 0.001 || INFO/GNOMADAF_grpmax == \".\")'"
extra_args_snv_vep = ''
extra_args_sv_vep = ''

// Pipeline resource files
// VEP
vep_cache_version = 115
vep_plugin_files = params.oncoflow_resources_dir + 'vep_plugin.csv'
vep_cache = params.oncoflow_resources_dir + 'VEP'

// Vcfanno
vcfanno_toml = params.oncoflow_resources_dir + 'grch38_vcfanno_config.toml'
vcfanno_resources = params.oncoflow_resources_dir + 'grch38_vcfanno_resources.txt'
vcfanno_lua = null

// SVDB
svdb_query_dbs = params.oncoflow_resources_dir + 'grch38_svdb_query_dbs.csv'

// Reference
fasta = params.oncoflow_resources_dir + 'GRCh38_masked_exclusions_alts_hlas.fasta'
fai = params.oncoflow_resources_dir + 'GRCh38_masked_exclusions_alts_hlas.fasta.fai'
}


process {

withName: '.*:GENERATE_CYTOSURE_FILES:VCF2CYTOSURE' {
errorStrategy = 'ignore'
}

withName:'.*PROCESS_SNVS:BCFTOOLS_VIEW_RESEARCH' {
ext.args = { [
"${params.extra_args_snv_research_filter}",
"--output-type z",
"--write-index=tbi",
].join(' ') }
}

withName: '.*PROCESS_SNVS:ENSEMBLVEP_VEP' {
maxForks = 8
memory = { 10.GB * task.attempt }
cpus = { 2 * task.attempt }
time = { 4.h * task.attempt }
}


withName: '.*PROCESS_SVS:ENSEMBLVEP_VEP' {
maxForks = 8
memory = { 10.GB * task.attempt }
cpus = { 2 * task.attempt }
time = { 4.h * task.attempt }
}

withName: '.*ANNOTATE_CADD:CADD' {
memory = { 30.GB * task.attempt }
cpus = { 1 * task.attempt }
time = { 1.h * task.attempt }
}

withName: '.*ANNOTATE_CADD:RENAME_CHR_CADD' {
memory = { 1.GB * task.attempt }
cpus = { 1 * task.attempt }
time = { 1.h * task.attempt }
}

withName: '.*ANNOTATE_CADD:ANNOTATE_INDELS' {
memory = { 1.GB * task.attempt }
cpus = { 1 * task.attempt }
time = { 1.h * task.attempt }
}

withName: '.*ANNOTATE_CADD:BCFTOOLS_VIEW' {
memory = { 1.GB * task.attempt }
cpus = { 1 * task.attempt }
time = { 1.h * task.attempt }
}

}
8 changes: 8 additions & 0 deletions assets/test_oncoflow_params.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
case_id: "test_case_id"
sample_id_tumor: "test_sample_id_tumor"
sample_id_normal: "test_sample_id_normal"
sex: "female"

oncoanalyser_create_stub_placeholders: true
oncoanalyser_genome: "GRCh38_hmf"
oncoanalyser_mode: "wgts"
20 changes: 14 additions & 6 deletions conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,19 @@ process {
}

params {
config_profile_name = 'Test profile'
config_profile_description = 'Minimal test dataset to check pipeline function'
config_profile_name = 'Test profile (stub runs for all pipelines)'
config_profile_description = 'Minimal test where all pipelines are run in stub mode to check that pipelines are run sequentially'

// Input data
// TODO nf-core: Specify the paths to your test data on nf-core/test-datasets
// TODO nf-core: Give any required params for the test so that command line flags are not needed
input = params.pipelines_testdata_base_path + 'viralrecon/samplesheet/samplesheet_test_illumina_amplicon.csv'
// Metadata
case_id = 'test_case_id'
sample_id_tumor = 'test_sample_id_tumor'
sample_id_normal = 'test_sample_id_normal'
subject_id = 'subject_a' // matches the subject_id in the sample sheet of the test data of the oncoanalyser pipeline
sex = 'female'

// Oncoanalyser input parameters
oncoanalyser_nextflow_opts = '-profile test_stub,docker -stub -revision 2.2.0-with-purple-tbi-fix'

// Oncorefiner input parameters
oncorefiner_nextflow_opts = '-profile test,docker -revision dev -stub'
}
32 changes: 32 additions & 0 deletions docs/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,38 @@

Pipeline cascade of nf-core/oncoanalyser + Clinical-Genomics/oncorefiner, written in Nextflow.

## Metadata



| Parameter | Description | Type | Default | Required | Hidden |
|-----------|-----------|-----------|-----------|-----------|-----------|
| `case_id` | Case ID. | `string` | | True | |
| `sample_id_tumor` | Sample id of the tumor sample. | `string` | | True | |
| `sample_id_normal` | Sample id of the normal sample. | `string` | | True | |
| `subject_id` | Subject ID of the patient. | `string` | | True | |
| `sex` | Sex of the patient. (accepted: `female`\|`male`\|`unknown`) | `string` | | True | |

## Oncoanalyser

Input files and nextflow options for running nf-core/oncoanlyser.

| Parameter | Description | Type | Default | Required | Hidden |
|-----------|-----------|-----------|-----------|-----------|-----------|
| `oncoanalyser_config` | Path to config file for nf-core/oncoanlyser (optional). | `string` | | | |
| `oncoanalyser_nextflow_opts` | Nextflow options for running nf-core/oncoanlyser. | `string` | | True | |
| `oncoanalyser_params_file` | Path to params file for nf-core/oncoanlyser. | `string` | | | |
| `oncoanalyser_samplesheet` | Path to csv samplesheet file for nf-core/oncoanalyser. | `string` | | | |

## Oncorefiner

Input files and nextflow options for running Clinical-Genomics/oncorefiner.

| Parameter | Description | Type | Default | Required | Hidden |
|-----------|-----------|-----------|-----------|-----------|-----------|
| `oncorefiner_config` | Path to config file for Clinical-Genomics/oncorefiner (optional). | `string` | | | |
| `oncorefiner_nextflow_opts` | Nextflow options for running Clinical-Genomics/oncorefiner. | `string` | | True | |

## Input/output options

Define where the pipeline should find input data and save output data.
Expand Down
62 changes: 58 additions & 4 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
IMPORT FUNCTIONS / MODULES / SUBWORKFLOWS / WORKFLOWS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

include { ONCOFLOW } from './workflows/oncoflow'
include { ONCOFLOW } from './workflows/oncoflow'
include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_nfcore_oncoflow_pipeline'
include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_oncoflow_pipeline'
/*
Expand All @@ -28,16 +27,43 @@ include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_onco
workflow CLINICALGENOMICS_ONCOFLOW {

take:
outdir // string: The output directory where the results will be saved
val_case_id // string: [mandatory] Case ID
val_oncoanalyser_config // string: [optional] Config file for oncoanalyser pipeline
val_oncoanalyser_nextflow_opts // string: [mandatory] Nextflow options for oncoanalyser pipeline
val_oncoanalyser_params_file // string: [mandatory] Parameters file for oncoanalyser pipeline
val_oncoanalyser_samplesheet // string: [mandatory] Samplesheet file for oncoanalyser pipeline
val_oncorefiner_config // string: [optional] Config file for oncorefiner pipeline
val_oncorefiner_nextflow_opts // string: [mandatory] Nextflow options for oncorefiner pipeline
val_outdir // string: [mandatory] The output directory where the results will be saved
val_sample_id_tumor // string: [mandatory] Sample ID of the tumor sample
val_sample_id_normal // string: [mandatory] Sample ID of the normal sample
val_subject_id // string: [mandatory] Subject ID
val_sex // string: [mandatory] Sex of the patient

main:

//
// WORKFLOW: Run pipeline
//
ONCOFLOW (
outdir,
val_case_id,
val_oncoanalyser_config,
val_oncoanalyser_nextflow_opts,
val_oncoanalyser_params_file,
val_oncoanalyser_samplesheet,
val_oncorefiner_config,
val_oncorefiner_nextflow_opts,
val_sample_id_tumor,
val_sample_id_normal,
val_subject_id,
val_sex,
val_outdir
)

emit:
oncoanalyser_output = ONCOFLOW.out.oncoanalyser_output // channel: [path(analysis_output_directory)]
oncorefiner_output = ONCOFLOW.out.oncorefiner_output // channel: [path(analysis_output_directory)]
oncorefiner_params_file = ONCOFLOW.out.oncorefiner_params_file // channel: [path(yaml)]
}
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -66,6 +92,17 @@ workflow {
// WORKFLOW: Run main workflow
//
CLINICALGENOMICS_ONCOFLOW (
params.case_id,
params.oncoanalyser_config,
params.oncoanalyser_nextflow_opts,
params.oncoanalyser_params_file,
params.oncoanalyser_samplesheet,
params.oncorefiner_config,
params.oncorefiner_nextflow_opts,
params.sample_id_tumor,
params.sample_id_normal,
params.subject_id,
params.sex,
params.outdir
)

Expand All @@ -79,6 +116,23 @@ workflow {
params.outdir,
params.monochrome_logs,
)

publish:
oncoanalyser_output = CLINICALGENOMICS_ONCOFLOW.out.oncoanalyser_output
oncorefiner_output = CLINICALGENOMICS_ONCOFLOW.out.oncorefiner_output
oncorefiner_params_file = CLINICALGENOMICS_ONCOFLOW.out.oncorefiner_params_file
}

output {
oncoanalyser_output {
path "oncoanalyser"
}
oncorefiner_output {
path "oncorefiner"
}
oncorefiner_params_file {
path "oncorefiner"
}
}

/*
Expand Down
55 changes: 55 additions & 0 deletions modules/local/createoncorefinerparamsfile/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
process CREATE_ONCOREFINER_PARAMS_FILE {
tag 'oncorefiner'
label 'process_single'

input:
val case_id
val subject_id
val sample_id_tumor
val sample_id_normal
val sex
path oncoanalyser_results_dir
val outdir

output:

path "oncorefiner_params.yaml", emit: params_file
// WARN: Please update version string when the module is updated.
tuple val("${task.process}"), val('createoncorefinerparamsfile'), val('1.0'), topic: versions, emit: versions_createoncorefinerparamsfile

when:
task.ext.when == null || task.ext.when

script:
def oncoanalyser_output_dir = file(outdir).resolve("oncoanalyser/${oncoanalyser_results_dir}")

def snv_vcf_path = oncoanalyser_output_dir.resolve("${subject_id}/purple/${subject_id}.tumor.purple.somatic.vcf.gz")
def sv_vcf_path = oncoanalyser_output_dir.resolve("${subject_id}/purple/${subject_id}.tumor.purple.sv.vcf.gz")
def bam_tumor_path = oncoanalyser_output_dir.resolve("${subject_id}/alignments/dna/${subject_id}.tumor.redux.bam")
def bai_tumor_path = oncoanalyser_output_dir.resolve("${subject_id}/alignments/dna/${subject_id}.tumor.redux.bam.bai")
def bam_normal_path = sample_id_normal ? oncoanalyser_output_dir.resolve("${subject_id}/alignments/dna/${subject_id}.normal.redux.bam") : ''
def bai_normal_path = sample_id_normal ? oncoanalyser_output_dir.resolve("${subject_id}/alignments/dna/${subject_id}.normal.redux.bam.bai") : ''

def oncorefiner_params_file =
[
"case_id: ${case_id}",
"sample_id_tumor: ${sample_id_tumor}",
"sample_id_normal: ${sample_id_normal}",
"sex: ${sex}",
"snv_vcf: ${snv_vcf_path}",
"sv_vcf: ${sv_vcf_path}",
"bam_tumor: ${bam_tumor_path}",
"bai_tumor: ${bai_tumor_path}",
"bam_normal: ${bam_normal_path}",
"bai_normal: ${bai_normal_path}"
].join("\\n")

"""
printf "$oncorefiner_params_file" > oncorefiner_params.yaml
"""

stub:
"""
touch oncorefiner_params.yaml
"""
}
Loading
Loading