RepeatFinder#
- class pytantan.RepeatFinder#
A repeat finder using the Tantan method.
- scoring_matrix#
The scoring matrix used to derive the likelihood ratio matrix, if any.
- Type:
- likelihood_matrix#
The likelihood ratio matrix used for scoring letter pairs in tandem repeats.
- Type:
- __init__(*args, **kwargs)#
- get_probabilities(sequence)#
Get the probabilities of being a repeat for each sequence position.
- mask_repeats(sequence, threshold=0.5, mask=None)#
Mask regions predicted as repeats in the given sequence.
- Parameters:
sequence (
stror byte-like object) – The sequence containing the repeats to mask.threshold (
float) – The probability threshold above which to mask sequence characters.mask (
strorNone) – A single mask character to use for masking positions. IfNonegiven, masking uses the lowercase letters of the original sequence.
- Returns:
str– The input sequence with repeat regions masked.
Example
>>> matrix = ScoringMatrix( ... [[ 1, -1, -1, -1], ... [-1, 1, -1, -1], ... [-1, -1, 1, -1], ... [-1, -1, -1, 1]], ... alphabet="ACGT", ... ) >>> tantan = RepeatFinder(matrix) >>> tantan.mask_repeats("ATTATTATTATTATT") 'ATTattattattatt' >>> tantan.mask_repeats("ATTATTATTATTATT", mask='N') 'ATTNNNNNNNNNNNN'