This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Bcftools Mpileup Removes Marked Duplicates?

Hey,

My question is does samtools mpileup automatically removed duplicates from test.marked.bam output from Picard/MarkDuplicates? Because I am not following any other step to remove duplicates.

I used Picard Tools to create: test.marked.bam

Then I use "samtools mpileup -uf test.marked.bam | bcftools view -bvcg -> test.marked.bcf "

and

"bcftools view test.marked.bcf | vcfutils.pl varfilter -D1000 >test.marked.vcf"

Thanks very much

exome picard duplicates bcftools mpileup

Mpileup skips reads marked as duplicates.

Cool, thanks very much.

1 answer

I don't think that it would. Use "samtools view -bF 1024 marked.bam > my_filtered.bam" to be sure.

Hi swbarnes2,

So I am running the command you mentioned. I looked up -F means skipping the alignments with 1024 buts present in integer.

So then the abvious question is what should I expect out of this command and if I am not removing duplicates by marking them, how should I remove the duplicates before calling variants? Thanks again.

1024 is the flag for "PCR or optical duplicates". That should be how Picard marked them, so getting rid of reads with that flag should get rid of the duplicates.

Picard has a setting in MarkDuplicates where instead of marking duplicates, it gets rid of them. You could always rerun Picard that way.

Yes I agree. And will compare the two bam files. I just discovered the removal option recently.

Log in to answer this question.