samtools filter proper paired alignment
1
0
Entering edit mode
5.2 years ago

I want get proper paired alignment here is my scripts

$ samtools view  test1.v2.4.reordered.bam -f 2 -bS - 1> test1.uniq.prop.pair.bam

Next using flagstat check result bam

samtools flagstat test1.uniq.prop.pair.bam 

33117 + 0 in total (QC-passed reads + QC-failed reads)
0 + 0 secondary
0 + 0 supplementary
0 + 0 duplicates
33117 + 0 mapped (100.00% : N/A)
33117 + 0 paired in sequencing
16526 + 0 read1
16591 + 0 read2
33117 + 0 properly paired (100.00% : N/A)
33117 + 0 with itself and mate mapped
0 + 0 singletons (0.00% : N/A)
0 + 0 with mate mapped to a different chr
0 + 0 with mate mapped to a different chr (mapQ>=5)

I am confused why the count of read1 is not equal to read2? does anybody explain that ? thank you!

alignment • 2.4k views
ADD COMMENT
0
Entering edit mode

However It is stilled confused that "proper paired (filtered by flag -f 2)" bam file have different count of read1 and read2 ?

ADD REPLY
0
Entering edit mode

Did you read the part about supplementary alignments?

ADD REPLY
0
Entering edit mode

thank you, i got it. I mistook about supplement alignment and second alignment. your post is very useful.

ADD REPLY
1
Entering edit mode
5.2 years ago
ATpoint 81k

BWA mem alignments? If so see get identical number of read1 and read2 aligned

ADD COMMENT
0
Entering edit mode

Yes, I got this bam by BWA mem. I want to get propered alignment, using fixmate to filter, is that right? samtools fixmate test1.uniq.prop.pair.bam a.bam

33117 + 0 in total (QC-passed reads + QC-failed reads)
0 + 0 secondary
0 + 0 supplementary
0 + 0 duplicates
33117 + 0 mapped (100.00% : N/A)
31044 + 0 paired in sequencing
15522 + 0 read1
15522 + 0 read2
31044 + 0 properly paired (100.00% : N/A)
31044 + 0 with itself and mate mapped
0 + 0 singletons (0.00% : N/A)
0 + 0 with mate mapped to a different chr
0 + 0 with mate mapped to a different chr (mapQ>=5)
ADD REPLY

Login before adding your answer.

Traffic: 2820 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6