<p>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.</p>

CC BY-SA 4.0
2021-10-06T01:27:31.457Z
2021-10-06T01:27:31.457Z
Michael Weinstein
<p>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.</p>
<p>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.</p>
<p>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?</p>

CC BY-SA 4.0
2021-10-05T05:26:22.653Z
Cross-posted here: https://www.biostars.org/p/9492155/
swbarnes2
<rna-seq><samtools><variant-calling><gatk><bcftools>
Convert VCF file to mpileup.txt
# Convert VCF file to mpileup.txt

(Asked by: username_0 on 2021-10-04)

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?

**Tags:** rna-seq, samtools, variant-calling, gatk, bcftools
> **Comments:**
> **username_1**: Cross-posted here: https://www.biostars.org/p/9492155/  

---

## 1 answers

### Answer by username_2 on 2021-10-06. Score: 3

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.


---

