convertAnnotation converts a type of dot bracket annotation into another. This only works if the original bracket type is present and the target bracket type is not.

convertAnnotation(x, from, to)

# S4 method for class 'DotBracketString'
convertAnnotation(x, from, to)

# S4 method for class 'DotBracketStringSet'
convertAnnotation(x, from, to)

# S4 method for class 'DotBracketStringSetList'
convertAnnotation(x, from, to)

Arguments

x

a DotBracketString, DotBracketStringSet or DotBracketStringSetList

from

which annotation type should be converted? Must be one of the following values: 1L = '()', 2L = '<>', 3L = '[]', 4L = '{}' and must be present in the input.

to

Into which annotation type should the selected one be converted? Must be one of the following values: 1L = '()', 2L = '<>', 3L = '[]', 4L = '{}'. Must not be present in the input.

Value

The modified input object, a DotBracketString* object.

Examples

str <- "((.))..[[..]]...{{..}}......."
dbs <- DotBracketString(str)
convertAnnotation(dbs, 1L, 2L)
#> 29-letter DotBracketString object
#> seq: <<.>>..[[..]]...{{..}}.......