-
Notifications
You must be signed in to change notification settings - Fork 743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update modules in GATK's gcnvcaller pipeline #3561
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,11 +24,16 @@ input: | |
description: | | ||
Groovy Map containing sample information | ||
e.g. [ id:'test', single_end:false ] | ||
- bam: | ||
- meta2: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add the other metas too? |
||
type: map | ||
description: | | ||
Groovy Map containing reference information | ||
e.g. [ id:'test' ] | ||
- input: | ||
type: file | ||
description: BAM/CRAM/SAM file | ||
pattern: "*.{bam,cram,sam}" | ||
- bai: | ||
- input_index: | ||
type: file | ||
description: BAM/CRAM/SAM index file | ||
pattern: "*.{bai,crai,sai}" | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,9 +1,10 @@ | ||||||
|
||||||
process GATK4_DETERMINEGERMLINECONTIGPLOIDY { | ||||||
tag "$meta.id" | ||||||
label 'process_single' | ||||||
|
||||||
//Conda is not supported at the moment: https://github.com/broadinstitute/gatk/issues/7811 | ||||||
container "nf-core/gatk:4.4.0.0" //Biocontainers is missing a package | ||||||
container "quay.io/nf-core/gatk:4.4.0.0" //Biocontainers is missing a package | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Quay.io is the default registry in all nf-core pipelines so we leave this out for more flexibility There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When I tried without it, singularity fails to pull the image. https://github.com/nf-core/modules/actions/runs/5394391319/jobs/9795497440 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @adamrtalbot can you help with this? :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's fixed in nf-core/tools#2336 but will require a new release. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also fixed with Nextflow version 23.04+ which includes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Awesome thank you! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool! I will let There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Caused issue: #3668 |
||||||
|
||||||
// Exit if running this module with -profile conda / -profile mamba | ||||||
if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { | ||||||
|
@@ -12,27 +13,25 @@ process GATK4_DETERMINEGERMLINECONTIGPLOIDY { | |||||
|
||||||
input: | ||||||
tuple val(meta), path(counts), path(bed), path(exclude_beds) | ||||||
tuple val(meta2), path(ploidy_model) | ||||||
path(contig_ploidy_table) | ||||||
path(ploidy_model) | ||||||
|
||||||
output: | ||||||
tuple val(meta), path("*-calls.tar.gz") , emit: calls | ||||||
tuple val(meta), path("*-model.tar.gz") , emit: model, optional: true | ||||||
tuple val(meta), path("${prefix}-calls"), emit: calls | ||||||
tuple val(meta), path("${prefix}-model"), emit: model, optional: true | ||||||
path "versions.yml" , emit: versions | ||||||
|
||||||
when: | ||||||
task.ext.when == null || task.ext.when | ||||||
|
||||||
script: | ||||||
def args = task.ext.args ?: '' | ||||||
def prefix = task.ext.prefix ?: "${meta.id}" | ||||||
def input_list = counts.collect(){"--input $it"}.join(" ") | ||||||
def intervals = bed ? "--intervals ${bed}" : "" | ||||||
def exclude = exclude_beds ? exclude_beds.collect(){"--exclude-intervals $it"}.join(" ") : "" | ||||||
def untar_model = ploidy_model ? (ploidy_model.name.endsWith(".tar.gz") ? "tar -xzf ${ploidy_model}" : "") : "" | ||||||
def tar_model = ploidy_model ? "" : "tar czf ${prefix}-model.tar.gz ${prefix}-model" | ||||||
def model = ploidy_model ? (ploidy_model.name.endsWith(".tar.gz") ? "--model ${ploidy_model.toString().replace(".tar.gz","")}" : "--model ${ploidy_model}") : "" | ||||||
def args = task.ext.args ?: '' | ||||||
prefix = task.ext.prefix ?: "${meta.id}" | ||||||
def intervals = bed ? "--intervals ${bed}" : "" | ||||||
def exclude = exclude_beds ? exclude_beds.collect(){"--exclude-intervals $it"}.join(" ") : "" | ||||||
def contig_ploidy = contig_ploidy_table ? "--contig-ploidy-priors ${contig_ploidy_table}" : "" | ||||||
def model = ploidy_model ? "--model ${ploidy_model}" : "" | ||||||
def input_list = counts.collect(){"--input $it"}.join(" ") | ||||||
|
||||||
def avail_mem = 3072 | ||||||
if (!task.memory) { | ||||||
|
@@ -41,8 +40,6 @@ process GATK4_DETERMINEGERMLINECONTIGPLOIDY { | |||||
avail_mem = (task.memory.mega*0.8).intValue() | ||||||
} | ||||||
""" | ||||||
${untar_model} | ||||||
|
||||||
gatk --java-options "-Xmx${avail_mem}M" DetermineGermlineContigPloidy \\ | ||||||
${input_list} \\ | ||||||
--output ./ \\ | ||||||
|
@@ -54,22 +51,17 @@ process GATK4_DETERMINEGERMLINECONTIGPLOIDY { | |||||
--tmp-dir . \\ | ||||||
${args} | ||||||
|
||||||
tar czf ${prefix}-calls.tar.gz ${prefix}-calls | ||||||
${tar_model} | ||||||
|
||||||
cat <<-END_VERSIONS > versions.yml | ||||||
"${task.process}": | ||||||
gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') | ||||||
END_VERSIONS | ||||||
""" | ||||||
|
||||||
stub: | ||||||
def prefix = task.ext.prefix ?: "${meta.id}" | ||||||
prefix = task.ext.prefix ?: "${meta.id}" | ||||||
""" | ||||||
touch ${prefix}-calls.tar.gz | ||||||
touch ${prefix}-model.tar.gz | ||||||
touch ${prefix}.tsv | ||||||
touch ${prefix}2.tsv | ||||||
touch ${prefix}-calls | ||||||
touch ${prefix}-model | ||||||
|
||||||
cat <<-END_VERSIONS > versions.yml | ||||||
"${task.process}": | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -3,7 +3,7 @@ process GATK4_GERMLINECNVCALLER { | |||||
label 'process_single' | ||||||
|
||||||
//Conda is not supported at the moment: https://github.com/broadinstitute/gatk/issues/7811 | ||||||
container "nf-core/gatk:4.4.0.0" //Biocontainers is missing a package | ||||||
container "quay.io/nf-core/gatk:4.4.0.0" //Biocontainers is missing a package | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
// Exit if running this module with -profile conda / -profile mamba | ||||||
if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { | ||||||
|
@@ -12,28 +12,25 @@ process GATK4_GERMLINECNVCALLER { | |||||
|
||||||
input: | ||||||
tuple val(meta), path(tsv), path(intervals) | ||||||
path model | ||||||
path ploidy | ||||||
tuple val(meta2), path(model) | ||||||
tuple val(meta2), path(ploidy) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Can you also fix the meta.yml here? |
||||||
|
||||||
output: | ||||||
tuple val(meta), path("*-cnv-calls.tar.gz"), emit: calls, optional: true | ||||||
tuple val(meta), path("*-cnv-model.tar.gz"), emit: model, optional: true | ||||||
path "versions.yml" , emit: versions | ||||||
tuple val(meta), path("*-cnv-calls/*-calls"), emit: calls, optional: true | ||||||
tuple val(meta), path("*-cnv-model/*-model"), emit: model, optional: true | ||||||
path "versions.yml" , emit: versions | ||||||
|
||||||
when: | ||||||
task.ext.when == null || task.ext.when | ||||||
|
||||||
script: | ||||||
def args = task.ext.args ?: '' | ||||||
def args = task.ext.args ?: '' | ||||||
def prefix = task.ext.prefix ?: "${meta.id}" | ||||||
def intervals_command = intervals ? "--intervals $intervals" : "" | ||||||
def untar_ploidy = ploidy ? (ploidy.name.endsWith(".tar.gz") ? "tar -xzf ${ploidy}" : "") : "" | ||||||
def untar_model = model ? (model.name.endsWith(".tar.gz") ? "tar -xzf ${model}" : "") : "" | ||||||
def ploidy_command = ploidy ? (ploidy.name.endsWith(".tar.gz") ? "--contig-ploidy-calls ${ploidy.toString().replace(".tar.gz","")}" : "--contig-ploidy-calls ${ploidy}") : "" | ||||||
def model_command = model ? (model.name.endsWith(".tar.gz") ? "--model ${model.toString().replace(".tar.gz","")}/${prefix}-model" : "--model ${model}/${prefix}-model") : "" | ||||||
def input_list = tsv.collect{"--input $it"}.join(' ') | ||||||
def output_command = model ? "--output ${prefix}-cnv-calls" : "--output ${prefix}-cnv-model" | ||||||
def tar_output = model ? "tar -czf ${prefix}-cnv-calls.tar.gz ${prefix}-cnv-calls" : "tar -czf ${prefix}-cnv-model.tar.gz ${prefix}-cnv-model" | ||||||
def intervals_command = intervals ? "--intervals ${intervals}" : "" | ||||||
def ploidy_command = ploidy ? "--contig-ploidy-calls ${ploidy}" : "" | ||||||
def model_command = model ? "--model ${model}" : "" | ||||||
def input_list = tsv.collect{"--input $it"}.join(' ') | ||||||
def output_command = model ? "--output ${prefix}-cnv-calls" : "--output ${prefix}-cnv-model" | ||||||
|
||||||
def avail_mem = 3072 | ||||||
if (!task.memory) { | ||||||
|
@@ -42,9 +39,6 @@ process GATK4_GERMLINECNVCALLER { | |||||
avail_mem = (task.memory.mega*0.8).intValue() | ||||||
} | ||||||
""" | ||||||
${untar_ploidy} | ||||||
${untar_model} | ||||||
|
||||||
gatk --java-options "-Xmx${avail_mem}g" GermlineCNVCaller \\ | ||||||
$input_list \\ | ||||||
$ploidy_command \\ | ||||||
|
@@ -53,7 +47,6 @@ process GATK4_GERMLINECNVCALLER { | |||||
$args \\ | ||||||
$intervals_command \\ | ||||||
$model_command | ||||||
${tar_output} | ||||||
|
||||||
cat <<-END_VERSIONS > versions.yml | ||||||
"${task.process}": | ||||||
|
@@ -64,7 +57,8 @@ process GATK4_GERMLINECNVCALLER { | |||||
stub: | ||||||
def prefix = task.ext.prefix ?: "${meta.id}" | ||||||
""" | ||||||
touch ${prefix}.tar.gz | ||||||
mkdir -p ${prefix}-cnv-calls/${prefix}-calls | ||||||
mkdir -p ${prefix}-cnv-model/${prefix}-model | ||||||
|
||||||
cat <<-END_VERSIONS > versions.yml | ||||||
"${task.process}": | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -3,36 +3,33 @@ process GATK4_POSTPROCESSGERMLINECNVCALLS { | |||||
label 'process_single' | ||||||
|
||||||
//Conda is not supported at the moment: https://github.com/broadinstitute/gatk/issues/7811 | ||||||
container "nf-core/gatk:4.4.0.0" //Biocontainers is missing a package | ||||||
container "quay.io/nf-core/gatk:4.4.0.0" //Biocontainers is missing a package | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
// Exit if running this module with -profile conda / -profile mamba | ||||||
if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { | ||||||
exit 1, "GATK4_POSTPROCESSGERMLINECNVCALLS module does not support Conda. Please use Docker / Singularity / Podman instead." | ||||||
} | ||||||
|
||||||
input: | ||||||
tuple val(meta), path(ploidy) | ||||||
path model | ||||||
path calls | ||||||
tuple val(meta), path(ploidy, stageAs:'ploidy') | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah we had long discussions about this in the past and decided to not use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I see.. Alright I will change it 😄 |
||||||
tuple val(meta2), path(model) | ||||||
tuple val(meta2), path(calls) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Same here |
||||||
|
||||||
output: | ||||||
tuple val(meta), path("*_genotyped_intervals.vcf.gz") , emit: intervals, optional: true | ||||||
tuple val(meta), path("*_genotyped_segments.vcf.gz") , emit: segments, optional: true | ||||||
tuple val(meta), path("*_denoised.vcf.gz") , emit: denoised, optional: true | ||||||
path "versions.yml" , emit: versions | ||||||
path "versions.yml" , emit: versions | ||||||
|
||||||
when: | ||||||
task.ext.when == null || task.ext.when | ||||||
|
||||||
script: | ||||||
def args = task.ext.args ?: '' | ||||||
def prefix = task.ext.prefix ?: "${meta.id}" | ||||||
def untar_ploidy = ploidy ? (ploidy.name.endsWith(".tar.gz") ? "tar -xzf ${ploidy}" : "") : "" | ||||||
def untar_model = model ? (model.name.endsWith(".tar.gz") ? "tar -xzf ${model}" : "") : "" | ||||||
def untar_calls = calls ? (calls.name.endsWith(".tar.gz") ? "tar -xzf ${calls}" : "") : "" | ||||||
def ploidy_command = ploidy ? (ploidy.name.endsWith(".tar.gz") ? "--contig-ploidy-calls ${ploidy.toString().replace(".tar.gz","")}" : "--contig-ploidy-calls ${ploidy}") : "" | ||||||
def model_command = model ? (model.name.endsWith(".tar.gz") ? "--model-shard-path ${model.toString().replace(".tar.gz","")}/${prefix}-model" : "--model-shard-path ${model}/${prefix}-model") : "" | ||||||
def calls_command = calls ? (calls.name.endsWith(".tar.gz") ? "--calls-shard-path ${calls.toString().replace(".tar.gz","")}/${prefix}-calls" : "--calls-shard-path ${model}/${prefix}-calls") : "" | ||||||
def ploidy_command = ploidy ? "--contig-ploidy-calls ${ploidy}" : "" | ||||||
def model_command = model ? "--model-shard-path ${model}" : "" | ||||||
def calls_command = calls ? "--calls-shard-path ${calls}" : "" | ||||||
|
||||||
def avail_mem = 3072 | ||||||
if (!task.memory) { | ||||||
|
@@ -41,10 +38,6 @@ process GATK4_POSTPROCESSGERMLINECNVCALLS { | |||||
avail_mem = (task.memory.mega*0.8).intValue() | ||||||
} | ||||||
""" | ||||||
${untar_ploidy} | ||||||
${untar_model} | ||||||
${untar_calls} | ||||||
|
||||||
gatk --java-options "-Xmx${avail_mem}g" PostprocessGermlineCNVCalls \\ | ||||||
$ploidy_command \\ | ||||||
$model_command \\ | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.