This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Compute inner mate distance for paired-end reads in a bam file

Hi,

I am interested to calculate inner mate distance for paired-end reads in many bam files i.e. distance from the right-most end of the left read to the left-most end of the right read and all the properly paired QC-passed reads that map in the bam file (ref: Calculating inner mate distance for paired reads)

I have used CollectInsertSizeMetrics.jar (ref: Picard MarkDuplicates error after using bamaddrg: "bin field of BAM record does not equal value computed..." ) and got the attached insert size histogram for one of my bam files (which includes properly-paired QC-passed reads, sorted and indexed). However, I am unable to understand the histogram properly.

In this post: Mystery: What is going on with this Insert Size Metrics Histogram, I can see both FR and RF in the histogram, but not in mine.

Please guide for the possible explanations.

Thanks!enter image description here

picard bam paired

The post you're linking to was asking why such an odd thing was being observed. Do you expect mate-pair style reads for some reason?

I am interested to compute all parameters and alignment statistics for my aligned bam files (Whole exomes: comparative analysis ) and one of them was inner mate distance between paired reads. I was looking for the explanation of histogram and came across with the linked post. I assume FR=forward read and RF=reverse read, but why the program does not show RF and only FR. What is the significance of this?

FR would be the normal orientation for illumina reads, RF is the orientation for mate-pairs, where the reads point away from each other. Those should normally not exist unless you have mate-pair libraries (you don't).

2 answers

You can calculate insert size distribution with BBMap following @Brian's answer in this thread: How to calculate the Average Insert Size after mapping the reads to the reference genome using BWA

In addition to BBMap and Picard, you can use bamPEFragmentSize from deepTools to conveniently get fragment size metrics.

For the inner size, just subtract the read length from insert size. E.g.

Insert size = 400

Library = 2x150bp

Inner size = 400-2*150 = 100

Log in to answer this question.