Entering edit mode
2.8 years ago
ramshahaya
▴
10
Hi,
I would like to check how many reads are uniquely aligned or mapped to the Genome (or Chromosomes)? I had aligned my data using the BWA aligner.
Would be grateful If I could get suggestions regarding this query.
I know that there is a command to check information about multi-mapped reads. If I am not mistaken.
samtools view -c fixed.bam
Thank you so much in advance.
samtools flagstats
samtools flagstats fixed_Sort_Coordinate.bam
9307234 + 0 in total (QC-passed reads + QC-failed reads)
9256458 + 0 primary
50776 + 0 secondary
0 + 0 supplementary
0 + 0 duplicates
0 + 0 primary duplicates
9255274 + 0 mapped (99.44% : N/A)
9204498 + 0 primary mapped (99.44% : N/A)
9256458 + 0 paired in sequencing
4628229 + 0 read1
4628229 + 0 read2
9056900 + 0 properly paired (97.84% : N/A)
9164336 + 0 with itself and mate mapped
40162 + 0 singletons (0.43% : N/A)
79236 + 0 with mate mapped to a different chr
46085 + 0 with mate mapped to a different chr (mapQ>=5)
Thank you so much for the reply. Which row should I consider in the above results?
Is it possible to check how many uniquely mapped read on different chromosome? samtools idxstats will work? I know, samtools idxstats will provide information about mapped reads on the chromosome. If I am not mistaken. But I would like to see uniquely mapped read on a different chromosomes.
Thank you so much in advance.
Isn't it simply like that: unique = mapped - secondary?
Edit: Sorry, just consulted the documentation. Primary mapped should be a unique count.
So the read is mapped (4 not set), and no secondary or other mapping exist and assuming BWA only gives a single alignment per read.
Thanks a lot