Question: samtools filter proper paired alignment
0
gravatar for mynameliuxiang
6 months ago by
mynameliuxiang0 wrote:

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 • 330 views
ADD COMMENTlink modified 6 months ago • written 6 months ago by mynameliuxiang0

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

ADD REPLYlink written 6 months ago by mynameliuxiang0

Did you read the part about supplementary alignments?

ADD REPLYlink written 6 months ago by ATpoint21k

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

ADD REPLYlink written 6 months ago by mynameliuxiang0
1
gravatar for ATpoint
6 months ago by
ATpoint21k
Germany
ATpoint21k wrote:

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

ADD COMMENTlink written 6 months ago by ATpoint21k

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 REPLYlink modified 6 months ago by h.mon27k • written 6 months ago by mynameliuxiang0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1469 users visited in the last hour