Skip to content

Commit f030fe4

Browse files
authored
Merge pull request #66 from UMCUGenetics/hotfix/v0.6.1
Replace baseName with simpleName.
2 parents 2193145 + 3a945bc commit f030fe4

5 files changed

Lines changed: 52 additions & 42 deletions

File tree

GATK/4.2.1.0/GenotypeGvcfs.nf

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ process GenotypeGVCFs {
1111
output:
1212
tuple(
1313
analysis_id,
14-
path("${analysis_id}_${interval_file.baseName}${ext_vcf}"),
15-
path("${analysis_id}_${interval_file.baseName}${ext_vcf}${ext_vcf_index}"),
14+
path("${analysis_id}_${interval_file.simpleName}${ext_vcf}"),
15+
path("${analysis_id}_${interval_file.simpleName}${ext_vcf}${ext_vcf_index}"),
1616
emit:vcf_file
1717
)
1818

@@ -24,14 +24,14 @@ process GenotypeGVCFs {
2424
gatk --java-options "-Xmx${task.memory.toGiga()-4}G" GenotypeGVCFs \
2525
--reference ${params.genome} \
2626
--variant $input_files \
27-
--output ${analysis_id}_${interval_file.baseName}${ext_vcf} \
27+
--output ${analysis_id}_${interval_file.simpleName}${ext_vcf} \
2828
--intervals ${interval_file} \
2929
${params.optional}
3030
"""
3131
}
3232

3333
process GenotypeGVCF {
34-
tag {"GATK GenotypeGVCF ${sample_id} - ${interval_file.baseName}"}
34+
tag {"GATK GenotypeGVCF ${sample_id} - ${interval_file.simpleName}"}
3535
label 'GATK_4_2_1_0'
3636
label 'GATK_4_2_1_0_GenotypeGVCF'
3737
container = 'broadinstitute/gatk:4.2.1.0'
@@ -43,8 +43,8 @@ process GenotypeGVCF {
4343
output:
4444
tuple(
4545
val(sample_id),
46-
path("${sample_id}_${interval_file.baseName}${ext_vcf}"),
47-
path("${sample_id}_${interval_file.baseName}${ext_vcf}${ext_vcf_index}"),
46+
path("${sample_id}_${interval_file.simpleName}${ext_vcf}"),
47+
path("${sample_id}_${interval_file.simpleName}${ext_vcf}${ext_vcf_index}"),
4848
emit: vcf_file
4949
)
5050

@@ -56,7 +56,7 @@ process GenotypeGVCF {
5656
gatk --java-options "-Xmx${task.memory.toGiga()-4}G" GenotypeGVCFs \
5757
--reference ${params.genome} \
5858
--variant $input_files \
59-
--output ${sample_id}_${interval_file.baseName}${ext_vcf} \
59+
--output ${sample_id}_${interval_file.simpleName}${ext_vcf} \
6060
--intervals ${interval_file} \
6161
${params.optional}
6262
"""

GATK/4.2.1.0/HaplotypeCaller.nf

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,21 @@ process HaplotypeCaller {
1111
output:
1212
tuple(
1313
val(analysis_id),
14-
path("${analysis_id}.${interval_file.baseName}${ext_vcf}"),
15-
path("${analysis_id}.${interval_file.baseName}${ext_vcf}${ext_vcf_index}"),
14+
path("${analysis_id}.${interval_file.simpleName}${ext_vcf}"),
15+
path("${analysis_id}.${interval_file.simpleName}${ext_vcf}${ext_vcf_index}"),
1616
emit: vcf_file
1717
)
1818

1919
script:
2020
def input_files = bam_files.collect{"$it"}.join(" --input ")
21-
ext_vcf = ".vcf"
22-
ext_vcf_index = ".idx"
23-
if( params.compress )
24-
ext_vcf = ".vcf.gz"
25-
ext_vcf_index = ".tbi"
21+
ext_vcf = params.compress ? ".vcf.gz" : ".vcf"
22+
ext_vcf_index = params.compress ? ".tbi" : ".idx"
2623
"""
2724
gatk --java-options "-Xmx${task.memory.toGiga()-4}G" HaplotypeCaller \
2825
--reference ${params.genome} \
2926
--input ${input_files} \
3027
--intervals ${interval_file} \
31-
--output ${analysis_id}.${interval_file.baseName}${ext_vcf} \
28+
--output ${analysis_id}.${interval_file.simpleName}${ext_vcf} \
3229
${params.optional}
3330
"""
3431
}
@@ -47,24 +44,21 @@ process HaplotypeCallerGVCF {
4744
output:
4845
tuple(
4946
val(sample_id),
50-
path("${sample_id}_${interval_file.baseName}${ext_gvcf}"),
51-
path("${sample_id}_${interval_file.baseName}${ext_gvcf}${ext_gvcf_index}"),
47+
path("${sample_id}_${interval_file.simpleName}${ext_gvcf}"),
48+
path("${sample_id}_${interval_file.simpleName}${ext_gvcf}${ext_gvcf_index}"),
5249
path(interval_file),
5350
emit: vcf_file
5451
)
5552

5653
script:
57-
ext_gvcf = ".g.vcf"
58-
ext_gvcf_index = ".idx"
59-
if( params.compress )
60-
ext_gvcf = ".g.vcf.gz"
61-
ext_gvcf_index = ".tbi"
54+
ext_gvcf = params.compress ? ".g.vcf.gz" : ".g.vcf"
55+
ext_gvcf_index = params.compress ? ".tbi" : ".idx"
6256
"""
6357
gatk --java-options "-Xmx${task.memory.toGiga()-4}G" HaplotypeCaller \
6458
--reference ${params.genome} \
6559
--input ${bam_file} \
6660
--intervals ${interval_file} \
67-
--output ${sample_id}_${interval_file.baseName}${ext_gvcf} \
61+
--output ${sample_id}_${interval_file.simpleName}${ext_gvcf} \
6862
--emit-ref-confidence ${params.emit_ref_confidence} \
6963
${params.optional}
7064
"""

GATK/4.2.1.0/MergeVcfs.nf

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@ process MergeVcfs {
1313

1414
script:
1515
def input_files = vcf_files.collect{"$it"}.join(" --INPUT ")
16-
ext_vcf = ".vcf"
17-
ext_vcf_index = ".idx"
18-
if( params.compress )
19-
ext_vcf = ".vcf.gz"
20-
ext_vcf_index = ".tbi"
16+
ext_vcf = params.compress ? ".vcf.gz" : ".vcf"
17+
ext_vcf_index = params.compress ? ".tbi" : ".idx"
2118
"""
2219
gatk --java-options "-Xmx${task.memory.toGiga()-4}G" MergeVcfs --INPUT ${input_files} --OUTPUT ${output_name}${ext_vcf}
2320
"""
@@ -39,11 +36,8 @@ process MergeGvcfs {
3936

4037
script:
4138
def input_files = vcf_files.collect{"$it"}.join(" --INPUT ")
42-
ext_gvcf = ".g.vcf"
43-
ext_gvcf_index = ".idx"
44-
if( params.compress )
45-
ext_gvcf = ".g.vcf.gz"
46-
ext_gvcf_index = ".tbi"
39+
ext_gvcf = params.compress ? ".g.vcf.gz" : ".g.vcf"
40+
ext_gvcf_index = params.compress ? ".tbi" : ".idx"
4741
"""
4842
gatk --java-options "-Xmx${task.memory.toGiga()-4}G" MergeVcfs --INPUT ${input_files} --OUTPUT ${output_name}${ext_gvcf}
4943
"""

GATK/4.2.1.0/SelectVariants.nf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ process SelectVariantsSample {
1111
output:
1212
tuple(
1313
sample_id,
14-
path("${sample_id}_${vcf_file.baseName}${ext_vcf}"),
15-
path("${sample_id}_${vcf_file.baseName}${ext_vcf}${ext_vcf_index}"),
14+
path("${sample_id}_${vcf_file.simpleName}${ext_vcf}"),
15+
path("${sample_id}_${vcf_file.simpleName}${ext_vcf}${ext_vcf_index}"),
1616
emit: vcf_file
1717
)
1818

@@ -23,7 +23,7 @@ process SelectVariantsSample {
2323
gatk --java-options "-Xmx${task.memory.toGiga()-4}G" SelectVariants \
2424
--reference ${params.genome} \
2525
--variant ${vcf_file} \
26-
--output ${sample_id}_${vcf_file.baseName}${ext_vcf} \
26+
--output ${sample_id}_${vcf_file.simpleName}${ext_vcf} \
2727
--sample-name ${sample_id} \
2828
${params.optional}
2929
"""

GATK/4.2.1.0/VariantFiltration.nf

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,40 @@ process VariantFiltrationSnpIndel {
99
tuple(analysis_id, path(vcf_file), path(vcf_idx_file))
1010

1111
output:
12-
tuple(analysis_id, path("${vcf_file.baseName}.filter${ext_vcf}"), path("${vcf_file.baseName}.filter${ext_vcf}${ext_vcf_index}"), emit: vcf_file)
12+
tuple(analysis_id, path("${vcf_file.simpleName}.filter${ext_vcf}"), path("${vcf_file.simpleName}.filter${ext_vcf}${ext_vcf_index}"), emit: vcf_file)
1313

1414
script:
1515
ext_vcf = params.compress || vcf_file.getExtension() == ".gz" ? ".vcf.gz" : ".vcf"
1616
ext_vcf_index = params.compress || vcf_file.getExtension() == ".gz" ? ".tbi" : ".idx"
1717
"""
18-
gatk --java-options "-Xmx${task.memory.toGiga()-4}G" SelectVariants --reference ${params.genome} --variant $vcf_file --output ${vcf_file.baseName}.snp${ext_vcf} --select-type-to-exclude INDEL
19-
gatk --java-options "-Xmx${task.memory.toGiga()-4}G" SelectVariants --reference ${params.genome} --variant $vcf_file --output ${vcf_file.baseName}.indel${ext_vcf} --select-type-to-include INDEL
18+
gatk --java-options "-Xmx${task.memory.toGiga()-4}G" SelectVariants \
19+
--reference ${params.genome} \
20+
--variant $vcf_file \
21+
--output ${vcf_file.simpleName}.snp${ext_vcf} \
22+
--select-type-to-exclude INDEL
2023
21-
gatk --java-options "-Xmx${task.memory.toGiga()-4}G" VariantFiltration --reference ${params.genome} --variant ${vcf_file.baseName}.snp${ext_vcf} --output ${vcf_file.baseName}.snp_filter${ext_vcf} ${params.snp_filter} ${params.snp_cluster}
22-
gatk --java-options "-Xmx${task.memory.toGiga()-4}G" VariantFiltration --reference ${params.genome} --variant ${vcf_file.baseName}.indel${ext_vcf} --output ${vcf_file.baseName}.indel_filter${ext_vcf} ${params.indel_filter}
24+
gatk --java-options "-Xmx${task.memory.toGiga()-4}G" SelectVariants \
25+
--reference ${params.genome} \
26+
--variant $vcf_file \
27+
--output ${vcf_file.simpleName}.indel${ext_vcf} \
28+
--select-type-to-include INDEL
2329
24-
gatk --java-options "-Xmx${task.memory.toGiga()-4}G" MergeVcfs --INPUT ${vcf_file.baseName}.snp_filter${ext_vcf} --INPUT ${vcf_file.baseName}.indel_filter${ext_vcf} --OUTPUT ${vcf_file.baseName}.filter${ext_vcf}
30+
gatk --java-options "-Xmx${task.memory.toGiga()-4}G" VariantFiltration \
31+
--reference ${params.genome} \
32+
--variant ${vcf_file.simpleName}.snp${ext_vcf} \
33+
--output ${vcf_file.simpleName}.snp_filter${ext_vcf} \
34+
${params.snp_filter} \
35+
${params.snp_cluster}
36+
37+
gatk --java-options "-Xmx${task.memory.toGiga()-4}G" VariantFiltration \
38+
--reference ${params.genome} \
39+
--variant ${vcf_file.simpleName}.indel${ext_vcf} \
40+
--output ${vcf_file.simpleName}.indel_filter${ext_vcf} \
41+
${params.indel_filter}
42+
43+
gatk --java-options "-Xmx${task.memory.toGiga()-4}G" MergeVcfs \
44+
--INPUT ${vcf_file.simpleName}.snp_filter${ext_vcf} \
45+
--INPUT ${vcf_file.simpleName}.indel_filter${ext_vcf} \
46+
--OUTPUT ${vcf_file.simpleName}.filter${ext_vcf}
2547
"""
2648
}

0 commit comments

Comments
 (0)