I was trying to identify the insert size between paired reads. When using pysam template_length
will do the work, I was confused with reference_length
aligned length of the read on the reference genome. This is equal to aend - pos. Returns None if not available.
I thought that either they will be same value or close, but this is what I got:
template_length reference_length
6 128
6 148
920 148
920 147
151 148
151 148
74 74
925 148
why some reads have big difference?
Thanks,
I think the difference is in in softclips: your template is longer than what is aligned to the reference there. Could that explain what you see?
Actually I see both, some times template shorter sometimes the other way around.
Maybe this related discussion helps? Fragment Size: TLEN vs. isize
Both
tlen
andisize
deprecated now usingtemplate_length
. but this have no relation withreference_length
which is equals toreference_end - reference_start
TLEN is template length, no? Also are your aligned reads spliced or not?
Yes Tlen is template_length.
No reads are not spliced