Skip to content

Commit

Permalink
Merge branch 'dev/feature-SVCNV' into docker
Browse files Browse the repository at this point in the history
  • Loading branch information
dnousome authored Nov 15, 2023
2 parents cd48fd1 + cd3ac8b commit 5c06112
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 1 deletion.
69 changes: 69 additions & 0 deletions workflow/modules/variant_calling.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion workflow/modules/variant_calling_tonly.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
}

Expand Down
6 changes: 6 additions & 0 deletions workflow/modules/workflows_tonly.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -205,6 +206,11 @@ workflow VC_TONLY {
| annotvep_tonly_combined



emit:
somaticcall_input=combineVariants_octopus.out


emit:
somaticcall_input=combineVariants_octopus.out

Expand Down

0 comments on commit 5c06112

Please sign in to comment.