Skip to content
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

FIX: Refactor prefix definition #1108

Merged
merged 4 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Vuoinesluobbalah is a lake close to Bierikjávrre.
- [#1101](https://github.com/nf-core/sarek/pull/1101) - Remove duplicate index computation for GATK4 Markduplicates & [#1065](https://github.com/nf-core/sarek/issues/1065)
- [#1101](https://github.com/nf-core/sarek/pull/1101) - Fix GATK4 version for GATK4 MarkduplicatesSpark [#1068](https://github.com/nf-core/sarek/issues/1068)
- [#1105](https://github.com/nf-core/sarek/pull/1105) - Remove `params.tracedir`
- [#1108](https://github.com/nf-core/sarek/pull/1108) - Refactor bad prefix definition for vcf files [#938](https://github.com/nf-core/sarek/issues/938)

## [3.2.1](https://github.com/nf-core/sarek/releases/tag/3.2.1) - Pierikjaure

Expand Down
8 changes: 4 additions & 4 deletions conf/modules/annotate.config
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ process {
// SNPEFF
if (params.tools && (params.tools.split(',').contains('snpeff') || params.tools.split(',').contains('merge'))) {
withName: 'SNPEFF_SNPEFF' {
ext.prefix = { "${vcf.baseName.minus(".vcf")}_snpEff" }
ext.prefix = { vcf.baseName - ".vcf" + "_snpEff" }
ext.args = '-nodownload -canon -v'
if (!params.snpeff_cache && !params.download_cache) container = { params.snpeff_genome ? "docker.io/nfcore/snpeff:${params.snpeff_version}.${params.snpeff_genome}" : "docker.io/nfcore/snpeff:${params.snpeff_version}.${params.genome}" }
publishDir = [
Expand Down Expand Up @@ -46,7 +46,7 @@ process {
(params.vep_custom_args) ?: ''
].join(' ').trim() }
// If just VEP: <vcf prefix>_VEP.ann.vcf
ext.prefix = { "${vcf.baseName.minus(".vcf")}_VEP.ann" }
ext.prefix = { vcf.baseName - ".vcf" + "_VEP.ann" }
if (!params.vep_cache && !params.download_cache) container = { params.vep_genome ? "docker.io/nfcore/vep:${params.vep_version}.${params.vep_genome}" : "docker.io/nfcore/vep:${params.vep_version}.${params.genome}" }
publishDir = [
[
Expand All @@ -67,14 +67,14 @@ process {
if (params.tools && params.tools.split(',').contains('merge')) {
withName: "NFCORE_SAREK:SAREK:VCF_ANNOTATE_ALL:VCF_ANNOTATE_MERGE:ENSEMBLVEP_VEP" {
// If merge: Output file will have format *_snpEff_VEP.ann.vcf, *_snpEff_VEP.ann.json or *_snpEff_VEP.ann.tab
ext.prefix = { "${vcf.baseName.minus(".ann.vcf")}_VEP.ann" }
ext.prefix = { vcf.baseName - ".ann.vcf" + "_VEP.ann" }
}
}

// ALL ANNOTATION TOOLS
if (params.tools && (params.tools.split(',').contains('snpeff') || params.tools.split(',').contains('vep') || params.tools.split(',').contains('merge'))) {
withName: "NFCORE_SAREK:SAREK:VCF_ANNOTATE_ALL:.*:(TABIX_BGZIPTABIX|TABIX_TABIX)" {
ext.prefix = { input.baseName.minus(".vcf") }
ext.prefix = { input.name - ".vcf" }
robsyme marked this conversation as resolved.
Show resolved Hide resolved
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/annotation/${meta.variantcaller}/${meta.id}/" },
Expand Down
2 changes: 1 addition & 1 deletion conf/modules/freebayes.config
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ process {
}

withName: 'BCFTOOLS_SORT' {
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.freebayes" : "${vcf.minus("vcf")}.sort" }
ext.prefix = { meta.num_intervals <= 1 ? meta.id + ".freebayes" : vcf.name - ".vcf" + ".sort" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/" },
Expand Down
2 changes: 1 addition & 1 deletion conf/modules/joint_germline.config
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ process {

if (params.tools && params.tools.contains('haplotypecaller') && params.joint_germline) {
withName: 'NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_GERMLINE_ALL:BAM_JOINT_CALLING_GERMLINE_GATK:BCFTOOLS_SORT' {
ext.prefix = { "${vcf.baseName.minus("vcf")}sort" }
ext.prefix = { vcf.baseName - ".vcf" + "sort" }
maxulysse marked this conversation as resolved.
Show resolved Hide resolved
publishDir = [
enabled: false
]
Expand Down
4 changes: 2 additions & 2 deletions conf/modules/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ process {
// VCF
withName: 'BCFTOOLS_STATS' {
ext.when = { !(params.skip_tools && params.skip_tools.split(',').contains('bcftools')) }
ext.prefix = { "${vcf.baseName.minus(".vcf")}" }
ext.prefix = { vcf.baseName - ".vcf" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/reports/bcftools/${meta.variantcaller}/${meta.id}/" },
Expand All @@ -100,7 +100,7 @@ process {

withName: 'VCFTOOLS_.*' {
ext.when = { !(params.skip_tools && params.skip_tools.split(',').contains('vcftools')) }
ext.prefix = { "${variant_file.baseName.minus(".vcf")}" }
ext.prefix = { vcf.baseName - ".vcf" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/reports/vcftools/${meta.variantcaller}/${meta.id}/" },
Expand Down