This is a test version of Biostars. For the public version, visit https://www.biostars.org.
insert size via bamtools stats inner or outer ?

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,
Siva

stat bamtools insert

1 answer

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;
}

Log in to answer this question.