def identity_avg(aseq, bseq):
match = identity_abs(aseq, bseq)<EOL>alen = len(aseq.replace('<STR_LIT:->', '<STR_LIT>').replace('<STR_LIT:.>', '<STR_LIT>'))<EOL>blen = len(bseq.replace('<STR_LIT:->', '<STR_LIT>').replace('<STR_LIT:.>', '<STR_LIT>'))<EOL>avg_len = <NUM_LIT:0.5> * (alen + blen)<EOL>return match / avg_len<EOL>
Compute absolute identity (# matching sites) between sequence strings.