Skip to content

Commit

Permalink
Merge pull request #1108 from maxulysse/remove_minus
Browse files Browse the repository at this point in the history
FIX: Refactor prefix definition
  • Loading branch information
maxulysse authored Jun 14, 2023
2 parents 875faee + 6276707 commit abc7fe6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
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" }
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" }
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 = { variant_file.baseName - ".vcf" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/reports/vcftools/${meta.variantcaller}/${meta.id}/" },
Expand Down

0 comments on commit abc7fe6

Please sign in to comment.