diff --git a/assets/schema_input.json b/assets/schema_input.json index 2c1a025..c5fd52a 100644 --- a/assets/schema_input.json +++ b/assets/schema_input.json @@ -10,6 +10,7 @@ "sample": { "type": "string", "pattern": "^\\S+$", + "meta": ["id"], "errorMessage": "Sample name must be provided and cannot contain spaces" }, "bam": { diff --git a/modules.json b/modules.json index 29e931c..4b01925 100644 --- a/modules.json +++ b/modules.json @@ -7,7 +7,7 @@ "nf-core": { "cnvkit/batch": { "branch": "master", - "git_sha": "603ecbd9f45300c9788f197d2a15a005685b4220", + "git_sha": "016397249f05f5af7b97e3ea8d64458a07df2928", "installed_by": ["modules"] }, "custom/dumpsoftwareversions": { diff --git a/modules/nf-core/cnvkit/batch/main.nf b/modules/nf-core/cnvkit/batch/main.nf index 1e4d81e..795053a 100644 --- a/modules/nf-core/cnvkit/batch/main.nf +++ b/modules/nf-core/cnvkit/batch/main.nf @@ -2,17 +2,17 @@ process CNVKIT_BATCH { tag "$meta.id" label 'process_low' - conda "bioconda::cnvkit=0.9.9 bioconda::samtools=1.16.1" + conda "bioconda::cnvkit=0.9.10 bioconda::samtools=1.17" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-780d630a9bb6a0ff2e7b6f730906fd703e40e98f:3bdd798e4b9aed6d3e1aaa1596c913a3eeb865cb-0' : - 'biocontainers/mulled-v2-780d630a9bb6a0ff2e7b6f730906fd703e40e98f:3bdd798e4b9aed6d3e1aaa1596c913a3eeb865cb-0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-780d630a9bb6a0ff2e7b6f730906fd703e40e98f:c94363856059151a2974dc501fb07a0360cc60a3-0' : + 'biocontainers/mulled-v2-780d630a9bb6a0ff2e7b6f730906fd703e40e98f:c94363856059151a2974dc501fb07a0360cc60a3-0' }" input: tuple val(meta), path(tumor), path(normal) - path fasta - path fasta_fai - path targets - path reference + tuple val(meta2), path(fasta) + tuple val(meta3), path(fasta_fai) + tuple val(meta4), path(targets) + tuple val(meta5), path(reference) val panel_of_normals output: diff --git a/modules/nf-core/cnvkit/batch/meta.yml b/modules/nf-core/cnvkit/batch/meta.yml index 3fc00f1..1543304 100644 --- a/modules/nf-core/cnvkit/batch/meta.yml +++ b/modules/nf-core/cnvkit/batch/meta.yml @@ -26,22 +26,43 @@ input: type: file description: | Input normal sample bam file (or cram) + - meta2: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test' ] - fasta: type: file description: | Input reference genome fasta file (only needed for cram_input and/or when normal_samples are provided) + - meta3: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test' ] - fasta_fai: type: file description: | Input reference genome fasta index (optional, but recommended for cram_input) + - meta4: + type: map + description: | + Groovy Map containing information about target file + e.g. [ id:'test' ] - targetfile: type: file description: | Input target bed file + - meta5: + type: map + description: | + Groovy Map containing information about reference file + e.g. [ id:'test' ] - reference: type: file description: | Input reference cnn-file (only for germline and tumor-only running) + output: - meta: type: map @@ -76,11 +97,14 @@ output: type: file description: File containing software versions pattern: "versions.yml" + authors: - - "@kaurravneet4123" - - "@KevinMenden" - - "@MaxUlysse" + - "@adamrtalbot" - "@drpatelh" - "@fbdtemme" + - "@kaurravneet4123" + - "@KevinMenden" - "@lassefolkersen" + - "@MaxUlysse" + - "@priesgo" - "@SusiJo" diff --git a/tests/pipeline/cnvkit.nf.test.snap b/tests/pipeline/cnvkit.nf.test.snap index f52ff4b..7807a75 100644 --- a/tests/pipeline/cnvkit.nf.test.snap +++ b/tests/pipeline/cnvkit.nf.test.snap @@ -1,7 +1,7 @@ { "software_versions": { "content": [ - "{CNVKIT_BATCH={cnvkit=0.9.9}, CUSTOM_DUMPSOFTWAREVERSIONS={python=3.11.0, yaml=6.0}, Workflow={nf-core/createpanelrefs=1.0dev}}" + "{CNVKIT_BATCH={cnvkit=0.9.10}, CUSTOM_DUMPSOFTWAREVERSIONS={python=3.11.0, yaml=6.0}, Workflow={nf-core/createpanelrefs=1.0dev}}" ], "timestamp": "2023-07-08T16:51:32+0000" }, @@ -15,4 +15,4 @@ ], "timestamp": "2023-07-08T16:51:32+0000" } -} \ No newline at end of file +} diff --git a/tests/pipeline/default.nf.test.snap b/tests/pipeline/default.nf.test.snap index d41eebb..807ac4d 100644 --- a/tests/pipeline/default.nf.test.snap +++ b/tests/pipeline/default.nf.test.snap @@ -1,7 +1,7 @@ { "software_versions": { "content": [ - "{CNVKIT_BATCH={cnvkit=0.9.9}, CUSTOM_DUMPSOFTWAREVERSIONS={python=3.11.0, yaml=6.0}, Workflow={nf-core/createpanelrefs=1.0dev}}" + "{CNVKIT_BATCH={cnvkit=0.9.10}, CUSTOM_DUMPSOFTWAREVERSIONS={python=3.11.0, yaml=6.0}, Workflow={nf-core/createpanelrefs=1.0dev}}" ], "timestamp": "2023-07-08T16:47:57+0000" }, @@ -15,4 +15,4 @@ ], "timestamp": "2023-07-08T16:47:57+0000" } -} \ No newline at end of file +} diff --git a/workflows/createpanelrefs.nf b/workflows/createpanelrefs.nf index 11b7c6e..455f11a 100644 --- a/workflows/createpanelrefs.nf +++ b/workflows/createpanelrefs.nf @@ -38,15 +38,11 @@ for (param in checkPathParamList) if (param) file(param, checkIfExists: true) ch_from_samplesheet = Channel.fromSamplesheet("input") ch_input = ch_from_samplesheet.map{meta, bam, bai, cram, crai -> - if (bam) return [ [id:"panel", data_type:"bam" ], bam ] - if (cram) return [ [id:"panel", data_type:"cram" ], cram ] -}.groupTuple().branch{ - bam: it[0].data_type == "bam" - cram: it[0].data_type == "cram" + if (bam) return [ meta + [data_type:"bam"], bam ] + if (cram) return [ meta + [data_type:"cram" ], cram ] } - // Initialize file channels based on params, defined in the params.genomes[params.genome] scope -ch_fasta = params.fasta ? Channel.fromPath(params.fasta).first() : Channel.empty() +ch_fasta = params.fasta ? Channel.fromPath(params.fasta).map { fasta -> [[id:fasta.baseName],fasta]}.collect() : Channel.empty() /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -97,7 +93,21 @@ workflow CREATEPANELREFS { ch_versions = Channel.empty() if (params.tools && params.tools.split(',').contains('cnvkit')) { - CNVKIT_BATCH ( ch_input.bam.map{meta, bam -> [ meta, [], bam ]}, ch_fasta, [], [], [], true ) + + ch_input + .map{ meta, bam -> + new_meta = meta + [id:"panel"] + [new_meta, bam] + } + .groupTuple() + .branch{ + bam: it[0].data_type == "bam" + } + .bam + .map {meta, bam -> [ meta, [], bam ]} + .set { ch_cnvkit_input } + + CNVKIT_BATCH ( ch_cnvkit_input, ch_fasta, [[:],[]], [[:],[]], [[:],[]], true ) ch_versions = ch_versions.mix(CNVKIT_BATCH.out.versions) }