Skip to contents

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"))

Arguments

seq

tandem repeat base unit sequence

strand

With strand to consider

Value

Returns normal forms of the tandem unit sequences, in the same class as the input.

Author

Charles Plessy

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