set2Dt {XNAString} | R Documentation

## set2Dt function - changes XNAStringSet object to data.table

### Description

set2Dt function - changes XNAStringSet object to data.table

### Usage

    set2Dt(
      obj,
      slots = c("name", "base", "sugar", "backbone", "target", "secondary_structure",
        "conjugate5", "conjugate3")
    )

### Arguments

`obj` | XNAStringSet object
`slots` | slots that are saved as column names (possibilities: "name", "base", "sugar", "backbone", "target", "conjugate5", "conjugate3" and "dictionary" )

### Value

data.table

### Examples

    my_dic <- data.table::data.table(type = c(rep('base',3),
                                              rep('sugar',2),
                                              rep('backbone',3)),
                                     symbol = c('G', 'E', 'A', 'F',
                                                'O', 'S', 'B', 'X'))
    obj2 <- XNAString(name = 'b',
                      base = 'GGE',
                      sugar = 'FFO',
                      dictionary = my_dic)
    obj3 <- XNAString(name = 'b',
                      base = c('GGE','EEE'),
                      sugar = c('FFO', 'OOO'),
                      dictionary = my_dic)
    XNAStringSetObj <- XNAStringSet(objects=list(obj2, obj3))
    set2Dt(XNAStringSetObj, c('base', 'sugar'))

    my_dic <- data.table::data.table(
      type = c(
        rep("base", 3),
        rep("sugar", 2),
        rep("backbone", 3)
      ),
      symbol = c("G", "E", "A", "F", "O", "S", "B", "X")
    )
    obj2 <- XNAString(
      name = "b",
      base = "GGE",
      sugar = "FFO",
      dictionary = my_dic
    )
    obj3 <- XNAString(
      name = "b",
      base = c("GGE", "EEE"),
      sugar = c("FFO", "OOO"),
      dictionary = my_dic
    )
    XNAStringSetObj <- XNAStringSet(objects = list(obj2, obj3))
    set2Dt(XNAStringSetObj, c("base", "sugar"))

[Package XNAString version 1.2.2 Index]