This function is primarily for internal use, but we export it
to document the underlying logic.
For example FindMaxRepeatDel("xyaczt", "ac", 3)
returns 0.
If
substr(context, pos, pos + nchar(rep.unit.seq) - 1) != rep.unit.seq
then stop.
If this functions returns 0, then it is necessary to
look for microhomology using the function
FindDelMH
.
Warning
This function depends on the variant caller having
"aligned" the deletion within the context of the
repeat.
For example, a deletion of CAG
in the repeat
GTCAGCAGCATGT
can have 3 "aligned" representations as follows:
CT---CAGCAGGT
CTCAG---CAGGT
CTCAGCAG---GT
In these cases this function will return 2. (Please
not that the return value does not include the
rep.uni.seq
in the count.)
However, the same deletion can also have an "unaligned" representation, such as
CTCAGC---AGGT
(a deletion of AGC
).
In this case this function will return 1 (a deletion of AGC
in a 2-element repeat of AGC
).