diff --git a/workflow/modules/variant_calling.nf b/workflow/modules/variant_calling.nf index 8354cc8..8bbbb1e 100644 --- a/workflow/modules/variant_calling.nf +++ b/workflow/modules/variant_calling.nf @@ -619,6 +619,75 @@ process combineVariants_octopus { } + +process bcftools_index_octopus { + label 'process_low' + + input: + tuple val(sample), + path(vcf) + + output: + tuple val(sample), + path(vcf), + path("${vcf}.tbi") + + script: + """ + bcftools index -t ${vcf} + """ + + stub: + """ + touch ${vcf} + touch ${vcf}.tbi + """ + +} + +process combineVariants_octopus { + label 'process_highmem' + publishDir(path: "${outdir}/vcfs/", mode: 'copy') + + input: + tuple val(sample), path(vcfs), path(vcfsindex), val(vc) + + output: + tuple val(sample), + path("${vc}/${sample}.${vc}.marked.vcf.gz"), path("${vc}/${sample}.${vc}.norm.vcf.gz") + + script: + vcfin = vcfs.join(" ") + + """ + mkdir ${vc} + bcftools concat $vcfin -a -Oz -o ${sample}.${vc}.temp.vcf.gz + bcftools sort ${sample}.${vc}.temp.vcf.gz -Oz -o ${sample}.${vc}.marked.vcf.gz + bcftools norm ${sample}.${vc}.marked.vcf.gz --threads $task.cpus --check-ref s -f $GENOMEREF -O v |\ + awk '{{gsub(/\\y[W|K|Y|R|S|M]\\y/,"N",\$4); OFS = "\\t"; print}}' |\ + sed '/^\$/d' > ${sample}.${vc}.temp.vcf + + bcftools view ${sample}.${vc}.temp.vcf -f PASS -Oz -o ${vc}/${sample}.${vc}.norm.vcf.gz + + mv ${sample}.${vc}.marked.vcf.gz ${vc} + """ + + stub: + + """ + mkdir ${vc} + touch ${vc}/${sample}.${vc}.marked.vcf.gz + touch ${vc}/${sample}.${vc}.norm.vcf.gz + + """ + +} + + + + + + process combineVariants_strelka { //Concat all somatic snvs/indels across all files, strelka separates snv/indels label 'process_mid' diff --git a/workflow/modules/variant_calling_tonly.nf b/workflow/modules/variant_calling_tonly.nf index 3da5360..993cb34 100644 --- a/workflow/modules/variant_calling_tonly.nf +++ b/workflow/modules/variant_calling_tonly.nf @@ -322,13 +322,13 @@ process octopus_tonly { $SOMATIC_FOREST \ -o ${tumorname}_${bed.simpleName}.tonly.octopus.vcf.gz --threads $task.cpus + """ stub: """ touch ${tumorname}_${bed.simpleName}.tonly.octopus.vcf.gz - """ } diff --git a/workflow/modules/workflows_tonly.nf b/workflow/modules/workflows_tonly.nf index af05fe1..f2b0165 100644 --- a/workflow/modules/workflows_tonly.nf +++ b/workflow/modules/workflows_tonly.nf @@ -173,6 +173,7 @@ workflow VC_TONLY { | map{tumor,markedvcf,markedindex,finalvcf,finalindex,stats -> tuple(tumor,"mutect2",finalvcf,finalindex)} annotvep_tonly_mut2(mutect2_tonly_in) + //VarDict vardict_in_tonly=vardict_tonly(bambyinterval) | groupTuple()| map{tumor,vcf -> tuple(tumor,vcf,"vardict_tonly")} | combineVariants_vardict_tonly @@ -205,6 +206,11 @@ workflow VC_TONLY { | annotvep_tonly_combined + + emit: + somaticcall_input=combineVariants_octopus.out + + emit: somaticcall_input=combineVariants_octopus.out