@@ -292,7 +292,7 @@ bamsAll = bamsAll.map {
292292}
293293
294294// Manta and Strelka
295- (bamsForManta, bamsForStrelka, bamsAll) = bamsAll. into(3 )
295+ (bamsForManta, bamsForStrelka, bamsForStrelkaBP, bamsAll) = bamsAll. into(4 )
296296
297297bamsTumorNormalIntervals = bamsAll. spread(bedIntervals)
298298
@@ -532,11 +532,8 @@ if (params.verbose) strelkaOutput = strelkaOutput.view {
532532process RunManta {
533533 tag {idSampleTumor + " _vs_" + idSampleNormal}
534534
535- publishDir directoryMap. manta, mode: ' link' ,
536- saveAs: {filename ->
537- if (filename. endsWith(" .bam" ) || filename. endsWith(" .bai" )) null
538- else $filename
539- }
535+ publishDir directoryMap. manta, mode: ' link'
536+
540537 input:
541538 set idPatient, idSampleNormal, file(bamNormal), file(baiNormal), idSampleTumor, file(bamTumor), file(baiTumor) from bamsForManta
542539 set file(genomeFile), file(genomeIndex) from Channel . value([
@@ -546,7 +543,7 @@ process RunManta {
546543
547544 output:
548545 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
546+ set idPatient, idSampleNormal, idSampleTumor, file(" *.candidateSmallIndels.vcf.gz" ), file(" *.candidateSmallIndels.vcf.gz.tbi" ) into mantaToStrelka
550547
551548 when: ' manta' in tools && ! params. onlyQC
552549
@@ -634,14 +631,23 @@ if (params.verbose) singleMantaOutput = singleMantaOutput.view {
634631 Index : ${ it[4].fileName} "
635632}
636633
634+ // For easier joining, remaping channels to idPatient, idSampleNormal, idSampleTumor...
635+
636+ bamsForStrelkaBP = bamsForStrelkaBP. map {
637+ idPatientNormal, idSampleNormal, bamNormal, baiNormal, idSampleTumor, bamTumor, baiTumor ->
638+ [idPatientNormal, idSampleNormal, idSampleTumor, bamNormal, baiNormal, bamTumor, baiTumor]
639+ }. join(mantaToStrelka, by :[0 ,1 ,2 ]). map {
640+ idPatientNormal, idSampleNormal, idSampleTumor, bamNormal, baiNormal, bamTumor, baiTumor, mantaCSI, mantaCSIi ->
641+ [idPatientNormal, idSampleNormal, bamNormal, baiNormal, idSampleTumor, bamTumor, baiTumor, mantaCSI, mantaCSIi]
642+ }
637643
638644process RunStrelkaBP {
639645 tag {idSampleTumor + " _vs_" + idSampleNormal}
640646
641647 publishDir directoryMap. strelkabp, mode: ' link'
642648
643649 input:
644- set idPatient, idSampleNormal, file(bamNormal), file(baiNormal), idSampleTumor, file(bamTumor), file(baiTumor), file(mantaCSI), file(mantaCSIi) from mantaToStrelka
650+ set idPatient, idSampleNormal, file(bamNormal), file(baiNormal), idSampleTumor, file(bamTumor), file(baiTumor), file(mantaCSI), file(mantaCSIi) from bamsForStrelkaBP
645651 set file(genomeFile), file(genomeIndex), file(genomeDict) from Channel . value([
646652 referenceMap. genomeFile,
647653 referenceMap. genomeIndex,
0 commit comments