R/AllGenerics.R
, R/Structstrings-conversion.R
getBasePairing.Rd
getBasePairing
converts a dot bracket annotation from a
DotBracketString
into a base pair table as
DotBracketDataFrame
. Base pairing is indicated by corresponding
numbers in the forward and reverse columns.
getDotBracket
converts the dot bracket annotation from a
DotBracketDataFrame
into a DotBracketString
. If
the character
colums is populated, the information from this column
will be used. If this is not desired set force = TRUE
. However ,
beaware that this will result in a dot bracket annotation, which does not
necessarilly matches the original dot bracket string it may have been
created from. It is rather the dot bracket string with the lowest number of
different loops and it will use the different dot bracket annotations one
after another. Example: "(((<<<>>>)))" will be returned as
(((((())))))
. (((<<<)))>>>
will be returned as
(((<<<)))>>>
, ((([[[)))]]]
will be eturned as
(((<<<)))>>>
.
getLoopIndices
converts the dot bracket annotation from a
DotBracketString
or DotBracketDataFrame
into a
LoopIndexList
.
getBasePairing(x, compress = TRUE, return.sequence = FALSE)
getDotBracket(x, force = FALSE)
getLoopIndices(x, bracket.type, warn.type.drops = TRUE)
# S4 method for class 'DotBracketString'
getBasePairing(x)
# S4 method for class 'DotBracketStringSet'
getBasePairing(x, compress = TRUE)
# S4 method for class 'DotBracketDataFrame'
getDotBracket(x, force = FALSE)
# S4 method for class 'DotBracketDataFrameList'
getDotBracket(x, force = FALSE)
# S4 method for class 'SimpleSplitDotBracketDataFrameList'
getDotBracket(x, force = FALSE)
# S4 method for class 'CompressedSplitDotBracketDataFrameList'
getDotBracket(x, force = FALSE)
# S4 method for class 'DotBracketString'
getLoopIndices(x, bracket.type, warn.type.drops = TRUE)
# S4 method for class 'DotBracketStringSet'
getLoopIndices(x, bracket.type, warn.type.drops = TRUE)
# S4 method for class 'DotBracketDataFrame'
getLoopIndices(x, bracket.type, warn.type.drops = TRUE)
# S4 method for class 'DotBracketDataFrameList'
getLoopIndices(x, bracket.type, warn.type.drops = TRUE)
# S4 method for class 'SimpleSplitDotBracketDataFrameList'
getLoopIndices(x, bracket.type, warn.type.drops = TRUE)
# S4 method for class 'CompressedSplitDotBracketDataFrameList'
getLoopIndices(x, bracket.type, warn.type.drops = TRUE)
a DotBracketString
or
DotBracketStringSet
object
getBasePairing
: whether to return a
CompressedSplitDotBracketDataFrameList
or a
SimpleSplitDotBracketDataFrameList
if the input is a StructuredXStringSet
:
TRUE
(default) or FALSE
: Whether the sequence should be
returned in the base
column.
getDotBracket
: Should the dot bracket string be
generated from the base pairing, if the character
column is present?
getLoopIndices
: Which dot bracket annotation type
should be converted into loop indices? Only usable, if more than one is
present. (1L = '()', 2L = '<>', 3L = '[]', 4L = '{}'
)
getLoopIndices
: TRUE
(default) or
FALSE
: Warn if more than one dot bracket annotation type is present
in the input?
getBasePairing
:
The result is a DotBracketDataFrame
with following columns:
pos, forward, reverse, character (and optionally the base column). If a
position is unpaired, forward and reverse will be 0
, otherwise it will
match the base paired positions.
getLoopIndices
: returns a LoopIndexList
.
data("dbs", package = "Structstrings")
# conversion
dbdf <- getBasePairing(dbs)
# ... and the round trip
dbs <- getDotBracket(dbdf)
# loop indices per bracket type
loopids <- getLoopIndices(dbs)
# choose the bracket type manually, if necessary
loopids <- getLoopIndices(dbs, bracket.type = 1L)
# do not show warning if mulitple bracket types are present
loopids <- getLoopIndices(dbs, bracket.type = 1L, warn.type.drops = FALSE)