This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How To Switch From Samtools Pileup To Mpileup

Specifically I want to run this command:

samtools pileup -f parent1.fa.msg update_reads-aligned-parent1.bam.sorted.bam -c > update_reads-aligned-parent1.pileup

But everything I'm reading, I can't find the -c option for mpileup? Am I just out of luck?

pileup mpileup samtools

1 answer

From the mpileup page:

samtools mpileup -uf ref.fa aln1.bam aln2.bam | bcftools view -bvcg - > var.raw.bcf

The -c in the bcftools view command calls SNPs.

Ok, I see that now. So I guess I'll get the same output format but better quality and faster? Well, I'll just test it and see.

This isn't working at all. I'm getting some kind of binary file as output instead of the pileup file. Also the new file is 16KB instead of 3MB as the old one was.

It really sucks they'd deprecate something and not give users a clear path on what the replacement is.

The "b" in the -bvcg causes bcftools to output bcf instead of vcf. You can omit the "b" or use bcftools view your_file_name_here to see the contents in plain text.

Log in to answer this question.