From 67c1bc9568cfc40cf7038c7be13b976fe76d76a1 Mon Sep 17 00:00:00 2001 From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com> Date: Fri, 1 Apr 2022 17:35:15 +0200 Subject: [PATCH] Add stubs to cnvpytor module (#1473) * callcnvs stub and tests * partition stub and test * histogram stub and test * importreaddepth stub and tests * update module scripts Co-authored-by: Sima Rahimi --- modules/cnvpytor/callcnvs/main.nf | 11 ++++++ modules/cnvpytor/histogram/main.nf | 10 +++++ modules/cnvpytor/importreaddepth/main.nf | 11 ++++++ modules/cnvpytor/partition/main.nf | 12 +++++- tests/modules/cnvpytor/callcnvs/test.yml | 14 ++++++- tests/modules/cnvpytor/histogram/test.yml | 12 +++++- .../cnvpytor/importreaddepth/nextflow.config | 2 +- .../modules/cnvpytor/importreaddepth/test.yml | 39 +++++++++++++++++++ tests/modules/cnvpytor/partition/test.yml | 12 +++++- 9 files changed, 117 insertions(+), 6 deletions(-) create mode 100644 tests/modules/cnvpytor/importreaddepth/test.yml diff --git a/modules/cnvpytor/callcnvs/main.nf b/modules/cnvpytor/callcnvs/main.nf index e296656b..17675cde 100644 --- a/modules/cnvpytor/callcnvs/main.nf +++ b/modules/cnvpytor/callcnvs/main.nf @@ -30,4 +30,15 @@ process CNVPYTOR_CALLCNVS { cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/^.*pyCNVnator //; s/Using.*\$//' )) END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/^.*pyCNVnator //; s/Using.*\$//' )) + END_VERSIONS + """ } diff --git a/modules/cnvpytor/histogram/main.nf b/modules/cnvpytor/histogram/main.nf index e421f1b2..d1c6856c 100644 --- a/modules/cnvpytor/histogram/main.nf +++ b/modules/cnvpytor/histogram/main.nf @@ -29,4 +29,14 @@ process CNVPYTOR_HISTOGRAM { cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/^.*pyCNVnator //; s/Using.*\$//' )) END_VERSIONS """ + + stub: + """ + touch test.pytor + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/^.*pyCNVnator //; s/Using.*\$//' )) + END_VERSIONS + """ } diff --git a/modules/cnvpytor/importreaddepth/main.nf b/modules/cnvpytor/importreaddepth/main.nf index 1b037629..162da719 100644 --- a/modules/cnvpytor/importreaddepth/main.nf +++ b/modules/cnvpytor/importreaddepth/main.nf @@ -35,4 +35,15 @@ process CNVPYTOR_IMPORTREADDEPTH { cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/^.*pyCNVnator //; s/Using.*\$//' )) END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.pytor + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/^.*pyCNVnator //; s/Using.*\$//' )) + END_VERSIONS + """ } diff --git a/modules/cnvpytor/partition/main.nf b/modules/cnvpytor/partition/main.nf index 74ab4026..975458bf 100644 --- a/modules/cnvpytor/partition/main.nf +++ b/modules/cnvpytor/partition/main.nf @@ -18,7 +18,7 @@ process CNVPYTOR_PARTITION { task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '1000' + def args = task.ext.args ?: '' """ cnvpytor \\ -root $pytor \\ @@ -29,4 +29,14 @@ process CNVPYTOR_PARTITION { cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/^.*pyCNVnator //; s/Using.*\$//' )) END_VERSIONS """ + + stub: + """ + touch test.pytor + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/^.*pyCNVnator //; s/Using.*\$//' )) + END_VERSIONS + """ } diff --git a/tests/modules/cnvpytor/callcnvs/test.yml b/tests/modules/cnvpytor/callcnvs/test.yml index 85bfcc7a..4565151e 100644 --- a/tests/modules/cnvpytor/callcnvs/test.yml +++ b/tests/modules/cnvpytor/callcnvs/test.yml @@ -4,7 +4,17 @@ - cnvpytor - cnvpytor/callcnvs files: - - path: output/cnvpytor/calls.10000.tsv + - path: output/cnvpytor/test.tsv md5sum: d41d8cd98f00b204e9800998ecf8427e - path: output/cnvpytor/versions.yml - md5sum: 5fe6ca3ef5c40f9dbf487f28db237821 + md5sum: 0bea08a253fcb2ff0ff79b99df77b9fa + +- name: cnvpytor callcnvs test_cnvpytor_callcnvs stub + command: nextflow run tests/modules/cnvpytor/callcnvs -entry test_cnvpytor_callcnvs -c tests/config/nextflow.config -stub-run + tags: + - cnvpytor + - cnvpytor/callcnvs + files: + - path: output/cnvpytor/test.tsv + - path: output/cnvpytor/versions.yml + md5sum: 0bea08a253fcb2ff0ff79b99df77b9fa diff --git a/tests/modules/cnvpytor/histogram/test.yml b/tests/modules/cnvpytor/histogram/test.yml index fd8bcaf4..0543fcc3 100644 --- a/tests/modules/cnvpytor/histogram/test.yml +++ b/tests/modules/cnvpytor/histogram/test.yml @@ -7,4 +7,14 @@ - path: output/cnvpytor/test.pytor md5sum: aa03a8fa15b39f77816705a48e10312a - path: output/cnvpytor/versions.yml - md5sum: 9a4b176afd5f1a3edeb37eeb301cf464 + md5sum: 0f4d75c4f3a3eb26c22616d12b0b78b2 + +- name: cnvpytor histogram test_cnvpytor_histogram stub + command: nextflow run tests/modules/cnvpytor/histogram -entry test_cnvpytor_histogram -c tests/config/nextflow.config -stub-run + tags: + - cnvpytor + - cnvpytor/histogram + files: + - path: output/cnvpytor/test.pytor + - path: output/cnvpytor/versions.yml + md5sum: 0f4d75c4f3a3eb26c22616d12b0b78b2 diff --git a/tests/modules/cnvpytor/importreaddepth/nextflow.config b/tests/modules/cnvpytor/importreaddepth/nextflow.config index c60f979e..4383e375 100644 --- a/tests/modules/cnvpytor/importreaddepth/nextflow.config +++ b/tests/modules/cnvpytor/importreaddepth/nextflow.config @@ -8,5 +8,5 @@ process { } params { - cnvpytor_chr = '' // specifies chromosome name(s) the same way as they are described in the sam/bam/cram header e.g. '1 2' or 'chr1 chr2'. + cnvpytor_chr = null // specifies chromosome name(s) the same way as they are described in the sam/bam/cram header e.g. '1 2' or 'chr1 chr2'. } diff --git a/tests/modules/cnvpytor/importreaddepth/test.yml b/tests/modules/cnvpytor/importreaddepth/test.yml new file mode 100644 index 00000000..b148c38e --- /dev/null +++ b/tests/modules/cnvpytor/importreaddepth/test.yml @@ -0,0 +1,39 @@ +- name: cnvpytor importreaddepth test_cnvpytor_importreaddepth + command: nextflow run tests/modules/cnvpytor/importreaddepth -entry test_cnvpytor_importreaddepth -c tests/config/nextflow.config + tags: + - cnvpytor + - cnvpytor/importreaddepth + files: + - path: output/cnvpytor/test.pytor + - path: output/cnvpytor/versions.yml + md5sum: 5834495324c08a37f3fd73ccdd881dc8 + +- name: cnvpytor importreaddepth test_cnvpytor_importreaddepth stub + command: nextflow run tests/modules/cnvpytor/importreaddepth -entry test_cnvpytor_importreaddepth -c tests/config/nextflow.config -stub-run + tags: + - cnvpytor + - cnvpytor/importreaddepth + files: + - path: output/cnvpytor/test.pytor + - path: output/cnvpytor/versions.yml + md5sum: 5834495324c08a37f3fd73ccdd881dc8 + +- name: cnvpytor importreaddepth test_cnvpytor_importreaddepth_cram + command: nextflow run tests/modules/cnvpytor/importreaddepth -entry test_cnvpytor_importreaddepth_cram -c tests/config/nextflow.config + tags: + - cnvpytor + - cnvpytor/importreaddepth + files: + - path: output/cnvpytor/test.pytor + - path: output/cnvpytor/versions.yml + md5sum: dfa0afb0982d985b96d1633f71ebb82a + +- name: cnvpytor importreaddepth test_cnvpytor_importreaddepth_cram stub + command: nextflow run tests/modules/cnvpytor/importreaddepth -entry test_cnvpytor_importreaddepth_cram -c tests/config/nextflow.config -stub-run + tags: + - cnvpytor + - cnvpytor/importreaddepth + files: + - path: output/cnvpytor/test.pytor + - path: output/cnvpytor/versions.yml + md5sum: dfa0afb0982d985b96d1633f71ebb82a diff --git a/tests/modules/cnvpytor/partition/test.yml b/tests/modules/cnvpytor/partition/test.yml index 1b838395..10232097 100644 --- a/tests/modules/cnvpytor/partition/test.yml +++ b/tests/modules/cnvpytor/partition/test.yml @@ -7,4 +7,14 @@ - path: output/cnvpytor/test.pytor md5sum: aa03a8fa15b39f77816705a48e10312a - path: output/cnvpytor/versions.yml - md5sum: 8a04506554c58cd170cc050fd9904c6f + md5sum: 7fd6ec952a316463bcd324f176b46b64 + +- name: cnvpytor partition test_cnvpytor_partition stub + command: nextflow run tests/modules/cnvpytor/partition -entry test_cnvpytor_partition -c tests/config/nextflow.config -stub-run + tags: + - cnvpytor + - cnvpytor/partition + files: + - path: output/cnvpytor/test.pytor + - path: output/cnvpytor/versions.yml + md5sum: 7fd6ec952a316463bcd324f176b46b64