The DotBracketDataFrame and DotBracketDFrame object is derived from the DataFrame and DFrame classes. DotBracketDataFrame implents the concept and can be used to implement other backends than the in-memory one as done by DotBracketDFrame.

The DotBracketDataFrameList is implemented analogous, which is also available as CompressedSplitDotBracketDataFrameList. Since the names are quite long, the following short cut functions are available for object creation: DBDF, DBDFL and SDBDFL.

The DotBracketDataFrame can only contain 5 columns, which are named pos, forward, reverse, character and base. The last two columns are optional. The type of the first three has to be integer, whereas the fourth is a character and fifth is a XStringSet column.

Upon creation and modification, the validity of the contained base pairing information is checked. If the information is not correct, an error is thrown.

DotBracketDataFrame(..., row.names = NULL)

DBDF(...)

DotBracketDataFrameList(...)

DBDFL(...)

SplitDotBracketDataFrameList(..., compress = TRUE, cbindArgs = FALSE)

SDBDFL(..., compress = TRUE, cbindArgs = FALSE)

Arguments

...

for DotBracketDataFrame the input vectors and for DotBracketDataFrameList the DataFrame or the DotBracketDataFrame objects.

row.names

See DataFrame

compress

If compress = TRUE, returns a CompressedSplitDotBracketDataFrameList else returns a SimpleSplitDotBracketDataFrameList.

cbindArgs

If cbindArgs = FALSE, the ... arguments are coerced to DotBracketDataFrame objects and concatenated to form the result. If cbindArgs = TRUE, the arguments are combined as columns. The arguments must then be the same length, with each element of an argument mapping to an element in the result.

Value

a DotBracketDataFrame* object.

Examples

# Manual creation
df <- DataFrame(pos = c(1,2,3,4,5,6),
                forward = c(6,5,0,0,2,1),
                reverse = c(1,2,0,0,5,6))
# Either works
dbdf <- as(df,"DotBracketDataFrame")
dbdf <- DotBracketDataFrame(df)
# With multiple input DataFrames a SplitDotBracketDataFrameList is returned
dbdfl <- DotBracketDataFrame(df,df,df,df)

# Creation from a DotBracketString object is probably more common
data("dbs", package = "Structstrings")
dbdfl <- getBasePairing(dbs)
# Elements are returned as DotBracketDataFrames
dbdfl[[1]]
#> DotBracketDataFrame with 72 rows and 4 columns
#>           pos   forward   reverse   character
#>     <integer> <integer> <integer> <character>
#> 1           1         1        71           (
#> 2           2         2        70           (
#> 3           3         3        69           (
#> 4           4         4        68           (
#> 5           5         5        67           (
#> ...       ...       ...       ...         ...
#> 68         68        68         4           )
#> 69         69        69         3           )
#> 70         70        70         2           )
#> 71         71        71         1           )
#> 72         72         0         0           .