Normal form of tandem sequence
tandemNormalForm.Rd
Computes the lexicographically smallest rotation of a tandem repeat base unit.
Usage
tandemNormalForm(seq, strand = c("forward", "reverse", "both"))
# S4 method for character
tandemNormalForm(seq, strand = c("forward", "reverse", "both"))
# S4 method for factor
tandemNormalForm(seq, strand = c("forward", "reverse", "both"))
# S4 method for DNAStringSet
tandemNormalForm(seq, strand = c("forward", "reverse", "both"))
# S4 method for DNAString
tandemNormalForm(seq, strand = c("forward", "reverse", "both"))
Examples
telomeres <- c("TAAGGG", "CCCTTA")
tandemNormalForm(telomeres)
#> [1] "AAGGGT" "ACCCTT"
tandemNormalForm(telomeres, strand="reverse")
#> [1] "ACCCTT" "AAGGGT"
tandemNormalForm(telomeres, strand="both")
#> [1] "AAGGGT" "AAGGGT"
tandemNormalForm(factor(telomeres), strand="both") # Should return a factor
#> [1] AAGGGT AAGGGT
#> Levels: AAGGGT
tandemNormalForm(Biostrings::DNAStringSet(telomeres), strand="both") # Should return a DNAStringSet
#> DNAStringSet object of length 2:
#> width seq
#> [1] 6 AAGGGT
#> [2] 6 AAGGGT