Skip to content

Commit

Permalink
Added parsing mask bed file for bcftools
Browse files Browse the repository at this point in the history
  • Loading branch information
svarona committed Dec 10, 2020
1 parent 98656b4 commit a2dd7bc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -1792,12 +1792,17 @@ process BCFTOOLS_CONSENSUS {
-bga \\
-ibam ${bam[0]} \\
-g $fasta \\
| awk '\$4 < $params.min_coverage' | bedtools merge > ${sample}.mask.bed
| awk '\$4 < $params.min_coverage' > ${sample}.lowcov.bed
parse_mask_bed.py ${vcf[0]} ${sample}.lowcov.bed ${sample}.lowcov.fix.bed
bedtools merge -i ${sample}.lowcov.fix.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 a2dd7bc

Please sign in to comment.