Entering edit mode
10 months ago
sata72
•
0
Hi all,
I have a BAM files from RRBS data, and, I want to have number of all reads, number of multimapped and number of unique mapped. I think it can be done with samtools, and, with this we can have all reads.
Thanks in advance.
samtools view -c sample.bam
To get you started. Multiple other threads exist.
Multi-mapped reads: How to filter/view reads mapped to multiple locations using samtools or pysam
Unique reads: Help with Samtools flags to get only primary, unique, non duplicate aligned reads
The exact definition of what is "unique" depends on the aligner. Typically, one sets a MAPQ threshold, for example 20, and everything below is ignored during analysis because mapping quality is too low. You could simply count reads with MAPQ > 20 (samtools view -q 20) and compare to all reads.