This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Samtools - huge mpileup file!

I have a .bam file which contains exome capture data and is 10GB.

I used the following command to make an mpileup:

samtools mpileup -E -uf hg19.fa file.art.bam > file.mpileup

It took several hours of making the mpileup file and it got to over 100GB in size and my computer ran out of storage! So I obviously stopped this command running to start again. Why was the pileup so large?

My intention upon getting the mpileup file was to do variant calling using:

bcftools view -cg file.mpileup > file.vcf

Are these the right options for me?

Thank you!

alignment next-gen

Use pipe...

We're in the pipe five by five:

I stopped unzipping the file because my computer ran out of space. I must have done something wrong somewhere because the .vcf should surely be much smaller than fastq and bam!

Pipes are your friend: zcat file.vcf.gz | less.

1 answer

A pileup file is text-based, so it's going to be large. Assuming you have the most recent version of samtools, just use samtools mpileup -Euvf hg19.fa file.art.bam | bgzip > file.vcf.gz.

Thanks very much, I ran the command you suggested and it took many hours and generated a zipped .vcf file that is 21GB. Is this not larger that what I could expect from one human exome?

It seems rather large to me, but you could just look at the results to see if they make any sense.

Log in to answer this question.