Skip to content

Commit

Permalink
Changed VarScan2 and Bcftools consensus to parse merged bed instead o…
Browse files Browse the repository at this point in the history
…f original bed.
  • Loading branch information
svarona committed Jan 18, 2021
1 parent 90079b0 commit e77045d
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -1389,11 +1389,9 @@ process VARSCAN2_CONSENSUS {
-bga \\
-ibam ${bam[0]} \\
-g $fasta \\
| awk '\$4 < $params.min_coverage' > ${prefix}.lowcov.bed
| awk '\$4 < $params.min_coverage' | bedtools merge > ${prefix}.merged.bed
parse_mask_bed.py ${vcf[0]} ${prefix}.lowcov.bed ${prefix}.lowcov.fix.bed
bedtools merge -i ${prefix}.lowcov.fix.bed > ${prefix}.mask.bed
parse_mask_bed.py ${vcf[0]} ${prefix}.merged.bed ${prefix}.mask.bed
bedtools maskfasta \\
-fi $fasta \\
Expand Down Expand Up @@ -1792,17 +1790,15 @@ process BCFTOOLS_CONSENSUS {
-bga \\
-ibam ${bam[0]} \\
-g $fasta \\
| awk '\$4 < $params.min_coverage' > ${sample}.lowcov.bed
parse_mask_bed.py ${vcf[0]} ${sample}.lowcov.bed ${sample}.lowcov.fix.bed
| awk '\$4 < $params.min_coverage' | bedtools merge > ${sample}.merged.bed
bedtools merge -i ${sample}.lowcov.fix.bed > ${sample}.mask.bed
parse_mask_bed.py ${vcf[0]} ${sample}.merged.bed ${sample}.mask.bed
bedtools maskfasta \\
-fi $fasta \\
-bed ${sample}.mask.bed \\
-fo ${index_base}.ref.masked.fa
cat ${index_base}.ref.masked.fa | bcftools consensus ${vcf[0]} > ${sample}.consensus.masked.fa
sed -i 's/${index_base}/${sample}/g' ${sample}.consensus.masked.fa
Expand Down

0 comments on commit e77045d

Please sign in to comment.