Skip to content
This repository was archived by the owner on Jan 27, 2020. It is now read-only.

Commit 2c40e28

Browse files
author
Szilveszter Juhos
authored
Merge pull request #556 from MaxUlysse/StrelkaBP
Follow Strelka BP and use Manta small indels candidates as input
2 parents c71d045 + 385ef61 commit 2c40e28

7 files changed

Lines changed: 72 additions & 8 deletions

File tree

annotate.nf

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,18 @@ vcfNotToAnnotate = Channel.create()
7777

7878
if (annotateVCF == []) {
7979
Channel.empty().mix(
80-
Channel.fromPath("${params.outDir}/VariantCalling/HaplotypeCaller/*.vcf.gz")
80+
Channel.fromPath("${directoryMap.haplotypecaller}/*.vcf.gz")
8181
.flatten().map{vcf -> ['haplotypecaller',vcf]},
82-
Channel.fromPath("${params.outDir}/VariantCalling/Manta/*SV.vcf.gz")
82+
Channel.fromPath("${directoryMap.manta}/*SV.vcf.gz")
8383
.flatten().map{vcf -> ['manta',vcf]},
84-
Channel.fromPath("${params.outDir}/VariantCalling/MuTect1/*.vcf.gz")
84+
Channel.fromPath("${directoryMap.mutect1}/*.vcf.gz")
8585
.flatten().map{vcf -> ['mutect1',vcf]},
86-
Channel.fromPath("${params.outDir}/VariantCalling/MuTect2/*.vcf.gz")
86+
Channel.fromPath("${directoryMap.mutect2}/*.vcf.gz")
8787
.flatten().map{vcf -> ['mutect2',vcf]},
88-
Channel.fromPath("${params.outDir}/VariantCalling/Strelka/*{somatic,variants}*.vcf.gz")
89-
.flatten().map{vcf -> ['strelka',vcf]}
88+
Channel.fromPath("${directoryMap.strelka}/*{somatic,variants}*.vcf.gz")
89+
.flatten().map{vcf -> ['strelka',vcf]},
90+
Channel.fromPath("${directoryMap.strelkabp}/*{somatic,variants}*.vcf.gz")
91+
.flatten().map{vcf -> ['strelkabp',vcf]}
9092
).choice(vcfToAnnotate, vcfNotToAnnotate) {
9193
annotateTools == [] || (annotateTools != [] && it[0] in annotateTools) ? 0 : 1
9294
}
@@ -213,6 +215,12 @@ def checkUppmaxProject() {
213215

214216
def defineDirectoryMap() {
215217
return [
218+
'haplotypecaller' : "${params.outDir}/VariantCalling/HaplotypeCaller",
219+
'manta' : "${params.outDir}/VariantCalling/Manta",
220+
'mutect1' : "${params.outDir}/VariantCalling/MuTect1",
221+
'mutect2' : "${params.outDir}/VariantCalling/MuTect2",
222+
'strelka' : "${params.outDir}/VariantCalling/Strelka",
223+
'strelkabp' : "${params.outDir}/VariantCalling/StrelkaBP",
216224
'bcftoolsStats' : "${params.outDir}/Reports/BCFToolsStats",
217225
'snpeff' : "${params.outDir}/Annotation/SnpEff",
218226
'vep' : "${params.outDir}/Annotation/VEP"

configuration/base.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ params {
4242
sampleDir = '' // samples directory (for Germline only)
4343
singularity = false // Don't use singularity to build buildContainers.nf
4444
step = 'mapping' // Default step is mapping
45+
strelkaBP = false // Don't use Manta's candidate indels as input to Strelka
4546
tag = 'latest' // Default tag is latest, to be overwritten by --tag <version>
4647
test = false // Not testing by default
4748
tools = '' // List of tools to use

configuration/containers.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,6 @@ process {
4040
$RunSingleStrelka.container = "${params.repository}/sarek:${params.tag}"
4141
$RunSnpeff.container = {params.genome == 'GRCh38' ? "${params.repository}/snpeffgrch38:${params.tag}" : "${params.repository}/snpeffgrch37:${params.tag}"}
4242
$RunStrelka.container = "${params.repository}/sarek:${params.tag}"
43+
$RunStrelkaBP.container = "${params.repository}/sarek:${params.tag}"
4344
$RunVEP.container = {params.genome == 'GRCh38' ? "${params.repository}/vepgrch38:${params.tag}" : "${params.repository}/vepgrch37:${params.tag}"}
4445
}

configuration/singularity-path.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,6 @@ process {
4646
$RunSingleStrelka.container = "${params.containerPath}/sarek-${params.tag}.img"
4747
$RunSnpeff.container = {params.genome == 'GRCh38' ? "${params.containerPath}/snpeffgrch38-${params.tag}.img" : "${params.containerPath}/snpeffgrch37-${params.tag}.img"}
4848
$RunStrelka.container = "${params.containerPath}/sarek-${params.tag}.img"
49+
$RunStrelkaBP.container = "${params.containerPath}/sarek-${params.tag}.img"
4950
$RunVEP.container = {params.genome == 'GRCh38' ? "${params.containerPath}/vepgrch38-${params.tag}.img" : "${params.containerPath}/vepgrch37-${params.tag}.img"}
5051
}

lib/SarekUtils.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ class MyUtils {
5555
'singleCPUMem',
5656
'singularity',
5757
'step',
58+
'strelka-BP',
59+
'strelkaBP',
5860
'tag',
5961
'test',
6062
'tools',

scripts/test.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,13 @@ fi
9494

9595
if [[ ALL,TOOLS =~ $TEST ]]
9696
then
97-
run_wrapper --somatic --sample $SAMPLE --variantCalling --tools FreeBayes,HaplotypeCaller,MuTect1,MuTect2,Strelka
97+
run_wrapper --somatic --sample $SAMPLE --variantCalling --tools FreeBayes,HaplotypeCaller,MuTect1,MuTect2
9898
fi
9999

100100
if [[ ALL,MANTA =~ $TEST ]]
101101
then
102102
run_wrapper --somatic --sample data/tsv/tiny-manta.tsv --variantCalling --tools Manta --noReports
103+
run_wrapper --somatic --sample data/tsv/tiny-manta.tsv --variantCalling --tools Manta,Strelka --noReports --strelkaBP
103104
clean_repo
104105
fi
105106

somaticVC.nf

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,7 @@ process RunManta {
546546

547547
output:
548548
set val("manta"), idPatient, idSampleNormal, idSampleTumor, file("*.vcf.gz"), file("*.vcf.gz.tbi") into mantaOutput
549+
set idPatient, idSampleNormal, file(bamNormal), file(baiNormal), idSampleTumor, file(bamTumor), file(baiTumor), file("*.candidateSmallIndels.vcf.gz"), file("*.candidateSmallIndels.vcf.gz.tbi") into mantaToStrelka
549550

550551
when: 'manta' in tools && !params.onlyQC
551552

@@ -633,6 +634,54 @@ if (params.verbose) singleMantaOutput = singleMantaOutput.view {
633634
Index : ${it[4].fileName}"
634635
}
635636

637+
638+
process RunStrelkaBP {
639+
tag {idSampleTumor + "_vs_" + idSampleNormal}
640+
641+
publishDir directoryMap.strelkabp, mode: 'link'
642+
643+
input:
644+
set idPatient, idSampleNormal, file(bamNormal), file(baiNormal), idSampleTumor, file(bamTumor), file(baiTumor), file(mantaCSI), file(mantaCSIi) from mantaToStrelka
645+
set file(genomeFile), file(genomeIndex), file(genomeDict) from Channel.value([
646+
referenceMap.genomeFile,
647+
referenceMap.genomeIndex,
648+
referenceMap.genomeDict
649+
])
650+
651+
output:
652+
set val("strelkaBP"), idPatient, idSampleNormal, idSampleTumor, file("*.vcf.gz"), file("*.vcf.gz.tbi") into strelkaBPOutput
653+
654+
when: 'strelka' in tools && 'manta' in tools && params.strelkaBP && !params.onlyQC
655+
656+
script:
657+
"""
658+
\$STRELKA_INSTALL_PATH/bin/configureStrelkaSomaticWorkflow.py \
659+
--tumor ${bamTumor} \
660+
--normal ${bamNormal} \
661+
--referenceFasta ${genomeFile} \
662+
--indelCandidates ${mantaCSI} \
663+
--runDir Strelka
664+
665+
python Strelka/runWorkflow.py -m local -j ${task.cpus}
666+
667+
mv Strelka/results/variants/somatic.indels.vcf.gz \
668+
Strelka_${idSampleTumor}_vs_${idSampleNormal}_somatic_indels.vcf.gz
669+
mv Strelka/results/variants/somatic.indels.vcf.gz.tbi \
670+
Strelka_${idSampleTumor}_vs_${idSampleNormal}_somatic_indels.vcf.gz.tbi
671+
mv Strelka/results/variants/somatic.snvs.vcf.gz \
672+
Strelka_${idSampleTumor}_vs_${idSampleNormal}_somatic_snvs.vcf.gz
673+
mv Strelka/results/variants/somatic.snvs.vcf.gz.tbi \
674+
Strelka_${idSampleTumor}_vs_${idSampleNormal}_somatic_snvs.vcf.gz.tbi
675+
"""
676+
}
677+
678+
if (params.verbose) strelkaBPOutput = strelkaBPOutput.view {
679+
"Variant Calling output:\n\
680+
Tool : ${it[0]}\tID : ${it[1]}\tSample: [${it[3]}, ${it[2]}]\n\
681+
Files : ${it[4].fileName}\n\
682+
Index : ${it[5].fileName}"
683+
}
684+
636685
// Run commands and code from Malin Larsson
637686
// Based on Jesper Eisfeldt's code
638687
process RunAlleleCount {
@@ -844,7 +893,8 @@ def defineDirectoryMap() {
844893
'manta' : "${params.outDir}/VariantCalling/Manta",
845894
'mutect1' : "${params.outDir}/VariantCalling/MuTect1",
846895
'mutect2' : "${params.outDir}/VariantCalling/MuTect2",
847-
'strelka' : "${params.outDir}/VariantCalling/Strelka"
896+
'strelka' : "${params.outDir}/VariantCalling/Strelka",
897+
'strelkabp' : "${params.outDir}/VariantCalling/StrelkaBP"
848898
]
849899
}
850900

0 commit comments

Comments
 (0)