Question: insert size via bamtools stats inner or outer ?
gravatar for Siva
3.9 years ago by
Siva20 wrote:

Hi guys, 

I've a doubt about the meaning of "insert size" from bamtools stats.
I've done this : "bamtools stats -in $1 -insert" input is a bam produced with read1.fastq and read2.fastq (bwa), in each file reads' length is 100 b

and got an insert size of 241 so i supposed it's outer size = R1+R2+insert 


Stats for BAM file(s):
Total reads:       820130832 ...

Average insert size (absolute value): 309.402
Median insert size (absolute value): 241


Advance thanks, 


insert bamtools stat • 1.8k views
ADD COMMENTlink modified 5 months ago by Biostar ♦♦ 20 • written 3.9 years ago by Siva20

Relevant resource:

ADD REPLYlink written 3.9 years ago by RamRS20k
gravatar for Zev.Kronenberg
3.8 years ago by
United States
Zev.Kronenberg11k wrote:

test it:


// if the alignment is downstream of mate then you can get the end position of the read.

if(al.Position > al.MatePosition){

int outter = abs(al.MatePosition - al.GetEndPosition());

int inner = al.InsertSize;

if(outter != inner){

cerr << "insert length is inner" << end;



ADD COMMENTlink modified 3.8 years ago • written 3.8 years ago by Zev.Kronenberg11k
Please log in to add an answer.


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