Description Usage Arguments Value Examples
These functions are not intended for general use, but are used for additional package development.
getData
is used to load data into a
SequenceData
object and must be
implented for all SequenceData
classes. The results must match the
requirements outlined in the value section.
In addition the following functions should be implemented for complete functionality:
aggregateData
for each SequenceData
and Modifier
class.
See also aggregateData
findMod
for each Modifier
class. See also
findMod
.
plotData
/plotDataByCoord
for each Modifier
and ModifierSet
class. See also
plotData
.
The following helper function can be called from within findMod
to
construct a coordinate for each modification found:
constructModRanges
constructs a GRanges
object describing the
location, type and associated scores of a modification.
constructModRanges
is typically called from the modify
function, which must be implemented for all
Modifier
classes.
1 2 3 4 5 6 |
range |
for |
data |
for |
modType |
for |
scoreFun |
for |
source |
for |
type |
for |
x |
for |
bamfiles |
for |
grl |
for |
sequences |
for |
param |
for |
args |
for |
getData
: returns a list with elements per BamFile in
bamfiles
. Elements can be
IntegerList
,
NumericList
or a
CompressedSplitDataFrameList
. The
data in the elements must be order by increasing positions numbers. However,
names and rownames will be discarded.
constructModRanges
: returns a GRanges
object with
genomic coordinates of modified nucleotides in the associated transcripts.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | # new SequenceData class
setClass(Class = "ExampleSequenceData",
contains = "SequenceData",
prototype = list(minQuality = 5L))
ExampleSequenceData <- function(bamfiles, annotation, sequences, seqinfo, ...){
RNAmodR:::SequenceData("Example", bamfiles = bamfiles,
annotation = annotation, sequences = sequences,
seqinfo = seqinfo, ...)
}
setMethod("getData",
signature = c(x = "ExampleSequenceData",
bamfiles = "BamFileList",
grl = "GRangesList",
sequences = "XStringSet",
param = "ScanBamParam"),
definition = function(x, bamfiles, grl, sequences, param, args){
###
}
)
setMethod("aggregateData",
signature = c(x = "ExampleSequenceData"),
function(x, condition = c("Both","Treated","Control")){
###
}
)
setMethod(
f = "getDataTrack",
signature = c(x = "ExampleSequenceData"),
definition = function(x, name, ...) {
###
}
)
# new Modifier class
setClass("ModExample",
contains = "Modifier",
prototype = list(mod = "X",
score = "score",
dataType = "ExampleSequenceData"))
ModExample <- function(x, annotation, sequences, seqinfo, ...){
RNAmodR:::Modifier("ModExample", x = x, annotation = annotation,
sequences = sequences, seqinfo = seqinfo, ...)
}
setMethod(f = "aggregateData",
signature = c(x = "ModExample"),
definition =
function(x, force = FALSE){
# Some data with element per transcript
}
)
setMethod("findMod",
signature = c(x = "ModExample"),
function(x){
# an element per modification found.
}
)
setMethod(
f = "getDataTrack",
signature = signature(x = "ModExample"),
definition = function(x, name, type, ...) {
}
)
setMethod(
f = "plotDataByCoord",
signature = signature(x = "ModExample", coord = "GRanges"),
definition = function(x, coord, type = "score", window.size = 15L, ...) {
}
)
setMethod(
f = "plotData",
signature = signature(x = "ModExample"),
definition = function(x, name, from, to, type = "score", ...) {
}
)
# new ModifierSet class
setClass("ModSetExample",
contains = "ModifierSet",
prototype = list(elementType = "ModExample"))
ModSetExample <- function(x, annotation, sequences, seqinfo, ...){
RNAmodR:::ModifierSet("ModExample", x = x, annotation = annotation,
sequences = sequences, seqinfo = seqinfo, ...)
}
setMethod(
f = "plotDataByCoord",
signature = signature(x = "ModSetExample", coord = "GRanges"),
definition = function(x, coord, type = "score", window.size = 15L, ...) {
}
)
setMethod(
f = "plotData",
signature = signature(x = "ModSetExample"),
definition = function(x, name, from, to, type = "score", ...) {
}
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.