I am confused with how to calculate the expected insert size when using IGV software seeing red or blue color marked paired-end NGS reads,I have known that observed insert size means observed template length which is calculated similar with the TLEN in bam file,and it refer to the length of insert size by mapping the reads to reference sequence .But the expected insert size is the length of fragment where paired-end reads come from,described like A: What is the different between Read and Fragment in RNA-seq? .Because the length between two reads (inner distance in the picture in above URL)is unknown so how could we expect the length of fragment of paired-end reads?I have seen some related post but can not find what I want, I would appreciate if someone could give me some help.
IGV is not going to calculate the insert size. It will give you a rough idea of what it may be if you right click on the alignment display and choose the "show as pairs" option.
If you want to calculate insert sizes then use BBMap as noted here: C: Target fragment size versus final insert size