The functions are implemented as defined in the Biostrings package. Have
a look the MaskedXString
class.
# S4 method for MaskedModString
seqtype(x)
a ModString
object.
a MaskedModString
object.
# Mask positions
mask <- Mask(mask.width=5, start=c(2), width=c(3))
mr <- ModRNAString("ACGU7")
mr
#> 5-letter ModRNAString object
#> seq: ACGU7
masks(mr) <- mask
mr
#> 5-letter MaskedModRNAString object (# for masking)
#> seq: A###7
#> masks:
#> maskedwidth maskedratio active
#> 1 3 0.6 TRUE
# Invert masks
mr <- gaps(mr)
mr
#> 5-letter MaskedModRNAString object (# for masking)
#> seq: #CGU#
#> masks:
#> maskedwidth maskedratio active
#> 1 2 0.4 TRUE
# Drop the mask
masks(mr) <- NULL
mr
#> 5-letter ModRNAString object
#> seq: ACGU7