diff --git a/modules/nf-core/goleft/indexcov/environment.yml b/modules/nf-core/goleft/indexcov/environment.yml index b5799272031..691377901c8 100644 --- a/modules/nf-core/goleft/indexcov/environment.yml +++ b/modules/nf-core/goleft/indexcov/environment.yml @@ -5,3 +5,4 @@ channels: - defaults dependencies: - bioconda::goleft=0.2.4 + - bioconda::htslib=1.12 diff --git a/modules/nf-core/goleft/indexcov/main.nf b/modules/nf-core/goleft/indexcov/main.nf index c01ec657122..5d0ed5dfb01 100644 --- a/modules/nf-core/goleft/indexcov/main.nf +++ b/modules/nf-core/goleft/indexcov/main.nf @@ -12,13 +12,14 @@ process GOLEFT_INDEXCOV { tuple val(meta2), path(fai) output: - tuple val(meta), path("${prefix}/*") , emit: output - tuple val(meta), path("${prefix}/*ped") , emit: ped , optional: true - tuple val(meta), path("${prefix}/*bed.gz"), emit: bed , optional: true - tuple val(meta), path("${prefix}/*roc") , emit: roc , optional: true - tuple val(meta), path("${prefix}/*html") , emit: html, optional: true - tuple val(meta), path("${prefix}/*png") , emit: png , optional: true - path "versions.yml" , emit: versions + tuple val(meta), path("${prefix}/*") , emit: output + tuple val(meta), path("${prefix}/*ped") , emit: ped , optional: true + tuple val(meta), path("${prefix}/*bed.gz") , emit: bed , optional: true + tuple val(meta), path("${prefix}/*bed.gz.tbi"), emit: bed_index , optional: true + tuple val(meta), path("${prefix}/*roc") , emit: roc , optional: true + tuple val(meta), path("${prefix}/*html") , emit: html, optional: true + tuple val(meta), path("${prefix}/*png") , emit: png , optional: true + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -37,9 +38,14 @@ process GOLEFT_INDEXCOV { $args \\ ${input_files.join(" ")} + if [ -f "${prefix}/${prefix}-indexcov.bed.gz" ] ; then + tabix -p bed "${prefix}/${prefix}-indexcov.bed.gz" + fi + cat <<-END_VERSIONS > versions.yml "${task.process}": goleft: \$(goleft --version 2>&1 | head -n 1 | sed 's/^.*goleft Version: //') + tabix: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//') END_VERSIONS """ stub: @@ -47,11 +53,13 @@ process GOLEFT_INDEXCOV { prefix = task.ext.prefix ?: "${meta.id}" """ mkdir "${prefix}" - touch "${prefix}/${prefix}-indexcov.bed.gz" + echo "" | gzip > "${prefix}/${prefix}-indexcov.bed.gz" + touch "${prefix}/${prefix}-indexcov.bed.gz.tbi" cat <<-END_VERSIONS > versions.yml "${task.process}": goleft: \$(goleft --version 2>&1 | head -n 1 | sed 's/^.*goleft Version: //') + tabix: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/nf-core/goleft/indexcov/tests/main.nf.test b/modules/nf-core/goleft/indexcov/tests/main.nf.test index eb458a52b7d..1296c644cd2 100644 --- a/modules/nf-core/goleft/indexcov/tests/main.nf.test +++ b/modules/nf-core/goleft/indexcov/tests/main.nf.test @@ -18,11 +18,11 @@ nextflow_process { [ id:'test' ], // meta map [ file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_end.sorted.bam", checkIfExists: true), - file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam", checkIfExists: true) + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam", checkIfExists: true) ], [ file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_end.sorted.bam.bai", checkIfExists: true), - file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai", checkIfExists: true) + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai", checkIfExists: true) ], ]) @@ -39,7 +39,15 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out.ped, + process.out.bed, + file(process.out.bed_index[0][1]).name, + process.out.roc, + process.out.html, + process.out.png, + process.out.versions + ).match() } ) } @@ -76,7 +84,15 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out.ped, + process.out.bed, + file(process.out.bed_index[0][1]).name, + process.out.roc, + process.out.html, + process.out.png, + process.out.versions + ).match() } ) } @@ -105,7 +121,8 @@ nextflow_process { then { assertAll( - { assert process.success } + { assert process.success }, + { assert snapshot(process.out).match() } ) } diff --git a/modules/nf-core/goleft/indexcov/tests/main.nf.test.snap b/modules/nf-core/goleft/indexcov/tests/main.nf.test.snap index 2ef54ab6b15..1c79232db0d 100644 --- a/modules/nf-core/goleft/indexcov/tests/main.nf.test.snap +++ b/modules/nf-core/goleft/indexcov/tests/main.nf.test.snap @@ -1,223 +1,65 @@ { "sarscov2 - crai": { "content": [ - { - "0": [ - [ - { - "id": "test" - }, - [ - "index.html:md5,41840ede180b20cdf6074c431269929e", - "test-indexcov-depth-chr21.html:md5,4c839b03f2f41e3fdca5642903c35008", - "test-indexcov-depth-chr21.png:md5,1999b0bf1cd0680f6d107d438e7257cf", - "test-indexcov-roc-chr21.html:md5,f84b547328a23196f16f71d093eb7450", - "test-indexcov-roc-chr21.png:md5,41f1460535b255fff053da59fcccf698", - "test-indexcov.bed.gz:md5,04aa3637cffca5d99316df7741c06589", - "test-indexcov.ped:md5,8737714b6ea160e06d5282391f89f791", - "test-indexcov.roc:md5,548b76fdf16e97768b0c9b8ecbfd5bef" - ] - ] - ], - "1": [ - [ - { - "id": "test" - }, - "test-indexcov.ped:md5,8737714b6ea160e06d5282391f89f791" - ] - ], - "2": [ - [ - { - "id": "test" - }, - "test-indexcov.bed.gz:md5,04aa3637cffca5d99316df7741c06589" - ] - ], - "3": [ - [ - { - "id": "test" - }, - "test-indexcov.roc:md5,548b76fdf16e97768b0c9b8ecbfd5bef" - ] - ], - "4": [ - [ - { - "id": "test" - }, - [ - "index.html:md5,41840ede180b20cdf6074c431269929e", - "test-indexcov-depth-chr21.html:md5,4c839b03f2f41e3fdca5642903c35008", - "test-indexcov-roc-chr21.html:md5,f84b547328a23196f16f71d093eb7450" - ] - ] - ], - "5": [ - [ - { - "id": "test" - }, - [ - "test-indexcov-depth-chr21.png:md5,1999b0bf1cd0680f6d107d438e7257cf", - "test-indexcov-roc-chr21.png:md5,41f1460535b255fff053da59fcccf698" - ] - ] - ], - "6": [ - "versions.yml:md5,97bf6a6d60aca3de3773d8a0fbf053a1" - ], - "bed": [ - [ - { - "id": "test" - }, - "test-indexcov.bed.gz:md5,04aa3637cffca5d99316df7741c06589" - ] - ], - "html": [ - [ - { - "id": "test" - }, - [ - "index.html:md5,41840ede180b20cdf6074c431269929e", - "test-indexcov-depth-chr21.html:md5,4c839b03f2f41e3fdca5642903c35008", - "test-indexcov-roc-chr21.html:md5,f84b547328a23196f16f71d093eb7450" - ] - ] - ], - "output": [ - [ - { - "id": "test" - }, - [ - "index.html:md5,41840ede180b20cdf6074c431269929e", - "test-indexcov-depth-chr21.html:md5,4c839b03f2f41e3fdca5642903c35008", - "test-indexcov-depth-chr21.png:md5,1999b0bf1cd0680f6d107d438e7257cf", - "test-indexcov-roc-chr21.html:md5,f84b547328a23196f16f71d093eb7450", - "test-indexcov-roc-chr21.png:md5,41f1460535b255fff053da59fcccf698", - "test-indexcov.bed.gz:md5,04aa3637cffca5d99316df7741c06589", - "test-indexcov.ped:md5,8737714b6ea160e06d5282391f89f791", - "test-indexcov.roc:md5,548b76fdf16e97768b0c9b8ecbfd5bef" - ] - ] - ], - "ped": [ - [ - { - "id": "test" - }, - "test-indexcov.ped:md5,8737714b6ea160e06d5282391f89f791" - ] - ], - "png": [ - [ - { - "id": "test" - }, - [ - "test-indexcov-depth-chr21.png:md5,1999b0bf1cd0680f6d107d438e7257cf", - "test-indexcov-roc-chr21.png:md5,41f1460535b255fff053da59fcccf698" - ] - ] - ], - "roc": [ - [ - { - "id": "test" - }, - "test-indexcov.roc:md5,548b76fdf16e97768b0c9b8ecbfd5bef" - ] - ], - "versions": [ - "versions.yml:md5,97bf6a6d60aca3de3773d8a0fbf053a1" + [ + [ + { + "id": "test" + }, + "test-indexcov.ped:md5,8737714b6ea160e06d5282391f89f791" ] - } - ], - "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.2" - }, - "timestamp": "2024-08-02T17:12:40.654571" - }, - "sarscov2 - stub": { - "content": [ - { - "0": [ - [ - { - "id": "test" - }, - "/Users/adam.talbot/modules/.nf-test/tests/b176772886dc6c01086acecdcebb9167/work/bf/334844199c0739497d80a21d7e4743/test/test-indexcov.bed.gz" - ] - ], - "1": [ - - ], - "2": [ - [ - { - "id": "test" - }, - "/Users/adam.talbot/modules/.nf-test/tests/b176772886dc6c01086acecdcebb9167/work/bf/334844199c0739497d80a21d7e4743/test/test-indexcov.bed.gz" - ] - ], - "3": [ - - ], - "4": [ - - ], - "5": [ - - ], - "6": [ - "versions.yml:md5,97bf6a6d60aca3de3773d8a0fbf053a1" - ], - "bed": [ + ], + [ + [ + { + "id": "test" + }, + "test-indexcov.bed.gz:md5,04aa3637cffca5d99316df7741c06589" + ] + ], + "test-indexcov.bed.gz.tbi", + [ + [ + { + "id": "test" + }, + "test-indexcov.roc:md5,548b76fdf16e97768b0c9b8ecbfd5bef" + ] + ], + [ + [ + { + "id": "test" + }, [ - { - "id": "test" - }, - "/Users/adam.talbot/modules/.nf-test/tests/b176772886dc6c01086acecdcebb9167/work/bf/334844199c0739497d80a21d7e4743/test/test-indexcov.bed.gz" + "index.html:md5,41840ede180b20cdf6074c431269929e", + "test-indexcov-depth-chr21.html:md5,4c839b03f2f41e3fdca5642903c35008", + "test-indexcov-roc-chr21.html:md5,f84b547328a23196f16f71d093eb7450" ] - ], - "html": [ - - ], - "output": [ + ] + ], + [ + [ + { + "id": "test" + }, [ - { - "id": "test" - }, - "/Users/adam.talbot/modules/.nf-test/tests/b176772886dc6c01086acecdcebb9167/work/bf/334844199c0739497d80a21d7e4743/test/test-indexcov.bed.gz" + "test-indexcov-depth-chr21.png:md5,1999b0bf1cd0680f6d107d438e7257cf", + "test-indexcov-roc-chr21.png:md5,41f1460535b255fff053da59fcccf698" ] - ], - "ped": [ - - ], - "png": [ - - ], - "roc": [ - - ], - "versions": [ - "versions.yml:md5,97bf6a6d60aca3de3773d8a0fbf053a1" ] - } + ], + [ + "versions.yml:md5,f9c06c1c05a2a31854b4e04e449a24c5" + ] ], "meta": { "nf-test": "0.9.0", - "nextflow": "24.04.2" + "nextflow": "24.04.4" }, - "timestamp": "2024-08-02T17:16:50.485859" + "timestamp": "2024-08-22T06:40:17.142801459" }, - "sarscov2 - bam": { + "sarscov2 - stub": { "content": [ { "0": [ @@ -226,27 +68,20 @@ "id": "test" }, [ - "index.html:md5,d1cc28023cd827446e0f9c905c94fe3e", - "test-indexcov.bed.gz:md5,eab7a78287e261d600c06def12a33029", - "test-indexcov.ped:md5,da2bd9882474d2f00f8ad2ab20b140c9", - "test-indexcov.roc:md5,3f460308bb86203d1ada71b7c84d995d" + "test-indexcov.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test-indexcov.bed.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" ] ] ], "1": [ - [ - { - "id": "test" - }, - "test-indexcov.ped:md5,da2bd9882474d2f00f8ad2ab20b140c9" - ] + ], "2": [ [ { "id": "test" }, - "test-indexcov.bed.gz:md5,eab7a78287e261d600c06def12a33029" + "test-indexcov.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" ] ], "3": [ @@ -254,38 +89,39 @@ { "id": "test" }, - "test-indexcov.roc:md5,3f460308bb86203d1ada71b7c84d995d" + "test-indexcov.bed.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "4": [ - [ - { - "id": "test" - }, - "index.html:md5,d1cc28023cd827446e0f9c905c94fe3e" - ] + ], "5": [ ], "6": [ - "versions.yml:md5,97bf6a6d60aca3de3773d8a0fbf053a1" + + ], + "7": [ + "versions.yml:md5,f9c06c1c05a2a31854b4e04e449a24c5" ], "bed": [ [ { "id": "test" }, - "test-indexcov.bed.gz:md5,eab7a78287e261d600c06def12a33029" + "test-indexcov.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" ] ], - "html": [ + "bed_index": [ [ { "id": "test" }, - "index.html:md5,d1cc28023cd827446e0f9c905c94fe3e" + "test-indexcov.bed.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" ] + ], + "html": [ + ], "output": [ [ @@ -293,41 +129,77 @@ "id": "test" }, [ - "index.html:md5,d1cc28023cd827446e0f9c905c94fe3e", - "test-indexcov.bed.gz:md5,eab7a78287e261d600c06def12a33029", - "test-indexcov.ped:md5,da2bd9882474d2f00f8ad2ab20b140c9", - "test-indexcov.roc:md5,3f460308bb86203d1ada71b7c84d995d" + "test-indexcov.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test-indexcov.bed.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" ] ] ], "ped": [ - [ - { - "id": "test" - }, - "test-indexcov.ped:md5,da2bd9882474d2f00f8ad2ab20b140c9" - ] + ], "png": [ ], "roc": [ - [ - { - "id": "test" - }, - "test-indexcov.roc:md5,3f460308bb86203d1ada71b7c84d995d" - ] + ], "versions": [ - "versions.yml:md5,97bf6a6d60aca3de3773d8a0fbf053a1" + "versions.yml:md5,f9c06c1c05a2a31854b4e04e449a24c5" ] } ], "meta": { "nf-test": "0.9.0", - "nextflow": "24.04.2" + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-22T06:44:59.203730744" + }, + "sarscov2 - bam": { + "content": [ + [ + [ + { + "id": "test" + }, + "test-indexcov.ped:md5,da2bd9882474d2f00f8ad2ab20b140c9" + ] + ], + [ + [ + { + "id": "test" + }, + "test-indexcov.bed.gz:md5,eab7a78287e261d600c06def12a33029" + ] + ], + "test-indexcov.bed.gz.tbi", + [ + [ + { + "id": "test" + }, + "test-indexcov.roc:md5,3f460308bb86203d1ada71b7c84d995d" + ] + ], + [ + [ + { + "id": "test" + }, + "index.html:md5,d1cc28023cd827446e0f9c905c94fe3e" + ] + ], + [ + + ], + [ + "versions.yml:md5,f9c06c1c05a2a31854b4e04e449a24c5" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-08-02T16:52:31.400233" + "timestamp": "2024-08-22T06:39:48.470187823" } } \ No newline at end of file