I am working on an iterative analysis that uses orthologous pipelines that require mpileup.txt files as input for a visualization step. This requires me to convert VCF files to mpileup.txt.
This experiment uses error-prone-pcr and follows a somatic variant discovery workflow that was designed by a 3rd party. I have written and implemented several orthologous pipelines with small differences from the original workflow in order to produce a truth set (variants identified consistently by all of the pipelines). The 3rd party used a workflow that calls Samtools to produce mpileup.txt files as the final output and necessitated the development of a custom visualization script. My orthologous pipelines use mutect2 to produce vcf files that need to be compared to the mpileup.txt files.
If I could convert my vcf files to mpileup.txt files without loss of information it would save me significant time cost associated with writing a similar visualization script for vcf files and prevent bias involved in converting the 3rd parties output to vcf format. There are plenty of examples for using samtools and bcftools to produce an intermediate mpileup file that is then converted to a finalized fitered vcf file. But I can't find much direction for converting a vcf file to an mpileup. Can anybody provide direction for this task?
Going VCF to mpileup is not really something one does or can do. The mpileup should be generated from a BAM or SAM file or something else that has raw, unfiltered read alignments in it. The VCF just has data on variant sites, and usually just variant sites that passed a certain likelihood threshold at that. With the VCF, the best you can do is generate a very limited pileup based upon the VCF-reported counts of reads at each variant locus with no information in between reported variant loci. This would not be a true mpileup and would most likely cause an error with the downstream process or worse, not cause an error and give a result that is divorced from the reality of your sample.