This is a test version of Biostars. For the public version, visit https://www.biostars.org.
samtools view region and include duplicate reads

Hello all,

I have paired end whole genome NGS data. I'm trying to extract reads and their mates.

ID_A is the ID of a mate pair aligning to chr12. If I use:

samtools view whole_genome.bam | grep ID_A

it returns both reads. However if I use:

samtools view whole_genome.bam chr12 | grep ID_A

it only returns the read which is not marked as a PCR duplicate. Is there a flag which will return PCR duplicates when viewing a region.

Thanks in advance for your help!

samtools duplicate reads view

it only returns the read which is not marked as a PCR duplicate

hum .. grep cannot change the behavior of samtools in that context.

Hmm yes, the question is more how to change the output of samtools view when a region is added.

When using samtools view with a region given, reads marked as duplicates do not show but their mate does. I want to view these duplicate reads when a region is given.

Appreciate your time!

I still don't understand. Duplicates should be mapped at the same place.

Please show the SAM entry of the respective read(s), this is more straight forward to interpret than textual descriptions.

0 answers

No answers yet.

Log in to answer this question.