Title: | Efficient Manipulation of Modified Oligonucleotide Sequences |
---|---|
Description: | The XNAString package allows for description of base sequences and associated chemical modifications in a single object. XNAString is able to capture single stranded, as well as double stranded molecules. Chemical modifications are represented as independent strings associated with different features of the molecules (base sequence, sugar sequence, backbone sequence, modifications) and can be read or written to a HELM notation. It also enables secondary structure prediction using RNAfold from ViennaRNA. XNAString is designed to be efficient representation of nucleic-acid based therapeutics, therefore it stores information about target sequences and provides interface for matching and alignment functions from Biostrings and pwalign packages. |
Authors: | Anna Górska [aut], Marianna Plucinska [aut, cre], Lykke Pedersen [aut], Lukasz Kielpinski [aut], Disa Tehler [aut], Peter H. Hagedorn [aut] |
Maintainer: | Marianna Plucinska <[email protected]> |
License: | GPL-2 |
Version: | 1.15.0 |
Built: | 2024-11-30 05:52:58 UTC |
Source: | https://github.com/bioc/XNAString |
XNAAlphabetFrequency returns letters frequency for a given object in base, sugar or backbone slot
XNAAlphabetFrequency method returns alphabet frequency for a given object. It works for 3 slots: base, sugar and backbone. If matrix_nbr equals 1, alphabet frequency for the first elements in the slot is returned. Letters can be given as argument, otherwise unique letters in object's dictionary are in use.
XNAAlphabetFrequencyFun( obj, slot, letters = NA, matrix_nbr = 1, as.prob = FALSE, base_only = FALSE ) XNAAlphabetFrequency( obj, slot, letters = NA, matrix_nbr = 1, as.prob = FALSE, base_only = FALSE, ... ) ## S4 method for signature 'XNAString' XNAAlphabetFrequency( obj, slot, letters = NA, matrix_nbr = 1, as.prob = FALSE, base_only = FALSE ) ## S4 method for signature 'XNAStringSet' XNAAlphabetFrequency( obj, slot, letters = NA, matrix_nbr = 1, as.prob = FALSE, base_only = FALSE )
XNAAlphabetFrequencyFun( obj, slot, letters = NA, matrix_nbr = 1, as.prob = FALSE, base_only = FALSE ) XNAAlphabetFrequency( obj, slot, letters = NA, matrix_nbr = 1, as.prob = FALSE, base_only = FALSE, ... ) ## S4 method for signature 'XNAString' XNAAlphabetFrequency( obj, slot, letters = NA, matrix_nbr = 1, as.prob = FALSE, base_only = FALSE ) ## S4 method for signature 'XNAStringSet' XNAAlphabetFrequency( obj, slot, letters = NA, matrix_nbr = 1, as.prob = FALSE, base_only = FALSE )
obj |
XNAString or XNAStringSet class |
slot |
string (slot name: base, sugar or backbone) |
letters |
character (or character vector) |
matrix_nbr |
numeric (1 or 2, if 1 - first slot's element is use, if 2 - 2nd element in slot) |
as.prob |
logical - if TRUE frequency returned as probability of occurence |
base_only |
logical - if TRUE, frequency checked for 'A', 'C', 'G', 'T', other |
... |
optional arguments to generic function to support additional methods |
matrix (frequency matrix for a given slot)
xnastring_obj <- XNAString( name = "b", base = c("AACC", "GGEE"), sugar = c("FFOO", "OODD") ) XNAAlphabetFrequency(obj = xnastring_obj, slot = "base") XNAAlphabetFrequency(obj = xnastring_obj, slot = "base", as.prob = TRUE) XNAAlphabetFrequency(obj = xnastring_obj, slot = "base", base_only = TRUE) XNAAlphabetFrequency(obj = xnastring_obj, slot = "base", letters = c("A", "C")) XNAAlphabetFrequency(obj = xnastring_obj, slot = "base", matrix_nbr = 2) xnastring_obj_2 <- XNAString( base = c("ATCG"), sugar = c("FODD"), backbone = c("SBB") ) XNAStringSet_obj <- XNAStringSet(objects = list( xnastring_obj, xnastring_obj_2 )) XNAAlphabetFrequency(XNAStringSet_obj, "sugar")
xnastring_obj <- XNAString( name = "b", base = c("AACC", "GGEE"), sugar = c("FFOO", "OODD") ) XNAAlphabetFrequency(obj = xnastring_obj, slot = "base") XNAAlphabetFrequency(obj = xnastring_obj, slot = "base", as.prob = TRUE) XNAAlphabetFrequency(obj = xnastring_obj, slot = "base", base_only = TRUE) XNAAlphabetFrequency(obj = xnastring_obj, slot = "base", letters = c("A", "C")) XNAAlphabetFrequency(obj = xnastring_obj, slot = "base", matrix_nbr = 2) xnastring_obj_2 <- XNAString( base = c("ATCG"), sugar = c("FODD"), backbone = c("SBB") ) XNAStringSet_obj <- XNAStringSet(objects = list( xnastring_obj, xnastring_obj_2 )) XNAAlphabetFrequency(XNAStringSet_obj, "sugar")
Getter methods enable extraction of single slots from XNAString and XNAStringSet objects. E.g. name method extracts name slot from XNAString/XNAStringSet object.
backbone(x, ...) ## S4 method for signature 'XNAString' backbone(x) ## S4 method for signature 'XNAStringSet' backbone(x, i = 1) backbone(x, ...) <- value ## S4 replacement method for signature 'XNAString' backbone(x) <- value ## S4 replacement method for signature 'XNAStringSet' backbone(x, i = 1) <- value
backbone(x, ...) ## S4 method for signature 'XNAString' backbone(x) ## S4 method for signature 'XNAStringSet' backbone(x, i = 1) backbone(x, ...) <- value ## S4 replacement method for signature 'XNAString' backbone(x) <- value ## S4 replacement method for signature 'XNAStringSet' backbone(x, i = 1) <- value
x |
XNAString/XNAStringSet object |
... |
optional arguments to generic function to support additional methods |
i |
numeric - possibilities: 1 or 2. If 1 - 1st slots elements printed out, 2nd otherwise. In case the second element is not in the object, empty char created. This parameter is only available for XNAStringSet objects. |
value |
character vector applied only for setter method |
Setter methods enable overwriting single slots from XNAString and XNAStringSet objects. E.g. name<- method overwrites existing name slot
vector in getter method, XNAStringSet object (with replaced name slot) in setter method
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") ) obj <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) backbone(obj)
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") ) obj <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) backbone(obj)
Getter methods enable extraction of single slots from XNAString and XNAStringSet objects. E.g. name method extracts name slot from XNAString/XNAStringSet object.
base(x, ...) ## S4 method for signature 'XNAString' base(x) ## S4 method for signature 'XNAStringSet' base(x, i = 1) base(x, ...) <- value ## S4 replacement method for signature 'XNAString' base(x) <- value ## S4 replacement method for signature 'XNAStringSet' base(x, i = 1) <- value
base(x, ...) ## S4 method for signature 'XNAString' base(x) ## S4 method for signature 'XNAStringSet' base(x, i = 1) base(x, ...) <- value ## S4 replacement method for signature 'XNAString' base(x) <- value ## S4 replacement method for signature 'XNAStringSet' base(x, i = 1) <- value
x |
XNAString/XNAStringSet object |
... |
optional arguments to generic function to support additional methods |
i |
numeric - possibilities: 1 or 2. If 1 - 1st slots elements printed out, 2nd otherwise. In case the second element is not in the object, empty char created. This parameter is only available for XNAStringSet objects. |
value |
character vector applied only for setter method |
Setter methods enable overwriting single slots from XNAString and XNAStringSet objects. E.g. name<- method overwrites existing name slot
vector in getter method, XNAStringSet object (with replaced name slot) in setter method
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") ) obj <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) base(obj)
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") ) obj <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) base(obj)
Translate base slot based on complementary bases dictionary. Base sequence in transformed using compl_target column.
changeBase(compl_dict, bases)
changeBase(compl_dict, bases)
compl_dict |
complementary bases dictionary |
bases |
string, one or two-elements vector |
string
Getter methods enable extraction of single slots from XNAString and XNAStringSet objects. E.g. name method extracts name slot from XNAString/XNAStringSet object.
compl_dictionary(x, ...) ## S4 method for signature 'XNAString' compl_dictionary(x) compl_dictionary(x, ...) <- value ## S4 replacement method for signature 'XNAString' compl_dictionary(x) <- value
compl_dictionary(x, ...) ## S4 method for signature 'XNAString' compl_dictionary(x) compl_dictionary(x, ...) <- value ## S4 replacement method for signature 'XNAString' compl_dictionary(x) <- value
x |
XNAString/XNAStringSet object |
... |
optional arguments to generic function to support additional methods |
value |
character vector applied only for setter method |
Setter methods enable overwriting single slots from XNAString and XNAStringSet objects. E.g. name<- method overwrites existing name slot
vector in getter method, XNAStringSet object (with replaced name slot) in setter method
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") ) obj <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) compl_dictionary(obj)
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") ) obj <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) compl_dictionary(obj)
A dataset containing default internal XNAString dictionary with base complemetary.
data(complementary_bases)
data(complementary_bases)
A data.table with 6 rows and 3 variables:
base symbol
complementary base
complementary target
RMR internal bioinformatics database (Mimir)
Concatenate HELM-symbol custom dictionary with built-in HELM-symbol dictionary (xna_dictionary)
concatDict( custom_dict, default_dict = xna_dictionary, helm_colname = "HELM", type_colname = "type", symbol_colname = "symbol" )
concatDict( custom_dict, default_dict = xna_dictionary, helm_colname = "HELM", type_colname = "type", symbol_colname = "symbol" )
custom_dict |
custom HELM-symbol dictionary |
default_dict |
built-in HELM-symbol dictionary (xna_dictionary) |
helm_colname |
helm column name in custom dictionary |
type_colname |
type column name in custom dictionary |
symbol_colname |
symbol column name in custom dictionary |
data.table
my_dict <- data.table::data.table( HELM = c("[[B]]"), type = c("base"), symbol = c("B") ) concatDict(my_dict)
my_dict <- data.table::data.table( HELM = c("[[B]]"), type = c("base"), symbol = c("B") ) concatDict(my_dict)
Getter methods enable extraction of single slots from XNAString and XNAStringSet objects. E.g. name method extracts name slot from XNAString/XNAStringSet object.
conjugate3(x, ...) ## S4 method for signature 'XNAString' conjugate3(x) ## S4 method for signature 'XNAStringSet' conjugate3(x, i = 1) conjugate3(x, ...) <- value ## S4 replacement method for signature 'XNAString' conjugate3(x) <- value ## S4 replacement method for signature 'XNAStringSet' conjugate3(x, i = 1) <- value
conjugate3(x, ...) ## S4 method for signature 'XNAString' conjugate3(x) ## S4 method for signature 'XNAStringSet' conjugate3(x, i = 1) conjugate3(x, ...) <- value ## S4 replacement method for signature 'XNAString' conjugate3(x) <- value ## S4 replacement method for signature 'XNAStringSet' conjugate3(x, i = 1) <- value
x |
XNAString/XNAStringSet object |
... |
optional arguments to generic function to support additional methods |
i |
numeric - possibilities: 1 or 2. If 1 - 1st slots elements printed out, 2nd otherwise. In case the second element is not in the object, empty char created. This parameter is only available for XNAStringSet objects. |
value |
character vector applied only for setter method |
Setter methods enable overwriting single slots from XNAString and XNAStringSet objects. E.g. name<- method overwrites existing name slot
vector in getter method, XNAStringSet object (with replaced name slot) in setter method
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") ) obj <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) conjugate3(obj)
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") ) obj <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) conjugate3(obj)
Getter methods enable extraction of single slots from XNAString and XNAStringSet objects. E.g. name method extracts name slot from XNAString/XNAStringSet object.
conjugate5(x, ...) ## S4 method for signature 'XNAString' conjugate5(x) ## S4 method for signature 'XNAStringSet' conjugate5(x, i = 1) conjugate5(x, ...) <- value ## S4 replacement method for signature 'XNAString' conjugate5(x) <- value ## S4 replacement method for signature 'XNAStringSet' conjugate5(x, i = 1) <- value
conjugate5(x, ...) ## S4 method for signature 'XNAString' conjugate5(x) ## S4 method for signature 'XNAStringSet' conjugate5(x, i = 1) conjugate5(x, ...) <- value ## S4 replacement method for signature 'XNAString' conjugate5(x) <- value ## S4 replacement method for signature 'XNAStringSet' conjugate5(x, i = 1) <- value
x |
XNAString/XNAStringSet object |
... |
optional arguments to generic function to support additional methods |
i |
numeric - possibilities: 1 or 2. If 1 - 1st slots elements printed out, 2nd otherwise. In case the second element is not in the object, empty char created. This parameter is only available for XNAStringSet objects. |
value |
character vector applied only for setter method |
Setter methods enable overwriting single slots from XNAString and XNAStringSet objects. E.g. name<- method overwrites existing name slot
vector in getter method, XNAStringSet object (with replaced name slot) in setter method
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") ) obj <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) conjugate5(obj)
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") ) obj <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) conjugate5(obj)
Getter methods enable extraction of single slots from XNAString and XNAStringSet objects. E.g. name method extracts name slot from XNAString/XNAStringSet object.
default_backbone(x, ...) ## S4 method for signature 'XNAString' default_backbone(x) ## S4 method for signature 'XNAStringSet' default_backbone(x) default_backbone(x, ...) <- value ## S4 replacement method for signature 'XNAString' default_backbone(x) <- value
default_backbone(x, ...) ## S4 method for signature 'XNAString' default_backbone(x) ## S4 method for signature 'XNAStringSet' default_backbone(x) default_backbone(x, ...) <- value ## S4 replacement method for signature 'XNAString' default_backbone(x) <- value
x |
XNAString/XNAStringSet object |
... |
optional arguments to generic function to support additional methods |
value |
character vector applied only for setter method |
Setter methods enable overwriting single slots from XNAString and XNAStringSet objects. E.g. name<- method overwrites existing name slot
vector in getter method, XNAStringSet object (with replaced name slot) in setter method
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") ) obj <- XNAString( name = "b", base = "GGE", default_sugar = 'F', default_backbone = 'X', dictionary = my_dic ) default_backbone(obj)
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") ) obj <- XNAString( name = "b", base = "GGE", default_sugar = 'F', default_backbone = 'X', dictionary = my_dic ) default_backbone(obj)
Getter methods enable extraction of single slots from XNAString and XNAStringSet objects. E.g. name method extracts name slot from XNAString/XNAStringSet object.
default_sugar(x, ...) ## S4 method for signature 'XNAString' default_sugar(x) ## S4 method for signature 'XNAStringSet' default_sugar(x) default_sugar(x, ...) <- value ## S4 replacement method for signature 'XNAString' default_sugar(x) <- value
default_sugar(x, ...) ## S4 method for signature 'XNAString' default_sugar(x) ## S4 method for signature 'XNAStringSet' default_sugar(x) default_sugar(x, ...) <- value ## S4 replacement method for signature 'XNAString' default_sugar(x) <- value
x |
XNAString/XNAStringSet object |
... |
optional arguments to generic function to support additional methods |
value |
character vector applied only for setter method |
Setter methods enable overwriting single slots from XNAString and XNAStringSet objects. E.g. name<- method overwrites existing name slot
vector in getter method, XNAStringSet object (with replaced name slot) in setter method
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") ) obj <- XNAString( name = "b", base = "GGE", default_sugar = 'F', default_backbone = 'X', dictionary = my_dic ) default_sugar(obj)
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") ) obj <- XNAString( name = "b", base = "GGE", default_sugar = 'F', default_backbone = 'X', dictionary = my_dic ) default_sugar(obj)
Getter methods enable extraction of single slots from XNAString and XNAStringSet objects. E.g. name method extracts name slot from XNAString/XNAStringSet object.
dictionary(x, ...) ## S4 method for signature 'XNAString' dictionary(x) dictionary(x, ...) <- value ## S4 replacement method for signature 'XNAString' dictionary(x) <- value
dictionary(x, ...) ## S4 method for signature 'XNAString' dictionary(x) dictionary(x, ...) <- value ## S4 replacement method for signature 'XNAString' dictionary(x) <- value
x |
XNAString/XNAStringSet object |
... |
optional arguments to generic function to support additional methods |
value |
character vector applied only for setter method |
Setter methods enable overwriting single slots from XNAString and XNAStringSet objects. E.g. name<- method overwrites existing name slot
vector in getter method, XNAStringSet object (with replaced name slot) in setter method
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") ) obj <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) dictionary(obj)
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") ) obj <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) dictionary(obj)
XNADinucleotideFrequencyFun returns double letters frequency for a given object in base, sugar or backbone slot
XNADinucleotideFrequency method returns dinucleotide frequency for a given object. It works for 3 slots: base, sugar and backbone. If matrix_nbr equals 1, dinucleotide frequency for the first elements in the slot is returned. Double letters can be given as argument, otherwise unique double letters in object's dictionary are in use.
XNADinucleotideFrequencyFun( obj, slot, double_letters = NA, matrix_nbr = 1, as.prob = FALSE, base_only = FALSE ) XNADinucleotideFrequency( obj, slot, double_letters = NA, matrix_nbr = 1, as.prob = FALSE, base_only = FALSE, ... ) ## S4 method for signature 'XNAString' XNADinucleotideFrequency( obj, slot, double_letters = NA, matrix_nbr = 1, as.prob = FALSE, base_only = FALSE ) ## S4 method for signature 'XNAStringSet' XNADinucleotideFrequency( obj, slot, double_letters = NA, matrix_nbr = 1, as.prob = FALSE, base_only = FALSE )
XNADinucleotideFrequencyFun( obj, slot, double_letters = NA, matrix_nbr = 1, as.prob = FALSE, base_only = FALSE ) XNADinucleotideFrequency( obj, slot, double_letters = NA, matrix_nbr = 1, as.prob = FALSE, base_only = FALSE, ... ) ## S4 method for signature 'XNAString' XNADinucleotideFrequency( obj, slot, double_letters = NA, matrix_nbr = 1, as.prob = FALSE, base_only = FALSE ) ## S4 method for signature 'XNAStringSet' XNADinucleotideFrequency( obj, slot, double_letters = NA, matrix_nbr = 1, as.prob = FALSE, base_only = FALSE )
obj |
XNAString or XNAStringSet class |
slot |
string (slot name: base, sugar or backbone) |
double_letters |
string (or string vector) - double letters |
matrix_nbr |
numeric (1 or 2, if 1 - first slot's element is use, if 2 - 2nd element in slot) |
as.prob |
logical - if TRUE frequency returned as probability of occurence |
base_only |
logical - if TRUE, frequency checked for 'A', 'C', 'G', 'T', other |
... |
optional arguments to generic function to support additional methods |
matrix (frequency matrix for a given slot)
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") ) xnastring_obj <- XNAString( name = "b", base = c("GGEG"), sugar = c("FFOO"), dictionary = my_dic ) XNAString::XNADinucleotideFrequency( obj = xnastring_obj, slot = "base", matrix_nbr = 1 )
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") ) xnastring_obj <- XNAString( name = "b", base = c("GGEG"), sugar = c("FFOO"), dictionary = my_dic ) XNAString::XNADinucleotideFrequency( obj = xnastring_obj, slot = "base", matrix_nbr = 1 )
Function which creates XNAstringSet object from table with base, sugar and backbone columns.
dt2Set( table, col.base = "base", col.sugar = "sugar", col.backbone = "backbone", col.target = "target", default_sugar = NA, default_backbone = NA, compl_dict = complementary_bases )
dt2Set( table, col.base = "base", col.sugar = "sugar", col.backbone = "backbone", col.target = "target", default_sugar = NA, default_backbone = NA, compl_dict = complementary_bases )
table |
data.table or data.frame (must incluse base, sugar and backbone columns) |
col.base |
character (name of base column) |
col.sugar |
character (name of sugar column) |
col.backbone |
character (name of backbone column) |
col.target |
character (name of target column) |
default_sugar |
character - only one letter. Will be replicated nchar(base) times |
default_backbone |
character - only one letter. Will be replicated nchar(base)-1 times |
compl_dict |
data.table with following columns: "base", "target". By default internal XNAString dictionary is used |
XNAStringSet object
dt <- data.table::data.table( base = c("TT", "GG"), sugar = c("FF", "FO"), backbone = c("S", "S") ) dt2Set(dt)
dt <- data.table::data.table( base = c("TT", "GG"), sugar = c("FF", "FO"), backbone = c("S", "S") ) dt2Set(dt)
Getter methods enable extraction of single slots from XNAString and XNAStringSet objects. E.g. name method extracts name slot from XNAString/XNAStringSet object.
duplex_structure(x, ...) ## S4 method for signature 'XNAString' duplex_structure(x) ## S4 method for signature 'XNAStringSet' duplex_structure(x) duplex_structure(x, ...) <- value ## S4 replacement method for signature 'XNAString' duplex_structure(x) <- value
duplex_structure(x, ...) ## S4 method for signature 'XNAString' duplex_structure(x) ## S4 method for signature 'XNAStringSet' duplex_structure(x) duplex_structure(x, ...) <- value ## S4 replacement method for signature 'XNAString' duplex_structure(x) <- value
x |
XNAString/XNAStringSet object |
... |
optional arguments to generic function to support additional methods |
value |
character vector applied only for setter method |
Setter methods enable overwriting single slots from XNAString and XNAStringSet objects. E.g. name<- method overwrites existing name slot
vector in getter method, XNAStringSet object (with replaced name slot) in setter method
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") ) obj <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) duplex_structure(obj)
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") ) obj <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) duplex_structure(obj)
This function translates RNA molecules encoded in HELM notation into multi-string notation. It uses dictionary which links HELM code for base, sugar and backbone elements with symbols used in multi-string notation.
helm2String(helm, dictionary = xna_dictionary, remove_linker = TRUE)
helm2String(helm, dictionary = xna_dictionary, remove_linker = TRUE)
helm |
string with HELM sequence, which contains one RNA polymer and optionally CHEM element |
dictionary |
data.table with following columns: "HELM", "type", "symbol". By default internal XNAString dictionary is used. |
remove_linker |
logical defines if linker should be clipped from RNA |
named list of strings with following elements: base, sugar, backbone, conjugate5, conjugate3
Marianna Plucinska
helm2String("RNA1{[dR](A)P.[dR](A)P.[dR](A)}$$$$V2.0")
helm2String("RNA1{[dR](A)P.[dR](A)P.[dR](A)}$$$$V2.0")
Check on an object type
instanceOf(object, type)
instanceOf(object, type)
object |
an object of any class |
type |
class of an object |
logical information. TRUE if object
class equals type
instanceOf(1, "numeric")
instanceOf(1, "numeric")
Save list of lists as data.table
listOflists2Dt(list_of_lists)
listOflists2Dt(list_of_lists)
list_of_lists |
list of lists that will be saved as data.table. |
data.table
nested_list <- list( list(base = c("T"), sugar = c("G")), list(base = c("U"), sugar = c("G")) ) listOflists2Dt(nested_list)
nested_list <- list( list(base = c("T"), sugar = c("G")), list(base = c("U"), sugar = c("G")) ) listOflists2Dt(nested_list)
Reformat mimir table to XNA dictionary standards
mimir2XnaDict(table, base.col, sugar.col, backbone.col)
mimir2XnaDict(table, base.col, sugar.col, backbone.col)
table |
data.table or data.frame (must incluse "HELM", "TS_BASE_SEQ", "TS_SUGAR_SEQ" and "TS_BACKBONE_SEQ" columns) |
base.col |
character (base column name) |
sugar.col |
character (sugar column name) |
backbone.col |
character (backbone column name) |
data.table (written in the xna_dictionary format)
dt <- data.table::data.table(HELM = c("([PPG])", "[fR]", "[srP]"), TS_BASE_SEQ = c("F", NA, NA), TS_SUGAR_SEQ = c(NA, NA, 'F'), TS_BACKBONE_SEQ = c(NA, 'S', NA)) mimir2XnaDict(dt, 'TS_BASE_SEQ', 'TS_SUGAR_SEQ', 'TS_BACKBONE_SEQ')
dt <- data.table::data.table(HELM = c("([PPG])", "[fR]", "[srP]"), TS_BASE_SEQ = c("F", NA, NA), TS_SUGAR_SEQ = c(NA, NA, 'F'), TS_BACKBONE_SEQ = c(NA, 'S', NA)) mimir2XnaDict(dt, 'TS_BASE_SEQ', 'TS_SUGAR_SEQ', 'TS_BACKBONE_SEQ')
Getter methods enable extraction of single slots from XNAString and XNAStringSet objects. E.g. name method extracts name slot from XNAString/XNAStringSet object.
name(x, ...) ## S4 method for signature 'XNAString' name(x) ## S4 method for signature 'XNAStringSet' name(x, i = 1) name(x, ...) <- value ## S4 replacement method for signature 'XNAString' name(x) <- value ## S4 replacement method for signature 'XNAStringSet' name(x, i = 1) <- value
name(x, ...) ## S4 method for signature 'XNAString' name(x) ## S4 method for signature 'XNAStringSet' name(x, i = 1) name(x, ...) <- value ## S4 replacement method for signature 'XNAString' name(x) <- value ## S4 replacement method for signature 'XNAStringSet' name(x, i = 1) <- value
x |
XNAString/XNAStringSet object |
... |
optional arguments to generic function to support additional methods |
i |
numeric - possibilities: 1 or 2. If 1 - 1st slots elements printed out, 2nd otherwise. In case the second element is not in the object, empty char created. This parameter is only available for XNAStringSet objects. |
value |
character vector applied only for setter method |
Setter methods enable overwriting single slots from XNAString and XNAStringSet objects. E.g. name<- method overwrites existing name slot
vector in getter method, XNAStringSet object (with replaced name slot) in setter method
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") ) obj <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) name(obj) 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") ) obj1 <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) obj2 <- XNAString( name = "b", base = c("GGE", "EEE"), sugar = c("FFO", "OOO"), dictionary = my_dic ) XNAStringSetObj <- XNAStringSet(objects = list(obj1, obj2)) name(XNAStringSetObj) 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") ) obj <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) name(obj) <- "new_name" 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") ) obj1 <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) obj2 <- XNAString( name = "b", base = c("GGE", "EEE"), sugar = c("FFO", "OOO"), dictionary = my_dic ) XNAStringSetObj <- XNAStringSet(objects = list(obj1, obj2)) name(XNAStringSetObj, 1) <- c("new1", "new2")
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") ) obj <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) name(obj) 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") ) obj1 <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) obj2 <- XNAString( name = "b", base = c("GGE", "EEE"), sugar = c("FFO", "OOO"), dictionary = my_dic ) XNAStringSetObj <- XNAStringSet(objects = list(obj1, obj2)) name(XNAStringSetObj) 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") ) obj <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) name(obj) <- "new_name" 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") ) obj1 <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) obj2 <- XNAString( name = "b", base = c("GGE", "EEE"), sugar = c("FFO", "OOO"), dictionary = my_dic ) XNAStringSetObj <- XNAStringSet(objects = list(obj1, obj2)) name(XNAStringSetObj, 1) <- c("new1", "new2")
Getter methods enable extraction of single slots from XNAStringSet objects. E.g. objects method extracts objects slot from XNAStringSet object. It is a list of XNAString objects.
objects(x, ...) ## S4 method for signature 'XNAStringSet' objects(x)
objects(x, ...) ## S4 method for signature 'XNAStringSet' objects(x)
x |
XNAStringSet object |
... |
optional arguments to generic function to support additional methods |
list of XNAString objects
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)) objects(XNAStringSetObj)
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)) objects(XNAStringSetObj)
Parse monomers from HELM to multi-string notation
parseRnaHelmComponent(rna_component, dictionary = xna_dictionary)
parseRnaHelmComponent(rna_component, dictionary = xna_dictionary)
rna_component |
list of monomers building RNA |
dictionary |
data.table with following columns: "HELM", "type", "symbol". By default internal XNAString dictionary is used. |
list of three strings: base, sugar, backbone
Marianna Plucinska
parseRnaHelmComponent(c("[dR](A)P", "[dR](A)P", "[dR](A)"))
parseRnaHelmComponent(c("[dR](A)P", "[dR](A)P", "[dR](A)"))
This function is a wrapper for RNAcofold from ViennaRNA package.
predictDuplexStructureFun(obj) predictDuplexStructure(obj, ...) ## S4 method for signature 'XNAString' predictDuplexStructure(obj)
predictDuplexStructureFun(obj) predictDuplexStructure(obj, ...) ## S4 method for signature 'XNAString' predictDuplexStructure(obj)
obj |
XNAString object |
... |
optional arguments to generic function to support additional methods |
list (structure and mfe)
obj1 <- XNAString( base = "ATCG", sugar = "FODD", conjugate3 = "TAG" ) predictDuplexStructure(obj1)
obj1 <- XNAString( base = "ATCG", sugar = "FODD", conjugate3 = "TAG" ) predictDuplexStructure(obj1)
This function is a wrapper for RNAfold from ViennaRNA package.
predictMfeStructureFun(obj) predictMfeStructure(obj, ...) ## S4 method for signature 'XNAString' predictMfeStructure(obj)
predictMfeStructureFun(obj) predictMfeStructure(obj, ...) ## S4 method for signature 'XNAString' predictMfeStructure(obj)
obj |
XNAString object |
... |
optional arguments to generic function to support additional methods |
character, secondary structure in dot-bracket notation
obj1 <- XNAString( base = "ATCG", sugar = "FODD", conjugate3 = "TAG" ) predictMfeStructure(obj1)
obj1 <- XNAString( base = "ATCG", sugar = "FODD", conjugate3 = "TAG" ) predictMfeStructure(obj1)
Reverse complement sequence based on dictionary
reverseComplementFun(obj)
reverseComplementFun(obj)
obj |
XNAString object |
string with reverse complement sequence
Getter methods enable extraction of single slots from XNAString and XNAStringSet objects. E.g. name method extracts name slot from XNAString/XNAStringSet object.
secondary_structure(x, ...) ## S4 method for signature 'XNAString' secondary_structure(x) ## S4 method for signature 'XNAStringSet' secondary_structure(x) secondary_structure(x, ...) <- value ## S4 replacement method for signature 'XNAString' secondary_structure(x) <- value
secondary_structure(x, ...) ## S4 method for signature 'XNAString' secondary_structure(x) ## S4 method for signature 'XNAStringSet' secondary_structure(x) secondary_structure(x, ...) <- value ## S4 replacement method for signature 'XNAString' secondary_structure(x) <- value
x |
XNAString/XNAStringSet object |
... |
optional arguments to generic function to support additional methods |
value |
character vector applied only for setter method |
Setter methods enable overwriting single slots from XNAString and XNAStringSet objects. E.g. name<- method overwrites existing name slot
vector in getter method, XNAStringSet object (with replaced name slot) in setter method
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") ) obj <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) secondary_structure(obj)
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") ) obj <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) secondary_structure(obj)
Create set of functions and methods to calculate alphabet frequency in base, sugar and backbone slots
seqAlphabetFrequency(unique_letters, seq, as.prob)
seqAlphabetFrequency(unique_letters, seq, as.prob)
unique_letters |
string (or character) - these letters pose column names |
seq |
string (or character) - frequency is calculated for this string |
as.prob |
logical - if TRUE frequency returned as probability of occurrence |
numeric - named numeric vector
seqAlphabetFrequency(c("A", "B", "C"), c("AABA"), as.prob = FALSE)
seqAlphabetFrequency(c("A", "B", "C"), c("AABA"), as.prob = FALSE)
Create set of functions and methods to calculate dinucleotide frequency in base, sugar and backbone slots
seqDinucleotideFrequency(unique_sets, seq, as.prob)
seqDinucleotideFrequency(unique_sets, seq, as.prob)
unique_sets |
string vector of double letters -these letters pose column names |
seq |
string (or character) - frequency is calculated for this string |
as.prob |
logical - if TRUE frequency returned as probability of occurrence |
numeric - named numeric vector
seqDinucleotideFrequency(c("AB", "BA", "CD"), "ABABAB", as.prob = FALSE) seqDinucleotideFrequency(c("GC", "CG", "CC"), "GCCG", as.prob = FALSE)
seqDinucleotideFrequency(c("AB", "BA", "CD"), "ABABAB", as.prob = FALSE) seqDinucleotideFrequency(c("GC", "CG", "CC"), "GCCG", as.prob = FALSE)
seqVectorAlphabetFrequency function calculates frequency for strings vector
seqVectorAlphabetFrequency(unique_letters, seq_vec, as.prob)
seqVectorAlphabetFrequency(unique_letters, seq_vec, as.prob)
unique_letters |
string (or character) - these letters pose column names |
seq_vec |
vector of strings (or characters) - frequency will be calculated for this vector |
as.prob |
logical - if TRUE frequency returned as probability of occurence |
matrix - each row denotes frequency for a specific string of vector
seqVectorAlphabetFrequency(c("A", "B", "C"), c("AABA", "BBBCCC"), as.prob = FALSE )
seqVectorAlphabetFrequency(c("A", "B", "C"), c("AABA", "BBBCCC"), as.prob = FALSE )
seqVectorDinucleotideFrequency function calculates frequency for strings vector
seqVectorDinucleotideFrequency(unique_sets, seq_vec, as.prob)
seqVectorDinucleotideFrequency(unique_sets, seq_vec, as.prob)
unique_sets |
string vector of double letters -these letters pose column names |
seq_vec |
vector of strings (or characters) - frequency will be calculated for this vector |
as.prob |
logical - if TRUE frequency returned as probability of occurence |
matrix - each row denotes frequency for a specific string of vector
seqVectorDinucleotideFrequency(c("AB", "BA", "CD"), c("ABABAB", "ABABCD"), as.prob = FALSE)
seqVectorDinucleotideFrequency(c("AB", "BA", "CD"), c("ABABAB", "ABABCD"), as.prob = FALSE)
set2Dt function - changes XNAStringSet object to data.table
set2Dt(obj, slots)
set2Dt(obj, slots)
obj |
XNAStringSet object |
slots |
slots that are saved as column names (possibilities: "name", "base", "sugar", "backbone", "target", "conjugate5", "conjugate3" and "dictionary" ) |
data.table
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"))
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"))
Define method to save XNAStringSet object as a list of XNAString objects
set2List(obj) ## S4 method for signature 'XNAStringSet' set2List(obj)
set2List(obj) ## S4 method for signature 'XNAStringSet' set2List(obj)
obj |
XNAStringSet object |
list of XNAString objects
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)) set2List(XNAStringSetObj)
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)) set2List(XNAStringSetObj)
siRNA_HELM function takes XNAString object and returns pairing information for base slot. Works only for double stranded molecules.
siRNA_HELM(xnastring_obj)
siRNA_HELM(xnastring_obj)
xnastring_obj |
XNAString object |
string
obj1 <- XNAString( base = c("CCCCUGCCGUGGUUCAUAA", "UUAUGAACCACGGCAGGGGCG"), sugar = c("OOFOFOFOFOFOFOFOFOF", "FFOFOFOFOFOFOFOFOFOFO"), backbone = c("OOOOOOOOOOOOOOOOOO", "OOOOOOOOOOOOOOOOOOOO"), conjugate3 = c("") ) siRNA_HELM(obj1)
obj1 <- XNAString( base = c("CCCCUGCCGUGGUUCAUAA", "UUAUGAACCACGGCAGGGGCG"), sugar = c("OOFOFOFOFOFOFOFOFOF", "FFOFOFOFOFOFOFOFOFOFO"), backbone = c("OOOOOOOOOOOOOOOOOO", "OOOOOOOOOOOOOOOOOOOO"), conjugate3 = c("") ) siRNA_HELM(obj1)
Getter methods enable extraction of single slots from XNAString and XNAStringSet objects. E.g. name method extracts name slot from XNAString/XNAStringSet object.
sugar(x, ...) ## S4 method for signature 'XNAString' sugar(x) ## S4 method for signature 'XNAStringSet' sugar(x, i = 1) sugar(x, ...) <- value ## S4 replacement method for signature 'XNAString' sugar(x) <- value ## S4 replacement method for signature 'XNAStringSet' sugar(x, i = 1) <- value
sugar(x, ...) ## S4 method for signature 'XNAString' sugar(x) ## S4 method for signature 'XNAStringSet' sugar(x, i = 1) sugar(x, ...) <- value ## S4 replacement method for signature 'XNAString' sugar(x) <- value ## S4 replacement method for signature 'XNAStringSet' sugar(x, i = 1) <- value
x |
XNAString/XNAStringSet object |
... |
optional arguments to generic function to support additional methods |
i |
numeric - possibilities: 1 or 2. If 1 - 1st slots elements printed out, 2nd otherwise. In case the second element is not in the object, empty char created. This parameter is only available for XNAStringSet objects. |
value |
character vector applied only for setter method |
Setter methods enable overwriting single slots from XNAString and XNAStringSet objects. E.g. name<- method overwrites existing name slot
vector in getter method, XNAStringSet object (with replaced name slot) in setter method
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") ) obj <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) sugar(obj)
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") ) obj <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) sugar(obj)
Getter methods enable extraction of single slots from XNAString and XNAStringSet objects. E.g. name method extracts name slot from XNAString/XNAStringSet object.
target(x, ...) ## S4 method for signature 'XNAString' target(x) ## S4 method for signature 'XNAStringSet' target(x, i = 1) target(x, ...) <- value ## S4 replacement method for signature 'XNAString' target(x) <- value ## S4 replacement method for signature 'XNAStringSet' target(x, i = 1) <- value
target(x, ...) ## S4 method for signature 'XNAString' target(x) ## S4 method for signature 'XNAStringSet' target(x, i = 1) target(x, ...) <- value ## S4 replacement method for signature 'XNAString' target(x) <- value ## S4 replacement method for signature 'XNAStringSet' target(x, i = 1) <- value
x |
XNAString/XNAStringSet object |
... |
optional arguments to generic function to support additional methods |
i |
numeric - possibilities: 1 or 2. If 1 - 1st slots elements printed out, 2nd otherwise. In case the second element is not in the object, empty char created. This parameter is only available for XNAStringSet objects. |
value |
character vector applied only for setter method |
Setter methods enable overwriting single slots from XNAString and XNAStringSet objects. E.g. name<- method overwrites existing name slot
vector in getter method, XNAStringSet object (with replaced name slot) in setter method
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") ) obj <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) target(obj)
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") ) obj <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) target(obj)
Check if all objects are of XNAString class and dictionaries are the same
typedListCheck(object)
typedListCheck(object)
object |
an object of any class. An object must contain 'objects' (list type) slot |
logical information. Checks the whole list of objects, TRUE if class of all objects equals 'XNAString' and their dictionaries are the same.
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)) typedListCheck(XNAStringSetObj)
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)) typedListCheck(XNAStringSetObj)
Utility functions useful when programming and developing XNAString class
uniqueChars(x)
uniqueChars(x)
x |
A string vector |
A list of vectors with unique characters found in x
string
uniqueChars("TRGFFTR") uniqueChars(c("TRGFFTR", "AATGRC"))
uniqueChars("TRGFFTR") uniqueChars(c("TRGFFTR", "AATGRC"))
A dataset containing default internal XNAString dictionary with HELM to string translation.
data(xna_dictionary)
data(xna_dictionary)
A data.table with 20 rows and 3 variables:
HELM sequence coding monomer
if element is coding base, sugar, backbone
single string translation of HELM
RMR internal bioinformatics database (Mimir)
This is function finding all the occurrences of a given pattern (typically short) in a (typically long) reference sequence
XNAMatchPattern( pattern, subject, target.number = 1, max.mismatch = 0, min.mismatch = 0, with.indels = FALSE, fixed = TRUE, algorithm = "auto" ) ## S4 method for signature 'XNAString,character' XNAMatchPattern( pattern, subject, target.number = 1, max.mismatch = 0, min.mismatch = 0, with.indels = FALSE, fixed = TRUE, algorithm = "auto" ) ## S4 method for signature 'XNAString,XString' XNAMatchPattern( pattern, subject, target.number = 1, max.mismatch = 0, min.mismatch = 0, with.indels = FALSE, fixed = TRUE, algorithm = "auto" )
XNAMatchPattern( pattern, subject, target.number = 1, max.mismatch = 0, min.mismatch = 0, with.indels = FALSE, fixed = TRUE, algorithm = "auto" ) ## S4 method for signature 'XNAString,character' XNAMatchPattern( pattern, subject, target.number = 1, max.mismatch = 0, min.mismatch = 0, with.indels = FALSE, fixed = TRUE, algorithm = "auto" ) ## S4 method for signature 'XNAString,XString' XNAMatchPattern( pattern, subject, target.number = 1, max.mismatch = 0, min.mismatch = 0, with.indels = FALSE, fixed = TRUE, algorithm = "auto" )
pattern |
XNAString object with non-empty target slot |
subject |
string or DNAString object |
target.number |
numeric - if target is a multi-element vector, then specify which element in use. 1 is the default |
max.mismatch |
The maximum number of mismatching letters allowed. If non-zero, an algorithm that supports inexact matching is used. |
min.mismatch |
The minimum number of mismatching letters allowed. If non-zero, an algorithm that supports inexact matching is used. |
with.indels |
If TRUE then indels are allowed. In that case, min.mismatch must be 0 and max.mismatch is interpreted as the maximum "edit distance" allowed between the pattern and a match. Note that in order to avoid pollution by redundant matches, only the "best local matches" are returned. Roughly speaking, a "best local match" is a match that is locally both the closest (to the pattern P) and the shortest. |
fixed |
If TRUE (the default), an IUPAC ambiguity code in the pattern can only match the same code in the subject, and vice versa. If FALSE, an IUPAC ambiguity code in the pattern can match any letter in the subject that is associated with the code, and vice versa. |
algorithm |
One of the following: "auto", "naive-exact", "naive-inexact", "boyer-moore", "shift-or" or "indels". |
an XStringViews object for matchPattern
.
s1 <- XNAString::XNAString( base = Biostrings::DNAString("GCGGAGAGAGCACAGATACA"), sugar = "FODDDDDDDDDDDDDDDDDD", target = Biostrings::DNAStringSet("GGCGGAGAGAGCACAGATACA") ) XNAString::XNAMatchPattern( s1, "GGCGGAGAGAGCACAGATACAGGCGGAGAGAGCACAGATACA" )
s1 <- XNAString::XNAString( base = Biostrings::DNAString("GCGGAGAGAGCACAGATACA"), sugar = "FODDDDDDDDDDDDDDDDDD", target = Biostrings::DNAStringSet("GGCGGAGAGAGCACAGATACA") ) XNAString::XNAMatchPattern( s1, "GGCGGAGAGAGCACAGATACAGGCGGAGAGAGCACAGATACA" )
This is function finding all the occurrences of a given set of patterns (typically short) in a (typically long) reference sequence
XNAMatchPDict( pdict, subject, max.mismatch = 0, min.mismatch = 0, with.indels = FALSE, fixed = TRUE, algorithm = "auto", verbose = FALSE ) ## S4 method for signature 'XNAString,character' XNAMatchPDict( pdict, subject, max.mismatch = 0, min.mismatch = 0, with.indels = FALSE, fixed = TRUE, algorithm = "auto", verbose = FALSE ) ## S4 method for signature 'XNAString,XString' XNAMatchPDict( pdict, subject, max.mismatch = 0, min.mismatch = 0, with.indels = FALSE, fixed = TRUE, algorithm = "auto", verbose = FALSE )
XNAMatchPDict( pdict, subject, max.mismatch = 0, min.mismatch = 0, with.indels = FALSE, fixed = TRUE, algorithm = "auto", verbose = FALSE ) ## S4 method for signature 'XNAString,character' XNAMatchPDict( pdict, subject, max.mismatch = 0, min.mismatch = 0, with.indels = FALSE, fixed = TRUE, algorithm = "auto", verbose = FALSE ) ## S4 method for signature 'XNAString,XString' XNAMatchPDict( pdict, subject, max.mismatch = 0, min.mismatch = 0, with.indels = FALSE, fixed = TRUE, algorithm = "auto", verbose = FALSE )
pdict |
XNAString object, target slot taken as pdict object from Biostrings |
subject |
string containing sequence |
max.mismatch |
The maximum number of mismatching letters allowed. If non-zero, an algorithm that supports inexact matching is used. |
min.mismatch |
The minimum number of mismatching letters allowed. If non-zero, an algorithm that supports inexact matching is used. |
with.indels |
If TRUE then indels are allowed. In that case, min.mismatch must be 0 and max.mismatch is interpreted as the maximum "edit distance" allowed between the pattern and a match. Note that in order to avoid pollution by redundant matches, only the "best local matches" are returned. Roughly speaking, a "best local match" is a match that is locally both the closest (to the pattern P) and the shortest. |
fixed |
If TRUE (the default), an IUPAC ambiguity code in the pattern can only match the same code in the subject, and vice versa. If FALSE, an IUPAC ambiguity code in the pattern can match any letter in the subject that is associated with the code, and vice versa. |
algorithm |
One of the following: "auto", "naive-exact", "naive-inexact", "boyer-moore", "shift-or" or "indels". |
verbose |
TRUE or FALSE. |
an MIndex object of length M
, and countPDict
an integer vector of length M
.
s2 <- XNAString::XNAString( base = "GCGGAGAGAGCACAGATACA", sugar = "FODDDDDDDDDDDDDDDDDD", target = Biostrings::DNAStringSet(c( "GGCGGAGAGAGCACAGATACA", "GGCGGAGAGAGCACAGATACA" )) ) o <- XNAString::XNAMatchPDict( s2, "GGCGGAGAGAGCACAGATACAGGGGCGGAGAGAGCACAGATACACGGAGAGAGCACAGATACA" )
s2 <- XNAString::XNAString( base = "GCGGAGAGAGCACAGATACA", sugar = "FODDDDDDDDDDDDDDDDDD", target = Biostrings::DNAStringSet(c( "GGCGGAGAGAGCACAGATACA", "GGCGGAGAGAGCACAGATACA" )) ) o <- XNAString::XNAMatchPDict( s2, "GGCGGAGAGAGCACAGATACAGGGGCGGAGAGAGCACAGATACACGGAGAGAGCACAGATACA" )
xnaObj2Dt function - changes XNAString object to data.table
xnaObj2Dt(obj, slots)
xnaObj2Dt(obj, slots)
obj |
XNAString object |
slots |
slots that are saved as column names (possibilities: "name", "base", "sugar", "backbone", "target", "conjugate5", "conjugate3" and "dictionary" ) |
data.table
This function performs pairwise alignment for sequences stored in target slot of XNAString object with subject
XNAPairwiseAlignment(pattern, subject, ...) ## S4 method for signature 'XNAString,character' XNAPairwiseAlignment( pattern, subject, type = "global", substitutionMatrix = NULL, fuzzyMatrix = NULL, gapOpening = 10, gapExtension = 4, scoreOnly = FALSE )
XNAPairwiseAlignment(pattern, subject, ...) ## S4 method for signature 'XNAString,character' XNAPairwiseAlignment( pattern, subject, type = "global", substitutionMatrix = NULL, fuzzyMatrix = NULL, gapOpening = 10, gapExtension = 4, scoreOnly = FALSE )
pattern |
XNAString object, pattern taken from target slot. |
subject |
a character vector of length 1, an XString, or an XStringSet object of length 1. |
... |
optional arguments to generic function to support additional methods |
type |
type of alignment. One of "global", "local", "overlap", "global-local", and "local-global" where "global" = align whole strings with end gap penalties, "local" = align string fragments, "overlap" = align whole strings without end gap penalties, "global-local" = align whole strings in pattern with consecutive subsequence of subject, "local-global" = align consecutive subsequence of pattern with whole strings in subject. |
substitutionMatrix |
substitution matrix representing the fixed substitution scores for an alignment. It cannot be used in conjunction with patternQuality and subjectQuality arguments. |
fuzzyMatrix |
fuzzy match matrix for quality-based alignments. It takes values between 0 and 1; where 0 is an unambiguous mismatch, 1 is an unambiguous match, and values in between represent a fraction of "matchiness". |
gapOpening |
the cost for opening a gap in the alignment. |
gapExtension |
the incremental cost incurred along the length of the gap in the alignment. |
scoreOnly |
logical to denote whether or not to return just the scores of the optimal pairwise alignment. |
an instance of class PairwiseAlignments
mat <- pwalign::nucleotideSubstitutionMatrix( match = 1, mismatch = -3, baseOnly = TRUE ) s1 <- XNAString::XNAString( base = "GCGGAGAGAGCACAGATACA", sugar = "FODDDDDDDDDDDDDDDDDD", target = Biostrings::DNAStringSet("GGCGGAGAGAGCACAGATACA") ) XNAString::XNAPairwiseAlignment(s1, "ACCCACACACACACACACACAC", "global", substitutionMatrix = mat )
mat <- pwalign::nucleotideSubstitutionMatrix( match = 1, mismatch = -3, baseOnly = TRUE ) s1 <- XNAString::XNAString( base = "GCGGAGAGAGCACAGATACA", sugar = "FODDDDDDDDDDDDDDDDDD", target = Biostrings::DNAStringSet("GGCGGAGAGAGCACAGATACA") ) XNAString::XNAPairwiseAlignment(s1, "ACCCACACACACACACACACAC", "global", substitutionMatrix = mat )
Reverse complement sequence based on dictionary
XNAReverseComplement(obj, ...) ## S4 method for signature 'XNAString' XNAReverseComplement(obj)
XNAReverseComplement(obj, ...) ## S4 method for signature 'XNAString' XNAReverseComplement(obj)
obj |
XNAString object |
... |
optional arguments to generic function to support additional methods |
string with reverse complement sequence
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") ) obj <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) XNAReverseComplement(obj)
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") ) obj <- XNAString( name = "b", base = "GGE", sugar = "FFO", dictionary = my_dic ) XNAReverseComplement(obj)
The package inherits some of the functionalities from Biostrings package. In contrary to Biostrings sequences, XNAString classes allow for description of base sequence, sugar and backbone in a single object. XNAString is able to capture single stranded oligonucleotides, siRNAs, PNAs, shRNAs, gRNAs and synthetic mRNAs, and enable users to apply sequence-manipulating Bioconductor packages to their analysis. XNAString can read and write a HELM notation, compute alphabet frequency, align and match targets.
XNAString( name, base, sugar, backbone, target, conjugate5, conjugate3, secondary_structure, duplex_structure, dictionary, compl_dictionary, default_sugar, default_backbone ) ## S4 method for signature 'XNAString' show(object) ## S4 method for signature 'XNAString' initialize( .Object, name, base, sugar, backbone, target, conjugate5, conjugate3, secondary_structure, duplex_structure, dictionary, compl_dictionary, default_sugar, default_backbone ) seqtype(x) ## S4 method for signature 'XNAString' seqtype(x)
XNAString( name, base, sugar, backbone, target, conjugate5, conjugate3, secondary_structure, duplex_structure, dictionary, compl_dictionary, default_sugar, default_backbone ) ## S4 method for signature 'XNAString' show(object) ## S4 method for signature 'XNAString' initialize( .Object, name, base, sugar, backbone, target, conjugate5, conjugate3, secondary_structure, duplex_structure, dictionary, compl_dictionary, default_sugar, default_backbone ) seqtype(x) ## S4 method for signature 'XNAString' seqtype(x)
name |
string (or character) |
base |
string (or character), RNAString, RNAStringSet, DNAString or DNAStringSet |
sugar |
string (or character) |
backbone |
string (or character) |
target |
DNAStringSet, DNAString or character |
conjugate5 |
string (or character) |
conjugate3 |
string (or character) |
secondary_structure |
list |
duplex_structure |
list |
dictionary |
data.table with following columns: "HELM", "type", "symbol". By default internal XNAString dictionary is used. |
compl_dictionary |
data.table with following columns: "base", "target". By default internal XNAString dictionary is used |
default_sugar |
character, a single letter which will be replicated in sugar slot as default value |
default_backbone |
character, a single letter which will be replicated in backbone slot as default value |
object |
XNAString object |
.Object |
XNAString object |
x |
A single string specifying the type of sequences |
Object which consists of name
, base
, sugar
,
backbone
, target
, conjugate5
, conjugate3
,
secondary_structure
, duplex_structure
,
dictionary
, compl_dictionary
.
Anna Gorska
obj1 <- XNAString( base = "ATCG", sugar = "FODD", conjugate3 = "TAG" ) obj2 <- XNAString( base = "ATCG", sugar = "FODD", backbone = "SBB" ) str(obj2) name(obj2) <- 'a' base(obj2) <- 'ATTT' sugar(obj2) <- 'LMFF' backbone(obj2) <- 'BAB' conjugate5(obj2) <- 'TFJSJG' conjugate3(obj2) <- 'ARTSS' 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')) obj1 <- XNAString(base = 'AAE', sugar = 'FFO', backbone='SB', dictionary = my_dic) obj2 <- XNAString(base = c('EAA', 'AAAA'), sugar = c('FFO', 'OOOO'), name = c('a'), conjugate5 = c('TTT'), dictionary = my_dic) 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") ) obj1 <- XNAString( base = "AAE", sugar = "FFO", backbone = "SB", dictionary = my_dic ) obj2 <- XNAString( base = c("EAA", "AAAA"), sugar = c("FFO", "OOOO"), name = c("a"), conjugate5 = c("TTT"), dictionary = my_dic )
obj1 <- XNAString( base = "ATCG", sugar = "FODD", conjugate3 = "TAG" ) obj2 <- XNAString( base = "ATCG", sugar = "FODD", backbone = "SBB" ) str(obj2) name(obj2) <- 'a' base(obj2) <- 'ATTT' sugar(obj2) <- 'LMFF' backbone(obj2) <- 'BAB' conjugate5(obj2) <- 'TFJSJG' conjugate3(obj2) <- 'ARTSS' 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')) obj1 <- XNAString(base = 'AAE', sugar = 'FFO', backbone='SB', dictionary = my_dic) obj2 <- XNAString(base = c('EAA', 'AAAA'), sugar = c('FFO', 'OOOO'), name = c('a'), conjugate5 = c('TTT'), dictionary = my_dic) 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") ) obj1 <- XNAString( base = "AAE", sugar = "FFO", backbone = "SB", dictionary = my_dic ) obj2 <- XNAString( base = c("EAA", "AAAA"), sugar = c("FFO", "OOOO"), name = c("a"), conjugate5 = c("TTT"), dictionary = my_dic )
XNAString2XNAStringSet function - changes XNAString object to XNAStringSet
XNAString2XNAStringSet(XNAString_obj)
XNAString2XNAStringSet(XNAString_obj)
XNAString_obj |
XNAString object |
XNAStringSet object
setClassUnion definitions used in XNAString class. charOrDNAOrRNA consists of character, DNAString, RNAString, DNAStringSet, RNAStringSet. charOrDNA consists of character, DNAString, DNAStringSet
Function which checks if XNAString object satisfies predefined slots length
xnastringElementsNumber( xnastring_obj, cond_name = "==1", cond_base, cond_sugar, cond_backbone, cond_target = ">0", cond_conj5 = "==1", cond_conj3 = "==1" )
xnastringElementsNumber( xnastring_obj, cond_name = "==1", cond_base, cond_sugar, cond_backbone, cond_target = ">0", cond_conj5 = "==1", cond_conj3 = "==1" )
xnastring_obj |
XNAString object |
cond_name |
allowed name elements in object |
cond_base |
allowed base elements in object |
cond_sugar |
allowed sugar elements in object |
cond_backbone |
allowed backbone elements in object |
cond_target |
allowed target elements in object |
cond_conj5 |
allowed conj5 elements in object |
cond_conj3 |
allowed conj3 elements in object |
logical
obj <- XNAString( base = c("EAA", "AAA"), sugar = c("FFO", "OOO"), name = c("a"), conjugate5 = c("TTT") ) xnastringElementsNumber(obj, cond_name = "==1", cond_base = "%in% c(1,2)", cond_sugar = "%in% c(1,2)", cond_backbone = "%in% c(1,2)", cond_target = ">0", cond_conj5 = "==1", cond_conj = "==1" )
obj <- XNAString( base = c("EAA", "AAA"), sugar = c("FFO", "OOO"), name = c("a"), conjugate5 = c("TTT") ) xnastringElementsNumber(obj, cond_name = "==1", cond_base = "%in% c(1,2)", cond_sugar = "%in% c(1,2)", cond_backbone = "%in% c(1,2)", cond_target = ">0", cond_conj5 = "==1", cond_conj = "==1" )
Create XNAString object from HELM - user interface
XNAStringFromHelm( helm, name = NA_character_, dictionary = xna_dictionary, compl_dictionary = complementary_bases, remove_linker = TRUE )
XNAStringFromHelm( helm, name = NA_character_, dictionary = xna_dictionary, compl_dictionary = complementary_bases, remove_linker = TRUE )
helm |
string (or strings vector) with HELM sequence, which contains one RNA polymer and optionally CHEM element |
name |
character (or character vector) |
dictionary |
data.table with following columns: "HELM", "type", "symbol". By default internal XNAString dictionary is used. |
compl_dictionary |
data.table with following columns: "base", "target". By default internal XNAString dictionary is used |
remove_linker |
logical defines if linker should be clipped from RNA |
XNAString object if single helm, XNAStringSet object otherwise
Marianna Plucinska
XNAStringFromHelm("RNA1{[dR](A)P.[dR](A)P.[dR](A)}$$$$V2.0") XNAStringFromHelm("RNA1{[dR](A)P.[dR](A)P.[dR](A)}$$$$V2.0", 'name') XNAStringFromHelm(c("RNA1{[dR](A)P.[dR](A)P.[dR](A)}$$$$V2.0", "RNA1{[dR](T)P.[dR](T)P.[dR](A)}$$$$V2.0"), c('name1', 'name2'))
XNAStringFromHelm("RNA1{[dR](A)P.[dR](A)P.[dR](A)}$$$$V2.0") XNAStringFromHelm("RNA1{[dR](A)P.[dR](A)P.[dR](A)}$$$$V2.0", 'name') XNAStringFromHelm(c("RNA1{[dR](A)P.[dR](A)P.[dR](A)}$$$$V2.0", "RNA1{[dR](T)P.[dR](T)P.[dR](A)}$$$$V2.0"), c('name1', 'name2'))
Create class which consists of XNAString objects given as a list
Create XNAStringSet object
Define show method
Method to extract a row/rows (either by row index or by 'name' slot) XNAStringSet object is returned.
Method to extract a single row (either by row index or by 'name' slot) XNAString object is returned.
XNAStringSet( objects = NA, base = NA, sugar = NA, backbone = NA, target = NA, col.base = "base", col.sugar = "sugar", col.backbone = "backbone", col.target = "target", default_sugar = NA, default_backbone = NA, compl_dict = complementary_bases ) ## S4 method for signature 'XNAStringSet' show(object) ## S4 method for signature 'XNAStringSet,ANY,ANY,ANY' x[i] ## S4 method for signature 'XNAStringSet,ANY,ANY' x[[i]]
XNAStringSet( objects = NA, base = NA, sugar = NA, backbone = NA, target = NA, col.base = "base", col.sugar = "sugar", col.backbone = "backbone", col.target = "target", default_sugar = NA, default_backbone = NA, compl_dict = complementary_bases ) ## S4 method for signature 'XNAStringSet' show(object) ## S4 method for signature 'XNAStringSet,ANY,ANY,ANY' x[i] ## S4 method for signature 'XNAStringSet,ANY,ANY' x[[i]]
objects |
list of XNAString objects |
base |
string (or character), RNAString, RNAStringSet, DNAString or DNAStringSet. In use only when objects argument is empty. |
sugar |
string (or character). In use only when objects argument is empty. |
backbone |
string (or character). In use only when objects argument is empty. |
target |
DNAStringSet, DNAString or character. In use only when objects argument is empty. |
col.base |
character (name of base column). In use only when objects argument is empty. |
col.sugar |
character (name of sugar column). In use only when objects argument is empty. |
col.backbone |
character (name of backbone column). In use only when o bjects argument is empty. |
col.target |
character (name of target column). In use only when objects argument is empty. |
default_sugar |
character - only one letter. Will be replicated nchar(base) times. In use only when objects argument is empty. |
default_backbone |
character - only one letter. Will be replicated nchar(base)-1 times. In use only when objects argument is empty. |
compl_dict |
data.table with following columns: "base", "target". By default internal XNAString dictionary is used. In use only when objects argument is empty. |
object |
XNAStringSet object |
x |
XNAStringSet object |
i |
numeric, integer, character, logical - filter needed for extraction method |
XNASTringSet object
Anna Gorska
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") ) obj1 <- XNAString( name = "a", base = "GGE", sugar = "FFO", backbone = "SB", dictionary = my_dic ) 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(obj1, obj2, obj3))
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") ) obj1 <- XNAString( name = "a", base = "GGE", sugar = "FFO", backbone = "SB", dictionary = my_dic ) 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(obj1, obj2, obj3))
XNAStringToHelmFun function takes XNAString object and translates base, sugar and backbone to HELM notation
XNAStringToHelm(xnastring_obj, dictionary = xna_dictionary)
XNAStringToHelm(xnastring_obj, dictionary = xna_dictionary)
xnastring_obj |
XNAString object |
dictionary |
HELM-symbol dictionary |
string (HELM notation)
obj <- XNAString( base = "AAA", sugar = "DDD", backbone = "OO" ) XNAStringToHelm(obj)
obj <- XNAString( base = "AAA", sugar = "DDD", backbone = "OO" ) XNAStringToHelm(obj)
This is function finding all the occurrences of a given pattern (typically short) in a (typically long) set of reference sequences.
Implementation of this method is based on vmatchPatterrm method from BSgenome
XNAVmatchPattern( pattern, subject, target.number = 1, max.mismatch = 0, min.mismatch = 0, with.indels = FALSE, fixed = TRUE, algorithm = "auto", exclude = "", maskList = logical(0), userMask = IRanges::IRangesList(), invertUserMask = FALSE ) ## S4 method for signature 'XNAString,character' XNAVmatchPattern( pattern, subject, target.number = 1, max.mismatch = 0, min.mismatch = 0, with.indels = FALSE, fixed = TRUE, algorithm = "auto" ) ## S4 method for signature 'XNAString,XStringSet' XNAVmatchPattern( pattern, subject, target.number = 1, max.mismatch = 0, min.mismatch = 0, with.indels = FALSE, fixed = TRUE, algorithm = "auto" ) ## S4 method for signature 'XNAString,BSgenome' XNAVmatchPattern( pattern, subject, target.number = 1, max.mismatch = 0, min.mismatch = 0, with.indels = FALSE, fixed = TRUE, algorithm = "auto", exclude = "", maskList = logical(0), userMask = IRanges::IRangesList(), invertUserMask = FALSE )
XNAVmatchPattern( pattern, subject, target.number = 1, max.mismatch = 0, min.mismatch = 0, with.indels = FALSE, fixed = TRUE, algorithm = "auto", exclude = "", maskList = logical(0), userMask = IRanges::IRangesList(), invertUserMask = FALSE ) ## S4 method for signature 'XNAString,character' XNAVmatchPattern( pattern, subject, target.number = 1, max.mismatch = 0, min.mismatch = 0, with.indels = FALSE, fixed = TRUE, algorithm = "auto" ) ## S4 method for signature 'XNAString,XStringSet' XNAVmatchPattern( pattern, subject, target.number = 1, max.mismatch = 0, min.mismatch = 0, with.indels = FALSE, fixed = TRUE, algorithm = "auto" ) ## S4 method for signature 'XNAString,BSgenome' XNAVmatchPattern( pattern, subject, target.number = 1, max.mismatch = 0, min.mismatch = 0, with.indels = FALSE, fixed = TRUE, algorithm = "auto", exclude = "", maskList = logical(0), userMask = IRanges::IRangesList(), invertUserMask = FALSE )
pattern |
XNAString object with non-empty target slot |
subject |
string, string vector or DNAString / DNAStringSet / chromosome from BSgenome object |
target.number |
numeric - if target is a multi-element vector, then specify which element in use. 1 is the default |
max.mismatch |
The maximum number of mismatching letters allowed. If non-zero, an algorithm that supports inexact matching is used. |
min.mismatch |
The minimum number of mismatching letters allowed. If non-zero, an algorithm that supports inexact matching is used. |
with.indels |
If TRUE then indels are allowed. In that case, min.mismatch must be 0 and max.mismatch is interpreted as the maximum "edit distance" allowed between the pattern and a match. Note that in order to avoid pollution by redundant matches, only the "best local matches" are returned. Roughly speaking, a "best local match" is a match that is locally both the closest (to the pattern P) and the shortest. |
fixed |
If TRUE (the default), an IUPAC ambiguity code in the pattern can only match the same code in the subject, and vice versa. If FALSE, an IUPAC ambiguity code in the pattern can match any letter in the subject that is associated with the code, and vice versa. |
algorithm |
One of the following: "auto", "naive-exact", "naive-inexact", "boyer-moore", "shift-or" or "indels". |
exclude |
A character vector with strings that will be used to filter out chromosomes whose names match these strings. Needed for BSParams object if subject is a chromosome object from BSgenome |
maskList |
A named logical vector of maskStates preferred when used with a BSGenome object. When using the bsapply function, the masks will be set to the states in this vector. |
userMask |
An IntegerRangesList, containing a mask to be applied to each chromosome. |
invertUserMask |
Whether the userMask should be inverted. |
An MIndex object for vmatchPattern
.
s3 <- XNAString::XNAString( base = "GCGGAGAGAGCACAGATACA", sugar = "FODDDDDDDDDDDDDDDDDD", target = Biostrings::DNAStringSet( c("AAAAGCTTTACAAAATCCAAGATC", "GGCGGAGAGAGCACAGATACA") ) ) chrom <- BSgenome.Hsapiens.UCSC.hg38::BSgenome.Hsapiens.UCSC.hg38$chr1 result <- XNAString::XNAMatchPattern(s3, chrom)
s3 <- XNAString::XNAString( base = "GCGGAGAGAGCACAGATACA", sugar = "FODDDDDDDDDDDDDDDDDD", target = Biostrings::DNAStringSet( c("AAAAGCTTTACAAAATCCAAGATC", "GGCGGAGAGAGCACAGATACA") ) ) chrom <- BSgenome.Hsapiens.UCSC.hg38::BSgenome.Hsapiens.UCSC.hg38$chr1 result <- XNAString::XNAMatchPattern(s3, chrom)