Browse code

Merge branch 'master' of https://github.com/FelixErnst/RNAmodR

Felix Ernst authored on 29/04/2019 09:31:56
Showing55 changed files

... ...
@@ -1,6 +1,6 @@
1 1
 Package: RNAmodR
2
-Title: Detection of post-transcriptional modifications
3
-Version: 0.98.0
2
+Title: RNAmodR: Detection of post-transcriptional modifications
3
+Version: 0.99.2
4 4
 Authors@R: c(person("Felix G.M.", 
5 5
                     "Ernst", 
6 6
                     email = "felix.gm.ernst@outlook.com", 
... ...
@@ -39,7 +39,6 @@ Imports:
39 39
     GenomicFeatures,
40 40
     GenomicAlignments,
41 41
     Biostrings,
42
-    SummarizedExperiment,
43 42
     GenomeInfoDb,
44 43
     rtracklayer,
45 44
     Rsamtools,
... ...
@@ -58,7 +57,6 @@ Suggests:
58 57
     knitr,
59 58
     rmarkdown,
60 59
     testthat,
61
-    sessioninfo,
62 60
     RNAmodR.Data
63 61
 VignetteBuilder: knitr
64 62
 Collate:
... ...
@@ -8,6 +8,8 @@ export(EndSequenceData)
8 8
 export(ModInosine)
9 9
 export(ModRNASequenceTrack)
10 10
 export(ModSetInosine)
11
+export(Modifier)
12
+export(ModifierSet)
11 13
 export(NormEnd3SequenceData)
12 14
 export(NormEnd5SequenceData)
13 15
 export(PileupSequenceData)
... ...
@@ -1,2 +1,2 @@
1
-Changes in version 0.99.0 (2019-03-01)
2
-+ Submitted to Bioconductor
1
+Changes in version 0.99.0 (2019-04-29)
2
++ Submitted to Bioconductor
3 3
\ No newline at end of file
... ...
@@ -5,28 +5,10 @@ NULL
5 5
 #' @title Modifier/ModifierSet functions
6 6
 NULL
7 7
 
8
-# Class constructors -----------------------------------------------------------
9
-
10
-setGeneric( 
11
-  name = "SequenceData",
12
-  signature = c("annotation","sequences"),
13
-  def = function(dataType, bamfiles, annotation, sequences, seqinfo, ...)
14
-    standardGeneric("SequenceData")
15
-) 
16
-
17
-setGeneric( 
18
-  name = "Modifier",
19
-  signature = c("x"),
20
-  def = function(className, x, annotation, sequences, seqinfo, ...)
21
-    standardGeneric("Modifier")
22
-) 
23
-
24
-setGeneric( 
25
-  name = "ModifierSet",
26
-  signature = c("x"),
27
-  def = function(className, x, annotation, sequences, seqinfo, ...)
28
-    standardGeneric("ModifierSet")
29
-)
8
+#' @name SequenceData-functions
9
+#' @title SequenceData/SequenceDataSet/SequenceDataList/SequenceDataFrame 
10
+#' functions
11
+NULL
30 12
 
31 13
 # ROC functions ----------------------------------------------------------------
32 14
 
... ...
@@ -17,10 +17,10 @@ NULL
17 17
 #' G. This conversion is detected by \code{ModInosine} and used to search for 
18 18
 #' Inosine positions. \code{dataType} is \code{"PileupSequenceData"}.
19 19
 #' 
20
-#' Only samples named \code{treated} are used for this analysis, since the
21
-#' A to G conversion is common feature among the reverse transcriptases usually
22
-#' emploied. Let us know, if that is not the case, and the class needs to be
23
-#' modified.
20
+#' Only samples labeled with the condition \code{treated} are used for this
21
+#' analysis, since the A to G conversion is common feature among the reverse
22
+#' transcriptases usually emploied. Let us know, if that is not the case, and
23
+#' the class needs to be modified.
24 24
 #' 
25 25
 #' Further information on \code{\link[=ModInosine-functions]{Functions}} of 
26 26
 #' \code{ModInosine}.
... ...
@@ -28,7 +28,7 @@ NULL
28 28
 #' @details
29 29
 #' \code{ModInosine} score: the scores for reported Inosine positions are 
30 30
 #' between 0 and 1. They are calculated as the relative amount of called G bases 
31
-#' (\code{(G / N)}) and only kept for A positions.
31
+#' (\code{(G / N)}) and only saved for genomic A positions.
32 32
 #' 
33 33
 #' @param x the input which can be of the different types depending on whether
34 34
 #' a \code{ModRiboMethSeq} or a \code{ModSetRiboMethSeq} object is to be 
... ...
@@ -36,11 +36,11 @@ NULL
36 36
 #' the \code{\link[RNAmodR:Modifier-class]{Modifier}} and 
37 37
 #' \code{\link[RNAmodR:ModifierSet-class]{ModifierSet}} classes.
38 38
 #' @param annotation annotation data, which must match the information contained
39
-#' in the BAM files. This is parameter is only required if \code{x} if not a 
39
+#' in the BAM files. This is parameter is only required, if \code{x} is not a 
40 40
 #' \code{Modifier} object.
41 41
 #' @param sequences sequences matching the target sequences the reads were 
42 42
 #' mapped onto. This must match the information contained in the BAM files. This
43
-#' is parameter is only required if \code{x} if not a \code{Modifier} object.
43
+#' is parameter is only required, if \code{x} is not a \code{Modifier} object.
44 44
 #' @param seqinfo An optional \code{\link[GenomeInfoDb:Seqinfo-class]{Seqinfo}} 
45 45
 #' argument or character vector, which can be coerced to one, to subset the 
46 46
 #' sequences to be analyzed on a per chromosome basis.
... ...
@@ -58,12 +58,15 @@ NULL
58 58
 #' 
59 59
 #' @examples
60 60
 #' # construction of ModInosine object
61
-#' sequences <- RNAmodR.Data.example.AAS.fasta()
62
-#' annotation <- GFF3File(RNAmodR.Data.example.AAS.gff3())
61
+#' library(RNAmodR.Data)
62
+#' library(rtracklayer)
63
+#' annotation <- GFF3File(RNAmodR.Data.example.man.gff3())
64
+#' sequences <- RNAmodR.Data.example.man.fasta()
63 65
 #' files <- c(treated = RNAmodR.Data.example.wt.1(),
64 66
 #'            treated = RNAmodR.Data.example.wt.2(),
65 67
 #'            treated = RNAmodR.Data.example.wt.3())
66 68
 #' mi <- ModInosine(files,annotation = annotation ,sequences = sequences)
69
+#' \dontrun{
67 70
 #' # construction of ModSetInosine object
68 71
 #' files <- list("SampleSet1" = c(treated = RNAmodR.Data.example.wt.1(),
69 72
 #'                                treated = RNAmodR.Data.example.wt.2(),
... ...
@@ -73,6 +76,7 @@ NULL
73 76
 #'               "SampleSet3" = c(treated = RNAmodR.Data.example.trm8.1(),
74 77
 #'                                treated = RNAmodR.Data.example.trm8.2()))
75 78
 #' msi <- ModSetInosine(files, annotation = annotation, sequences = sequences)
79
+#' }
76 80
 NULL
77 81
 
78 82
 #' @name ModInosine-internals
... ...
@@ -119,7 +123,8 @@ NULL
119 123
 #' \item{\code{aggregate}} {See \code{\link{aggregate}}.}
120 124
 #' \item{\code{modify}} {See \code{\link{modify}}.}
121 125
 #' \item{\code{getDataTrack}} {a list of 
122
-#' \code{\link[Gviz:DataTrack-class]{DataTrack}} object.}
126
+#' \code{\link[Gviz:DataTrack-class]{DataTrack}} objects. See 
127
+#' \code{\link{visualizeDataByCoord}}.}
123 128
 #' \item{\code{visualizeData}} {See \code{\link{visualizeDataByCoord}}.}
124 129
 #' \item{\code{visualizeDataByCoord}} {See \code{\link{visualizeDataByCoord}}.}
125 130
 #' }
... ...
@@ -7,41 +7,41 @@ NULL
7 7
 
8 8
 #' @name Modifier-class
9 9
 #' @aliases Modifier
10
-#' 
10
+#'
11 11
 #' @title The Modifier class
12
-#' 
12
+#'
13 13
 #' @description
14
-#' The \code{Modifier} class is a virtual class, which provides the central 
15
-#' functionality for searching for patterns of post-transcriptional RNA 
16
-#' modifications in high throughput sequencing data.
17
-#' 
14
+#' The \code{Modifier} class is a virtual class, which provides the central
15
+#' functionality to search for post-transcriptional RNA modification patterns in
16
+#' high throughput sequencing data.
17
+#'
18 18
 #' Each subclass has to implement the following functions:
19
-#' 
19
+#'
20 20
 #' \itemize{
21
-#' \item{\code{\link{aggregate}}: }{used for specific data aggregation}
22
-#' \item{\code{\link{modify}}: }{used for specific search for modifications}
21
+#' \item{\code{\link{aggregateData}}: }{used for specific data aggregation}
22
+#' \item{\code{\link{findMod}}: }{used for specific search for modifications}
23 23
 #' }
24
-#' 
24
+#'
25 25
 #' Optionally the function \code{\link[=Modifier-functions]{settings<-}} can be
26 26
 #' implemented to store additional arguments, which the base class does not
27 27
 #' recognize.
28
-#' 
29
-#' \code{Modifier} objects are constructed centrally by calling 
28
+#'
29
+#' \code{Modifier} objects are constructed centrally by calling
30 30
 #' \code{Modifier()} with a \code{className} matching the specific class to be
31 31
 #' constructed. This will trigger the immediate analysis, if \code{find.mod} is
32
-#' not set to \code{TRUE}.
33
-#' 
34
-#' 
35
-#' @section Creation: 
32
+#' not set to \code{FALSE}.
33
+#'
34
+#'
35
+#' @section Creation:
36 36
 #' \code{Modifier} objects can be created in two ways, either by providing a
37
-#' list of bamfiles or 
38
-#' \code{SequenceData}/\code{SequenceDataSet}/\code{SequenceDataList} objects, 
37
+#' list of bamfiles or
38
+#' \code{SequenceData}/\code{SequenceDataSet}/\code{SequenceDataList} objects,
39 39
 #' which match the structure in \code{dataType()}.
40
-#' 
40
+#'
41 41
 #' \code{dataType()} can be a \code{character} vector or a \code{list} of
42
-#' \code{character} vectors and depending on this the input files have to 
42
+#' \code{character} vectors and depending on this the input files have to
43 43
 #' follow this structure:
44
-#' 
44
+#'
45 45
 #' \itemize{
46 46
 #' \item{a single \code{character}:} {a \code{SequenceData} is
47 47
 #' constructed/expected.}
... ...
@@ -50,105 +50,109 @@ NULL
50 50
 #' \item{a \code{list} of \code{character} vectors:} {a \code{SequenceDataList}
51 51
 #' is constructed/expected.}
52 52
 #' }
53
-#' 
54
-#' The cases for a \code{SequenceData} or \code{SequenceDataSet} are rather
55
-#' obvious, since the input remains the same. The last case is special, since
56
-#' it is a hypothetical option in case bam files from to different methods 
57
-#' have to be combined to reliably detect a single modification (The elements of
58
-#' a \code{SequenceDataList} don't have to be created from the bamfiles). 
59
-#' 
53
+#'
54
+#' The cases for a \code{SequenceData} or \code{SequenceDataSet} are straight
55
+#' forward, since the input remains the same. The last case is special, since it
56
+#' is a hypothetical option, in which bam files from two or more different
57
+#' methods have to be combined to reliably detect a single modification (The
58
+#' elements of a \code{SequenceDataList} don't have to be created from the
59
+#' bamfiles, whereas from a \code{SequenceDataSet} they have to be).
60
+#'
60 61
 #' For this example a \code{list} of \code{character} vectors is expected.
61
-#' Each element must be named according to the names of \code{dataType()} and 
62
+#' Each element must be named according to the names of \code{dataType()} and
62 63
 #' contain a \code{character} vector for creating a \code{SequenceData} object.
63
-#' 
64
+#'
64 65
 #' @param className The name of the class which should be constructed.
65 66
 #' @param x the input which can be of the following types
66 67
 #' \itemize{
67
-#' \item{\code{SequenceData}:} {a single \code{SequenceData} or a list containg
68
-#' only \code{SequenceData} objects. The input will just be used as elements of
69
-#' the \code{Modifier} and must match the requirements of specific
70
-#' \code{Modifier} class }
68
+#' \item{\code{SequenceData}:} {a single \code{SequenceData} or a list
69
+#' containing only \code{SequenceData} objects. The input will just be used to
70
+#' file the \code{data} slot of the \code{Modifier} and must match the
71
+#' requirements of specific \code{Modifier} class.}
71 72
 #' \item{\code{BamFileList}:} {a named \code{BamFileList}}
72 73
 #' \item{\code{character}:} {a \code{character} vector, which must be coercible
73 74
 #' to a named \code{BamFileList} referencing existing bam files. Valid names are
74 75
 #' \code{control} and \code{treated} to define conditions and replicates}
75 76
 #' }
76 77
 #' @param annotation annotation data, which must match the information contained
77
-#' in the BAM files. This is parameter is only required if \code{x} if not a 
78
-#' \code{Modifier} object.
79
-#' @param sequences sequences matching the target sequences the reads were 
80
-#' mapped onto. This must match the information contained in the BAM files. This
81
-#' is parameter is only required if \code{x} if not a \code{Modifier} object.
82
-#' @param seqinfo optional \code{\link[GenomeInfoDb:Seqinfo]{Seqinfo}} to 
83
-#' subset the transcripts analyzed on a chromosome basis.
78
+#' in the BAM files. This parameter is only required if \code{x} is not a
79
+#' \code{SequenceData} object or a list of \code{SequenceData} objects.
80
+#' @param sequences sequences matching the target sequences the reads were
81
+#'   mapped onto. This must match the information contained in the BAM files.
82
+#'   TThis parameter is only required if \code{x} is not a \code{SequenceData}
83
+#'   object or a list of \code{SequenceData} objects.
84
+#' @param seqinfo An optional \code{\link[GenomeInfoDb:Seqinfo-class]{Seqinfo}}
85
+#' argument or character vector, which can be coerced to one, to subset the
86
+#' sequences to be analyzed on a per chromosome basis.
84 87
 #' @param ... Additional otpional parameters:
85 88
 #' \itemize{
86
-#' \item{\code{find.mod}:} {\code{TRUE} or \code{FALSE}: should the search for for 
87
-#' modifications be triggered upon construction? If not the search can be 
89
+#' \item{\code{find.mod}:} {\code{TRUE} or \code{FALSE}: should the search for
90
+#' for modifications be triggered upon construction? If not the search can be
88 91
 #' started by calling the \code{modify()} function.}
89 92
 #' }
90
-#' All other arguments will be passed onto the \code{SequenceData} objects.
91
-#' 
92
-#' @slot mod a \code{character} value, which needs to contain one or more 
93
-#' elements from the alphabet of a 
93
+#' All other arguments will be passed onto the \code{SequenceData} objects, if
94
+#' \code{x} is not a \code{SequenceData} object or a list of \code{SequenceData}
95
+#' objects.
96
+#'
97
+#' @slot mod a \code{character} value, which needs to contain one or more
98
+#' elements from the alphabet of a
94 99
 #' \code{\link[Modstrings:ModRNAString]{ModRNAString}} class.
95 100
 #' @slot score the main score identifier used for visualizations
96
-#' @slot dataType the class name(s) of the \code{SequenceData} class used 
101
+#' @slot dataType the class name(s) of the \code{SequenceData} class used
97 102
 #' @slot bamfiles the input bam files as \code{BamFileList}
98
-#' @slot condition conditions along the \code{BamFileList}: Either 
103
+#' @slot condition conditions along the \code{BamFileList}: Either
99 104
 #' \code{control} or \code{treated}
100 105
 #' @slot replicate replicate number along the \code{BamFileList} for each of the
101 106
 #' condition types.
102
-#' @slot data The sequence data object: Either a \code{SequenceData}, 
103
-#' \code{SequenceDataSet} or a \code{SequenceDataList} object, if more than one 
107
+#' @slot data The sequence data object: Either a \code{SequenceData},
108
+#' \code{SequenceDataSet} or a \code{SequenceDataList} object, if more than one
104 109
 #' \code{dataType} is used.
105 110
 #' @slot aggregate the aggregated data as a \code{SplitDataFrameList}
106 111
 #' @slot modifications the found modifications as a \code{GRanges} object
107 112
 #' @slot arguments arguments used for the analysis as a \code{list}
108 113
 #' @slot aggregateValidForCurrentArguments \code{TRUE} or \code{FALSE} whether
109 114
 #' the aggregate data was constructed with the current arguments
110
-#' @slot modificationsValidForCurrentArguments \code{TRUE} or \code{FALSE} 
115
+#' @slot modificationsValidForCurrentArguments \code{TRUE} or \code{FALSE}
111 116
 #' whether the modifications were found with the current arguments
112
-#' 
117
+#'
113 118
 #' @return a \code{Modifier} object of type \code{className}
114 119
 NULL
115 120
 
116 121
 #' @name Modifier-functions
117
-#' 
122
+#'
118 123
 #' @title Modifier/ModifierSet functions
119
-#' 
124
+#'
120 125
 #' @description
121 126
 #' For the \code{Modifier} and  \code{ModifierSet} classes a number of functions
122 127
 #' are implemented to access the data stored by the object.
123
-#' 
128
+#'
124 129
 #' @param x,object a \code{Modifier} or \code{ModifierSet} class
125 130
 #' @param name For \code{settings}: name of the setting to be returned or set
126 131
 #' @param value For \code{settings}: value of the setting to be set
127 132
 #' @param modified For \code{sequences}: \code{TRUE} or \code{FALSE}: Should
128
-#' the sequences be returned as a \code{ModRNAString} with the found 
129
-#' modifications added on top of the \code{RNAString}? See 
133
+#' the sequences be returned as a \code{ModRNAString} with the found
134
+#' modifications added on top of the \code{RNAString}? See
130 135
 #' \code{\link[Modstrings:separate]{combineIntoModstrings}}.
131 136
 #' @param perTranscript \code{TRUE} or \code{FALSE}: Should the positions shown
132 137
 #' per transcript? (default: \code{perTranscript = FALSE})
133
-#' @param ... Additional arguments. 
134
-#' 
138
+#' @param ... Additional arguments.
139
+#'
135 140
 #' @return
136 141
 #' \itemize{
137
-#' \item{\code{modifierType}} {a character vector with the appropriate class
138
-#' Name of a \code{\link[=Modifier-class]{Modifier}}. Works for both 
139
-#' \code{Modifier} and \code{ModifierSet} objects.}
140
-#' \item{\code{mainScore}} {a character vector}
141
-#' \item{\code{settings}} {a \code{Seqinfo} object}
142
-#' \item{\code{sequenceData}} {a \code{SequenceData} object}
143
-#' \item{\code{modifications}} {a \code{GRanges} or \code{GRangesList} object
142
+#' \item{\code{modifierType}:} {a character vector with the appropriate class
143
+#' Name of a \code{\link[=Modifier-class]{Modifier}}.}
144
+#' \item{\code{mainScore}:} {a character vector.}
145
+#' \item{\code{settings}:} {a \code{Seqinfo} object.}
146
+#' \item{\code{sequenceData}:} {a \code{SequenceData} object.}
147
+#' \item{\code{modifications}:} {a \code{GRanges} or \code{GRangesList} object
144 148
 #' describing the found modifications.}
145
-#' \item{\code{seqinfo}} {a \code{Seqinfo} object}
146
-#' \item{\code{sequences}} {a \code{RNAStingSet} object}
147
-#' \item{\code{ranges}} {a \code{GRangesList} object with each element per 
148
-#' transcript}
149
-#' \item{\code{bamfiles}} {a \code{BamFileList} object}
149
+#' \item{\code{seqinfo}:} {a \code{Seqinfo} object.}
150
+#' \item{\code{sequences}:} {a \code{RNAStingSet} object.}
151
+#' \item{\code{ranges}:} {a \code{GRangesList} object with each element per
152
+#' transcript.}
153
+#' \item{\code{bamfiles}:} {a \code{BamFileList} object.}
150 154
 #' }
151
-#' 
155
+#'
152 156
 #' @examples
153 157
 #' data(msi,package="RNAmodR")
154 158
 #' mi <- msi[[1]]
... ...
@@ -229,7 +233,7 @@ setClass("Modifier",
229 233
 .check_Modifier_data_elements <- function(x, data){
230 234
   if(is(data,"SequenceData") || is(data,"SequenceDataSet")){
231 235
     return(.check_SequenceData_elements(x, data))
232
-  } 
236
+  }
233 237
   .check_SequenceDataList_data_elements(x, data)
234 238
 }
235 239
 
... ...
@@ -316,7 +320,7 @@ S4Vectors::setValidity2(Class = "Modifier", .valid_Modifier)
316 320
 #' @rdname Modifier-functions
317 321
 #' @importFrom BiocGenerics path
318 322
 setMethod(
319
-  f = "show", 
323
+  f = "show",
320 324
   signature = signature(object = "Modifier"),
321 325
   definition = function(object) {
322 326
     cat("A", class(object), "object containing",dataType(object),
... ...
@@ -354,19 +358,19 @@ setMethod(
354 358
 
355 359
 #' @rdname Modifier-functions
356 360
 #' @export
357
-setMethod(f = "bamfiles", 
361
+setMethod(f = "bamfiles",
358 362
           signature = signature(x = "Modifier"),
359 363
           definition = function(x){x@bamfiles})
360 364
 #' @rdname Modifier-functions
361 365
 #' @export
362
-setMethod(f = "conditions", 
366
+setMethod(f = "conditions",
363 367
           signature = signature(object = "Modifier"),
364 368
           definition = function(object){
365 369
             conditions(sequenceData(object))
366 370
           })
367 371
 #' @rdname Modifier-functions
368 372
 #' @export
369
-setMethod(f = "mainScore", 
373
+setMethod(f = "mainScore",
370 374
           signature = signature(x = "Modifier"),
371 375
           definition = function(x){x@score})
372 376
 
... ...
@@ -393,9 +397,9 @@ setMethod(f = "mainScore",
393 397
 
394 398
 #' @rdname modify
395 399
 #' @export
396
-setMethod(f = "modifications", 
400
+setMethod(f = "modifications",
397 401
           signature = signature(x = "Modifier"),
398
-          definition = 
402
+          definition =
399 403
             function(x, perTranscript = FALSE){
400 404
               if(!assertive::is_a_bool(perTranscript)){
401 405
                 stop("'perTranscript' has to be a single logical value.")
... ...
@@ -408,46 +412,46 @@ setMethod(f = "modifications",
408 412
 )
409 413
 #' @rdname Modifier-functions
410 414
 #' @export
411
-setMethod(f = "modifierType", 
415
+setMethod(f = "modifierType",
412 416
           signature = signature(x = "Modifier"),
413 417
           definition = function(x){class(x)[[1]]})
414 418
 #' @rdname Modifier-functions
415 419
 #' @export
416
-setMethod(f = "modType", 
420
+setMethod(f = "modType",
417 421
           signature = signature(x = "Modifier"),
418 422
           definition = function(x){x@mod})
419 423
 #' @rdname Modifier-functions
420 424
 #' @export
421
-setMethod(f = "dataType", 
425
+setMethod(f = "dataType",
422 426
           signature = signature(x = "Modifier"),
423 427
           definition = function(x){x@dataType})
424 428
 #' @rdname Modifier-functions
425 429
 #' @export
426
-setMethod(f = "names", 
430
+setMethod(f = "names",
427 431
           signature = signature(x = "Modifier"),
428 432
           definition = function(x){names(sequenceData(x))})
429 433
 #' @rdname Modifier-functions
430 434
 #' @export
431
-setMethod(f = "ranges", 
435
+setMethod(f = "ranges",
432 436
           signature = signature(x = "Modifier"),
433 437
           definition = function(x){ranges(sequenceData(x))})
434 438
 #' @rdname Modifier-functions
435 439
 #' @export
436
-setMethod(f = "replicates", 
440
+setMethod(f = "replicates",
437 441
           signature = signature(x = "Modifier"),
438 442
           definition = function(x){
439 443
             replicates(sequenceData(x))
440 444
           })
441 445
 #' @rdname Modifier-functions
442 446
 #' @export
443
-setMethod(f = "sequenceData", 
447
+setMethod(f = "sequenceData",
444 448
           signature = signature(x = "Modifier"),
445 449
           definition = function(x){x@data})
446 450
 #' @rdname Modifier-functions
447 451
 #' @export
448
-setMethod(f = "sequences", 
452
+setMethod(f = "sequences",
449 453
           signature = signature(x = "Modifier"),
450
-          definition = 
454
+          definition =
451 455
             function(x, modified = FALSE){
452 456
               if(!assertive::is_a_bool(modified)){
453 457
                 stop("'modified' has to be a single logical value.",
... ...
@@ -462,14 +466,14 @@ setMethod(f = "sequences",
462 466
               ans <- ModRNAStringSet(sequences(sequenceData(x)))
463 467
               modSeqList <- ans[names(ans) %in% names(mod)]
464 468
               mod <- mod[match(names(mod),names(modSeqList))]
465
-              ans[names(ans) %in% names(mod)] <- 
469
+              ans[names(ans) %in% names(mod)] <-
466 470
                 Modstrings::combineIntoModstrings(modSeqList, mod)
467 471
               ans
468 472
             }
469 473
 )
470 474
 #' @rdname Modifier-functions
471 475
 #' @export
472
-setMethod(f = "seqinfo", 
476
+setMethod(f = "seqinfo",
473 477
           signature = signature(x = "Modifier"),
474 478
           definition = function(x){seqinfo(sequenceData(x))})
475 479
 
... ...
@@ -479,7 +483,7 @@ setMethod(f = "seqinfo",
479 483
   find.mod <- TRUE
480 484
   if(!is.null(input[["minCoverage"]])){
481 485
     minCoverage <- input[["minCoverage"]]
482
-    if(!is.integer(minCoverage) || 
486
+    if(!is.integer(minCoverage) ||
483 487
        minCoverage < 0L ||
484 488
        length(minCoverage) != 1){
485 489
       stop("'minCoverage' must be a single positive integer value.")
... ...
@@ -487,7 +491,7 @@ setMethod(f = "seqinfo",
487 491
   }
488 492
   if(!is.null(input[["minReplicate"]])){
489 493
     minReplicate <- input[["minReplicate"]]
490
-    if(!is.integer(minReplicate) || 
494
+    if(!is.integer(minReplicate) ||
491 495
        minReplicate < 0L ||
492 496
        length(minReplicate) != 1){
493 497
       stop("'minReplicate' must be a single positive integer value.")
... ...
@@ -507,7 +511,7 @@ setMethod(f = "seqinfo",
507 511
 
508 512
 #' @rdname Modifier-functions
509 513
 #' @export
510
-setMethod(f = "settings", 
514
+setMethod(f = "settings",
511 515
           signature = signature(x = "Modifier"),
512 516
           definition = function(x, name){
513 517
             if(missing(name) || is.null(name)){
... ...
@@ -521,7 +525,7 @@ setMethod(f = "settings",
521 525
 )
522 526
 #' @rdname Modifier-functions
523 527
 #' @export
524
-setReplaceMethod(f = "settings", 
528
+setReplaceMethod(f = "settings",
525 529
           signature = signature(x = "Modifier"),
526 530
           definition = function(x, value){
527 531
             if(is.null(names(value)) && length(value) > 0L){
... ...
@@ -539,13 +543,13 @@ setReplaceMethod(f = "settings",
539 543
 
540 544
 #' @rdname Modifier-functions
541 545
 #' @export
542
-setMethod(f = "validAggregate", 
546
+setMethod(f = "validAggregate",
543 547
           signature = signature(x = "Modifier"),
544 548
           definition = function(x) x@aggregateValidForCurrentArguments
545 549
 )
546 550
 #' @rdname Modifier-functions
547 551
 #' @export
548
-setMethod(f = "validModification", 
552
+setMethod(f = "validModification",
549 553
           signature = signature(x = "Modifier"),
550 554
           definition = function(x) x@modificationsValidForCurrentArguments
551 555
 )
... ...
@@ -572,7 +576,7 @@ setMethod(f = "validModification",
572 576
   condition <- factor(names(bamfiles))
573 577
   new2(className,
574 578
        mod = .norm_mod(proto@mod, className),
575
-       bamfiles = bamfiles, 
579
+       bamfiles = bamfiles,
576 580
        condition = condition,
577 581
        replicate = .get_replicate_number(bamfiles, condition),
578 582
        data = data)
... ...
@@ -598,11 +602,11 @@ setMethod(f = "validModification",
598 602
              call. = FALSE)
599 603
       }
600 604
       bamfiles <- bamfiles[match(class,names(bamfiles))]
601
-      data <- BiocParallel::bpmapply(.load_SequenceData, classes, bamfiles, 
602
-                                     MoreArgs = list(annotation, sequences, 
605
+      data <- BiocParallel::bpmapply(.load_SequenceData, classes, bamfiles,
606
+                                     MoreArgs = list(annotation, sequences,
603 607
                                                      seqinfo, args))
604 608
     } else {
605
-      data <- BiocParallel::bplapply(classes, .load_SequenceData, bamfiles, 
609
+      data <- BiocParallel::bplapply(classes, .load_SequenceData, bamfiles,
606 610
                                      annotation, sequences, seqinfo, args)
607 611
     }
608 612
     data <- as(data,"SequenceDataList")
... ...
@@ -627,7 +631,7 @@ setMethod(f = "validModification",
627 631
   # Check that external classes are implemented correctly
628 632
   className <- .norm_modifiertype(className)
629 633
   # create prototype object for mod normalization and settings only
630
-  proto <- new(className) 
634
+  proto <- new(className)
631 635
   # short cut for creating an empty object
632 636
   if(is.null(x)){
633 637
     return(new2(className, mod = .norm_mod(proto@mod, className)))
... ...
@@ -660,7 +664,7 @@ setMethod(f = "validModification",
660 664
   if(settings(ans,"find.mod")){
661 665
     f <- which(Modstrings::shortName(Modstrings::ModRNAString()) %in% ans@mod)
662 666
     modName <- Modstrings::fullName(Modstrings::ModRNAString())[f]
663
-    message("Starting to search for '", paste(tools::toTitleCase(modName), 
667
+    message("Starting to search for '", paste(tools::toTitleCase(modName),
664 668
                                               collapse = "', '"),
665 669
             "' ... ", appendLF = FALSE)
666 670
     ans <- modify(ans)
... ...
@@ -670,11 +674,20 @@ setMethod(f = "validModification",
670 674
   ans
671 675
 }
672 676
 
677
+#' @rdname Modifier-class
678
+#' @export
679
+setGeneric(
680
+  name = "Modifier",
681
+  signature = c("x"),
682
+  def = function(className, x, annotation, sequences, seqinfo, ...)
683
+    standardGeneric("Modifier")
684
+)
685
+
673 686
 #' @rdname Modifier-class
674 687
 #' @export
675 688
 setMethod("Modifier",
676 689
           signature = c(x = "SequenceData"),
677
-          function(className, x, annotation = NULL, sequences = NULL, 
690
+          function(className, x, annotation = NULL, sequences = NULL,
678 691
                    seqinfo = NULL, ...){
679 692
             .new_ModFromSequenceData(className, x, ...)
680 693
           })
... ...
@@ -682,7 +695,7 @@ setMethod("Modifier",
682 695
 #' @export
683 696
 setMethod("Modifier",
684 697
           signature = c(x = "SequenceDataSet"),
685
-          function(className, x, annotation = NULL, sequences = NULL, 
698
+          function(className, x, annotation = NULL, sequences = NULL,
686 699
                    seqinfo = NULL, ...){
687 700
             .new_ModFromSequenceData(className, x, ...)
688 701
           })
... ...
@@ -690,7 +703,7 @@ setMethod("Modifier",
690 703
 #' @export
691 704
 setMethod("Modifier",
692 705
           signature = c(x = "SequenceDataList"),
693
-          function(className, x, annotation = NULL, sequences = NULL, 
706
+          function(className, x, annotation = NULL, sequences = NULL,
694 707
                    seqinfo = NULL, ...){
695 708
             .new_ModFromSequenceData(className, x, ...)
696 709
           })
... ...
@@ -698,7 +711,7 @@ setMethod("Modifier",
698 711
 #' @export
699 712
 setMethod("Modifier",
700 713
           signature = c(x = "character"),
701
-          function(className, x, annotation = NULL, sequences = NULL, 
714
+          function(className, x, annotation = NULL, sequences = NULL,
702 715
                    seqinfo = NULL, ...){
703 716
             .new_ModFromCharacter(className, x, annotation, sequences, seqinfo,
704 717
                                   ...)
... ...
@@ -707,7 +720,7 @@ setMethod("Modifier",
707 720
 #' @export
708 721
 setMethod("Modifier",
709 722
           signature = c(x = "list"),
710
-          function(className, x, annotation = NULL, sequences = NULL, 
723
+          function(className, x, annotation = NULL, sequences = NULL,
711 724
                    seqinfo = NULL, ...){
712 725
             .new_ModFromCharacter(className, x, annotation, sequences, seqinfo,
713 726
                                   ...)
... ...
@@ -716,7 +729,7 @@ setMethod("Modifier",
716 729
 #' @export
717 730
 setMethod("Modifier",
718 731
           signature = c(x = "BamFileList"),
719
-          function(className, x, annotation = NULL, sequences = NULL, 
732
+          function(className, x, annotation = NULL, sequences = NULL,
720 733
                    seqinfo = NULL, ...){
721 734
             .new_ModFromCharacter(className, x, annotation, sequences, seqinfo,
722 735
                                   ...)
... ...
@@ -726,52 +739,72 @@ setMethod("Modifier",
726 739
 
727 740
 #' @name aggregate
728 741
 #' @aliases hasAggregateData aggregateData getAggregateData
729
-#' 
730
-#' @title Aggreagte data per positions
731
-#' 
732
-#' @description 
733
-#' The aggregate function is defined per
734
-#' \code{\link[=SequenceData-class]{SequenceData}} object and can be triggered
735
-#' by either using the a \code{\link[=SequenceData-class]{SequenceData}} or
736
-#' \code{\link[=Modifier-class]{Modifier}}. For the letter it will just redirect
737
-#' to the \code{\link[=SequenceData-class]{SequenceData}} object, but will store
738
-#' the result. The data is then used for subsequent tasks, such as search for
739
-#' modifications and visualization of the results.
740
-#' 
741
-#' @param x a \code{\link[=SequenceData-class]{SequenceData}} or
742
-#'   \code{\link[=Modifier-class]{Modifier}} object.
742
+#'
743
+#' @title Aggregate data per positions
744
+#'
745
+#' @description
746
+#' The \code{aggregate} function is defined for each
747
+#' \code{\link[=SequenceData-class]{SequenceData}} object and can be used
748
+#' directly on a \code{\link[=SequenceData-class]{SequenceData}} object or
749
+#' indirectly via a \code{\link[=Modifier-class]{Modifier}} object.
750
+#'
751
+#' For the letter the call is redirect to the
752
+#' \code{\link[=SequenceData-class]{SequenceData}} object, the result summarized
753
+#' as defined for the individual \code{Modifier} class and stored in the
754
+#' \code{aggregate} slot of the \code{Modifier} object. The data is then used
755
+#' for subsequent tasks, such as search for modifications and visualization of
756
+#' the results.
757
+#'
758
+#' The summarization is implemented in the \code{aggregateData} for each type of
759
+#' \code{Modifier} class. The stored data from the \code{aggregate} slot can be
760
+#' retrieved using the \code{getAggregateData} function.
761
+#'
762
+#' Whether the aggrgeated data is already present in the \code{aggregate} slot
763
+#' can be checked using the \code{hasAggregateData} function.
764
+#'
765
+#' For \code{SequenceDataSet}, \code{SequenceDataList} and \code{ModfierSet}
766
+#' classes wrapper of the \code{aggregate} function exist as well.
767
+#'
768
+#' @param x a \code{\link[=SequenceData-class]{SequenceData}},
769
+#' \code{SequenceDataSet}, \code{SequenceDataList},
770
+#' \code{\link[=Modifier-class]{Modifier}} or
771
+#' \code{\link[=Modifier-class]{ModfierSet}}  object.
743 772
 #' @param force whether to recreate the aggregated data, if it is already stored
744 773
 #' inside the \code{Modifier} object.
745 774
 #' @param condition character value, which selects, for which condition the data
746
-#' should be aggregated. One of the following values: \code{Both}, 
747
-#' \code{Control}, \code{Treated} 
775
+#' should be aggregated. One of the following values: \code{Both},
776
+#' \code{Control}, \code{Treated}
748 777
 #' @param ... additional arguments
749
-#' 
750
-#' @return 
778
+#'
779
+#' @return
751 780
 #' \itemize{
752
-#' \item{\code{aggregate}: }{for \code{SequenceData} the aggregated data is
753
-#' returned as a \code{SplitDataFrameList} with an element per transcript, 
754
-#' whereas for a \code{Modifier} the modified input object is returned, 
755
-#' containing the aggregated data, which can be accessed using 
781
+#' \item{\code{aggregate}: }{for \code{SequenceData} object the aggregated data
782
+#' is returned as a \code{SplitDataFrameList} with an element per transcript,
783
+#' whereas for a \code{Modifier} the modified input object is returned,
784
+#' containing the aggregated data, which can be accessed using
756 785
 #' \code{getAggregateData}.}
757
-#' \item{\code{getAggregateData}: }{only for \code{Modifier}: a 
758
-#' \code{SplitDataFrameList} with an element per transcript is returned. If the 
759
-#' aggregated data is not stored in the object, it is generated on the fly, but 
760
-#' does not persist}
761
-#' \item{\code{hasAggregateData}: }{TRUE or FALSE. Does the \code{Modifier} 
786
+#' \item{\code{getAggregateData}: }{only for \code{Modifier}: a
787
+#' \code{SplitDataFrameList} with an element per transcript is returned. If the
788
+#' aggregated data is not stored in the object, it is generated on the fly, but
789
+#' does not persist.}
790
+#' \item{\code{hasAggregateData}: }{TRUE or FALSE. Does the \code{Modifier}
762 791
 #' object already contain aggregated data?}
763 792
 #' }
764
-#' 
765
-#' @return 
793
+#'
794
+#' @return
766 795
 #' If 'x' is a
767 796
 #' \itemize{
768
-#' \item{\code{\link[=SequenceData-class]{SequenceData}}} {a 
797
+#' \item{\code{\link[=SequenceData-class]{SequenceData}}} {a
769 798
 #' \code{SplitDataFrameList} with elments per transcript.}
770
-#' \item{\code{\link[=Modifier-class]{Modifier}}} {an updated \code{Modifier}
799
+#' \item{\code{\link[=SequenceDataSet-class]{SequenceDataSet}} or
800
+#' \code{\link[=SequenceDataList-class]{SequenceDataList}}} {a \code{SimpleList}
801
+#' with \code{SplitDataFrameList} as elements.}
802
+#' \item{\code{\link[=Modifier-class]{Modifier}} or
803
+#' \code{\link[=ModifierSet-class]{ModifierSet}}} {an updated \code{Modifier}
771 804
 #' object. The data can be accessed by using the \code{aggregateData} function.}
772 805
 #' }
773
-#' 
774
-#' @examples 
806
+#'
807
+#' @examples
775 808
 #' data(e5sd,package="RNAmodR")
776 809
 #' data(msi,package="RNAmodR")
777 810
 #' # modify() triggers the search for modifications in the data contained in
... ...
@@ -806,9 +839,9 @@ NULL
806 839
 
807 840
 #' @rdname aggregate
808 841
 #' @export
809
-setMethod(f = "aggregate", 
842
+setMethod(f = "aggregate",
810 843
           signature = signature(x = "Modifier"),
811
-          definition = 
844
+          definition =
812 845
             function(x, force = FALSE){
813 846
               if(missing(force)){
814 847
                 force <- FALSE
... ...
@@ -824,17 +857,17 @@ setMethod(f = "aggregate",
824 857
 
825 858
 #' @rdname aggregate
826 859
 #' @export
827
-setMethod(f = "aggregateData", 
860
+setMethod(f = "aggregateData",
828 861
           signature = signature(x = "Modifier"),
829
-          definition = 
862
+          definition =
830 863
             function(x){
831
-              stop("This functions needs to be implemented by '",class(x),
832
-                   "'.",call. = FALSE)
864
+              stop("The 'aggregateData' functions needs to be implemented by
865
+                   '",class(x),"'.",call. = FALSE)
833 866
             }
834 867
 )
835 868
 #' @rdname aggregate
836 869
 #' @export
837
-setMethod(f = "getAggregateData", 
870
+setMethod(f = "getAggregateData",
838 871
           signature = signature(x = "Modifier"),
839 872
           definition = function(x){
840 873
             x <- aggregate(x)
... ...
@@ -843,11 +876,11 @@ setMethod(f = "getAggregateData",
843 876
 
844 877
 #' @rdname aggregate
845 878
 #' @export
846
-setMethod(f = "hasAggregateData", 
879
+setMethod(f = "hasAggregateData",
847 880
           signature = signature(x = "Modifier"),
848
-          definition = 
881
+          definition =
849 882
             function(x){
850
-              if(is.null(x@aggregate) || nrow(x@aggregate) == 0L){
883
+              if(is.null(x@aggregate) || nrow(x@aggregate@unlistData) == 0L){
851 884
                 return(FALSE)
852 885
               }
853 886
               return(TRUE)
... ...
@@ -858,39 +891,39 @@ setMethod(f = "hasAggregateData",
858 891
 
859 892
 #' @name modify
860 893
 #' @aliases modifications
861
-#' 
894
+#'
862 895
 #' @title Searching for modifications in \code{SequenceData}
863
-#' 
864
-#' @description 
865
-#' \code{modify} triggers the search for modifications for a 
866
-#' \code{\link[=Modifier-class]{Modifier}} class. Usually this is done 
867
-#' automatically during construction of a \code{Modifier} object. It also makes 
868
-#' sure that the aggregated data is valid for the current settings and stores
869
-#' the results inside the \code{Modifier} object. The results can be accessed
870
-#' via the \code{modifications()} function.
871
-#' 
872
-#' \code{modifications} is the accessor for the found modifications.
873
-#' 
874
-#' \code{findMod} just returns the found modifications as a \code{GRanges} 
875
-#' object. It does not check for validity of the aggregate data in side the
876
-#' \code{Modifier} object. This function should only used internally or when
877
-#' developing a new \code{Modifier} class.
878
-#' 
896
+#'
897
+#' @description
898
+#' The \code{modify} function executes the search for modifications for a
899
+#' \code{\link[=Modifier-class]{Modifier}} class. Usually this is done
900
+#' automatically during construction of a \code{Modifier} object.
901
+#'
902
+#' When the \code{modify} functions is called, the aggregated data is checked
903
+#' for validity for the current settings and the search for modifications is
904
+#' performed using the \code{findMod}. The results are stored in the
905
+#' \code{modification} slot of the \code{Modifier} object, which is returned by
906
+#' \code{modify}. The results can be accessed via the \code{modifications()}
907
+#' function.
908
+#'
909
+#' \code{findMod} returns the found modifications as a \code{GRanges}
910
+#' object and has to be implemented for each individual \code{Modifier} class.
911
+#'
879 912
 #' @param x a \code{Modifier} object.
880 913
 #' @param force force to run \code{aggregate} again, if data is already stored
881 914
 #' in \code{x}.
882 915
 #' @param perTranscript For \code{modifications>} \code{TRUE} or \code{FALSE}:
883 916
 #'   Should the coordinates be returned as local per transcript coordinates?
884 917
 #' @param ... additional arguments
885
-#' 
886
-#' @return 
918
+#'
919
+#' @return
887 920
 #' \itemize{
888 921
 #' \item{\code{modify}: }{the updated \code{Modifier} object.}
889 922
 #' \item{\code{modifications}: }{the modifications found as a \code{GRanges}
890 923
 #' object.}
891 924
 #' }
892
-#' 
893
-#' @examples 
925
+#'
926
+#' @examples
894 927
 #' data(msi,package="RNAmodR")
895 928
 #' # modify() triggers the search for modifications in the data contained in
896 929
 #' # the Modifier or ModifierSet object
... ...
@@ -900,9 +933,9 @@ NULL
900 933
 
901 934
 #' @rdname modify
902 935
 #' @export
903
-setMethod(f = "modify", 
936
+setMethod(f = "modify",
904 937
           signature = signature(x = "Modifier"),
905
-          definition = 
938
+          definition =
906 939
             function(x, force = FALSE){
907 940
               if(missing(force)){
908 941
                 force <- FALSE
... ...
@@ -919,11 +952,11 @@ setMethod(f = "modify",
919 952
 
920 953
 #' @rdname modify
921 954
 #' @export
922
-setMethod(f = "findMod", 
955
+setMethod(f = "findMod",
923 956
           signature = signature(x = "Modifier"),
924
-          definition = 
957
+          definition =
925 958
             function(x){
926
-              stop("This functions needs to be implemented by '",class(x),
927
-                   "'.",call. = FALSE)
959
+              stop("The 'findMod' functions needs to be implemented by
960
+                   '",class(x),"'.",call. = FALSE)
928 961
             }
929 962
 )
... ...
@@ -9,8 +9,8 @@ NULL
9 9
 #' 
10 10
 #' @description 
11 11
 #' \code{plotROC} streamlines labeling, prediction, performance and plotting
12
-#' to test the peformance of a \code{Modifier} object and the data analyzed via
13
-#' the functionallity from the \code{ROCR} package.
12
+#' functions to test the peformance of a \code{Modifier} object and the data 
13
+#' analyzed via the functionallity from the \code{ROCR} package.
14 14
 #' 
15 15
 #' The data from \code{x} will be labeled as positive using the \code{coord}
16 16
 #' arguments. The other arguments will be passed on to the specific \code{ROCR}
... ...
@@ -5,38 +5,46 @@ NULL
5 5
 #' @name subsetByCoord
6 6
 #' @aliases subsetByCoord labelByCoord
7 7
 #' 
8
-#' @title Subsetting data from a \code{Modifier} or \code{ModifierSet} object.
8
+#' @title Subsetting data from a \code{SequenceData}, \code{SequenceDataSet},
9
+#' \code{SequenceDataList}, \code{Modifier} or \code{ModifierSet} object.
9 10
 #' 
10 11
 #' @description 
11
-#' With \code{subsetByCoord} data from a \code{Modifier} or \code{ModifierSet}
12
-#' object will be subset to position as defined in \code{coord}. If \code{coord}
13
-#' contains a column \code{mod} and \code{x} of type \code{Modifier}, it will
14
-#' be filtered to identifiers matching the
15
-#' \code{\link[=Modifier-functions]{modType}} of \code{x}. To disable remove
16
-#' the column \code{mod} from \code{coord} or set \code{type = NA}
12
+#' With the \code{subsetByCoord} function data from a \code{SequenceData},
13
+#' \code{SequenceDataSet}, \code{SequenceDataList}, \code{Modifier} or
14
+#' \code{ModifierSet} object can be subset to positions as defined in
15
+#' \code{coord}.
17 16
 #' 
18
-#' \code{labelByCoord} functions the same. It will return a
17
+#' If \code{coord} contains a column \code{mod} and \code{x} is a
18
+#' \code{Modifier} object, it will be filtered to identifiers matching the
19
+#' \code{\link[=Modifier-functions]{modType}} of \code{x}. To disable this
20
+#' behaviour remove the column \code{mod} from \code{coord} or set \code{type =
21
+#' NA}
22
+#' 
23
+#' \code{labelByCoord} functions similarly. It will return a
19 24
 #' \code{SplitDataFrameList}, which matches the dimensions of the aggregated
20
-#' data plus the \code{labels} column.
25
+#' data plus the \code{labels} column, which contains logical values to indicate
26
+#' selected positions.
21 27
 #' 
22
-#' @param x a \code{Modifier} or \code{ModifierSet} object.
28
+#' @param x a \code{SequenceData}, \code{SequenceDataSet},
29
+#' \code{SequenceDataList}, \code{Modifier} or \code{ModifierSet} object.
23 30
 #' @param coord coordinates of position to subset to. Either a \code{GRanges} or
24
-#' a \code{GRangesList} object. For both types the Parent column is expected to
25
-#' match the gene or transcript name.
31
+#' a \code{GRangesList} object. For both types the 'Parent' column is expected to
32
+#' match the transcript name.
26 33
 #' @param ... optional parameters:
27 34
 #' \itemize{
28
-#' \item{\code{name}} {Limit results to one specific gene or transcript}
29
-#' \item{\code{type}} {the modification type used for subsetting. By default this
30
-#' is derived from the \code{modType(x)}, but it can be overwritten using 
35
+#' \item{\code{name}:} {Limit results to one specific transcript.}
36
+#' \item{\code{type}:} {the modification type used for subsetting. By default 
37
+#' this is derived from the \code{modType(x)}, but it can be overwritten using 
31 38
 #' \code{type}. It must be a valid shortName for a modification according to
32
-#' \code{shortName(ModRNAString())} and of course present in metadata column 
33
-#' \code{mod} of \code{coord}}
34
-#' \item{flanking} {a single integer value how many flanking position should be
35
-#' included in the subset (default = \code{flanking = 0L}).}
36
-#' \item{merge} {\code{TRUE} or \code{FALSE}: Should the 
37
-#' overlapping selections by merge? This is particular important, if flanking
39
+#' \code{shortName(ModRNAString())} and of course be present in metadata column 
40
+#' \code{mod} of \code{coord}. To disable subsetting based on type, set 
41
+#' \code{type = NA}.}
42
+#' \item{\code{flanking}:} {a single integer value to select how many flanking
43
+#' position should be included in the subset (default = \code{flanking = 0L}).}
44
+#' \item{\code{merge}:} {\code{TRUE} or \code{FALSE}: Should the 
45
+#' overlapping selections be merged? This is particular important, if flanking
38 46
 #' value \code{!= 0L} are set. (default: \code{merge = TRUE}).}
39
-#' \item{\code{perTranscript}} {\code{TRUE} or \code{FALSE}: Should the 
47
+#' \item{\code{perTranscript}:} {\code{TRUE} or \code{FALSE}: Should the 
40 48
 #' positions labeled per transcript and not per chromosome?
41 49
 #' (default: \code{perTranscript = FALSE}).}
42 50
 #' }
... ...
@@ -44,9 +52,12 @@ NULL
44 52
 #' @return 
45 53
 #' If 'x' is a
46 54
 #' \itemize{
47
-#' \item{\code{\link[=Modifier-class]{Modifier}}} {a \code{SplitDataFrameList}
55
+#' \item{\code{\link[=SequenceData-class]{SequenceData}} or 
56
+#' \code{\link[=Modifier-class]{Modifier}}} {a \code{SplitDataFrameList}
48 57
 #' with elments per transcript.}
49
-#' \item{\code{\link[=ModifierSet-class]{ModifierSet}}} {a \code{SimpleList} of
58
+#' \item{\code{\link[=SequenceDataSet-class]{SequenceDataSet}},
59
+#' \code{\link[=SequenceDataList-class]{SequenceDataList}} or
60
+#' \code{\link[=ModifierSet-class]{ModifierSet}}} {a \code{SimpleList} of
50 61
 #' \code{SplitDataFrameList} with elments per transcript.}
51 62
 #' }
52 63
 #' 
... ...
@@ -2,6 +2,67 @@
2 2
 #' @include Modifier-class.R
3 3
 NULL
4 4
 
5
+#' @name visualizeData
6
+#' @aliases visualizeData visualizeDataByCoord getDataTrack
7
+#' 
8
+#' @title Visualizing data data from a \code{SequenceData}, 
9
+#' \code{SequenceDataSet}, \code{SequenceDataList}, \code{Modifier} or 
10
+#' \code{ModifierSet} object.
11
+#' 
12
+#' @description 
13
+#' With the \code{visualizeData} and \code{visualizeDataByCoord} functions data
14
+#' from a \code{SequenceData}, \code{SequenceDataSet}, \code{SequenceDataList},
15
+#' \code{Modifier} or \code{ModifierSet} object can be visualized.
16
+#' 
17
+#' Internally the functionality of the \code{Gviz} package is used. For each
18
+#' \code{SequenceData} and \code{Modifier} class the \code{getDataTrack} is
19
+#' implemented returning a \code{\link[Gviz:DataTrack-class]{DataTrack}} object
20
+#' from the \code{Gviz} package.
21
+#' 
22
+#' Positions to be visualized are selected by defining a genomic coordinate,
23
+#' for which \code{x} has to contain data.
24
+#' 
25
+#' @param x a \code{SequenceData}, \code{SequenceDataSet},
26
+#'   \code{SequenceDataList}, \code{Modifier} or \code{ModifierSet} object.
27
+#' @param coord coordinates of a positions to subset to as a 
28
+#' \code{GRanges} object. The 'Parent' column is expected to match the 
29
+#' transcript name.
30
+#' @param name Only for \code{visualizeData}: the transcript name
31
+#' @param from Only for \code{visualizeData}: start position
32
+#' @param to Only for \code{visualizeData}: end position
33
+#' @param type the data type of data show as data tracks.
34
+#' @param showSequenceData \code{TRUE} or \code{FALSE}: should the sequence data
35
+#' be shown? (default: \code{seqdata = FALSE})
36
+#' @param showSequence \code{TRUE} or \code{FALSE}: should a sequence track be 
37
+#' shown? (default: \code{seqdata = TRUE})
38
+#' @param showAnnotation \code{TRUE} or \code{FALSE}: should a annotation track 
39
+#' be shown? (default: \code{seqdata = FALSE})
40
+#' @param window.size integer value for the number of positions on the left and 
41
+#' right site of the selected positions included in the plotting (default: 
42
+#' \code{window.size = 15L})
43
+#' @param perTranscript \code{TRUE} or \code{FALSE}: Should the positions shown
44
+#' per transcript? (default: \code{perTranscript = FALSE})
45
+#' @param ... optional parameters:
46
+#' \itemize{
47
+#' \item{\code{modified.seq}} {\code{TRUE} or \code{FALSE}. Should the sequence 
48
+#' shown with modified nucleotide positions? (default: 
49
+#' \code{modified.seq = FALSE})}
50
+#' \item{\code{additional.mod}} {other modifications, which should be shown
51
+#' in the annotation and sequence track. The must be a \code{GRanges} compatible
52
+#' with \code{\link[Modstrings:separate]{combineIntoModstrings}}.}
53
+#' \item{\code{annotation.track.pars}} {Parameters passed onto the 
54
+#' \code{\link[Gviz:AnnotationTrack-class]{AnnotationTrack}}.}
55
+#' \item{\code{sequence.track.pars}} {Parameters passed onto the 
56
+#' \code{\link[Gviz:SequenceTrack-class]{SequenceTrack}}.}
57
+#' }
58
+#' 
59
+#' @return a plot send to the active graphic device
60
+#' 
61
+#' @examples 
62
+#' data(msi,package="RNAmodR")
63
+#' visualizeData(msi, "2", from = 10L, to = 45L)
64
+NULL
65
+
5 66
 .norm_show_argument <- function(show_arg, default = FALSE){
6 67
   if(missing(show_arg) || !assertive::is_a_bool(show_arg)){
7 68
     show_arg <- default
... ...
@@ -16,14 +16,13 @@ NULL
16 16
 #' the \code{ModifierSet} objects.
17 17
 #' 
18 18
 #' The \code{ModifierSet} is a virtual class, which derives from the 
19
-#' \code{SimpleList} with the slot \code{elementType = "Modifier"}. As 
20
-#' the \code{Modifier} it must be implemented for the specific analysis.
21
-#' 
19
+#' \code{SimpleList} class with the slot \code{elementType = "Modifier"}. The
20
+#' \code{ModifierSet} class has to be implemented for each specific analysis.#' 
22 21
 #' 
23 22
 #' @section Creation:
24 23
 #' The input files have to be provided as a \code{list} of elements. Each
25
-#' element in itself must be valid for the creation of \code{Modifier} object 
26
-#' (Have a look at the man page for more details) and must be named.
24
+#' element in itself must be valid for the creation of \code{\link{Modifier}}
25
+#' object (Have a look at the man page for more details) and must be named.
27 26
 #' 
28 27
 #' @param className The name of the class which should be constructed.
29 28
 #' @param x the input which can be of the following types
... ...
@@ -39,19 +38,23 @@ NULL
39 38
 #' existing bam files. Valid names are \code{control} and \code{treated}}
40 39
 #' }
41 40
 #' @param annotation annotation data, which must match the information contained
42
-#' in the BAM files. This is parameter is only required if \code{x} if not a 
41
+#' in the BAM files. This is parameter is only required, if \code{x} is not a 
43 42
 #' \code{Modifier} object.
44 43
 #' @param sequences sequences matching the target sequences the reads were 
45 44
 #' mapped onto. This must match the information contained in the BAM files. This
46
-#' is parameter is only required if \code{x} if not a \code{Modifier} object.
47
-#' @param seqinfo optional \code{\link[GenomeInfoDb:Seqinfo]{Seqinfo}} to 
48
-#' subset the transcripts analyzed on a chromosome basis.
45
+#' is parameter is only required, if \code{x} is not a \code{Modifier} object.
46
+#' @param seqinfo An optional \code{\link[GenomeInfoDb:Seqinfo-class]{Seqinfo}} 
47
+#' argument or character vector, which can be coerced to one, to subset the 
48
+#' sequences to be analyzed on a per chromosome basis.
49 49
 #' @param ... Additional otpional parameters:
50 50
 #' \itemize{
51
-#' \item{internalBP} {\code{TRUE} or \code{FALSE}: should 
52
-#' parallilazation used internally during creation of each \code{Modifier} or
53
-#' should the creation of the \code{Modifier} objects be parallalized? (default:
54
-#' \code{internalBP = FALSE})}
51
+#' \item{internalBP} {\code{TRUE} or \code{FALSE}: should parallelization used
52
+#' internally during creation of each \code{Modifier} or should the creation of
53
+#' the \code{Modifier} objects be parallalized? (default: \code{internalBP =
54
+#' FALSE}). Setting \code{internalBP} only makes sense, if the
55
+#' \code{\link{getData}} function for \code{\link{SequenceData}} class, the
56
+#' \code{\link[=aggregate]{aggregateData}} or the \code{\link[=modify]{findMod}}
57
+#' function contains parallelized code.}
55 58
 #' }
56 59
 #' All other arguments will be passed onto the \code{Modifier} objects.
57 60
 #' 
... ...
@@ -275,6 +278,15 @@ setMethod(f = "relistToClass",
275 278
   .ModifierSet(className, x)
276 279
 }
277 280
 
281
+#' @rdname ModifierSet-class
282
+#' @export
283
+setGeneric( 
284
+  name = "ModifierSet",
285
+  signature = c("x"),
286
+  def = function(className, x, annotation, sequences, seqinfo, ...)
287
+    standardGeneric("ModifierSet")
288
+)
289
+
278 290
 #' @rdname ModifierSet-class
279 291
 #' @export
280 292
 setMethod(f = "ModifierSet",
... ...
@@ -9,10 +9,10 @@ NULL
9 9
 #' 
10 10
 #' @description 
11 11
 #' To compare data of different samples, a
12
-#' \code{\link[=ModifierSet-class]{ModifierSet}} is used. To select the data
12
+#' \code{\link[=ModifierSet-class]{ModifierSet}} can be used. To select the data
13 13
 #' alongside the transcripts and their positions a
14 14
 #' \code{\link[GenomicRanges:GRanges-class]{GRanges}} or a
15
-#' \code{\link[GenomicRanges:GRanges-class]{GRangesList}} needs to be supplied.
15
+#' \code{\link[GenomicRanges:GRanges-class]{GRangesList}} needs to be provided.
16 16
 #' In case of a \code{GRanges} object, the parent column must match the
17 17
 #' transcript names as defined by the out put of \code{ranges(x)}, whereas in
18 18
 #' case of a \code{GRangesList} the element names must match the transcript
... ...
@@ -20,9 +20,9 @@ NULL
20 20
 #' 
21 21
 #' @param x a \code{Modifier} or \code{ModifierSet} object.
22 22
 #' @param coord coordinates of position to subset to. Either a \code{GRanges} or
23
-#' a \code{GRangesList} object. For both types the Parent column is expected to
24
-#' match the gene or transcript name. The \code{GRangesList} object is unlisted
25
-#' and only non duplicated entries are retained.
23
+#'   a \code{GRangesList} object. For both types the 'Parent' column is expected
24
+#'   to match the transcript name. The \code{GRangesList} object is
25
+#'   unlisted and only non duplicated entries are retained.
26 26
 #' @param name Only for \code{compare}: the transcript name
27 27
 #' @param from Only for \code{compare}: start position
28 28
 #' @param to Only for \code{compare}: end position
... ...
@@ -45,13 +45,13 @@ NULL
45 45
 #' \item{...} {passed on to \code{\link{subsetByCoord}}}
46 46
 #' }
47 47
 #' 
48
-#' @return \code{compareByCoord} returns a 
49
-#' \code{\link[IRanges:DataFrameList-class]{DataFrameList}} and
50
-#' \code{plotCompareByCoord} returns a \code{ggplot} object, which can be
51
-#' modified further. The \code{\link{DataFrameList}} contains columns per sample
52
-#' as well as \code{names}, \code{positions} and \code{mod} incorporated from
53
-#' the \code{coord} input. If \code{coord} contains a column \code{Activity}
54
-#' this is included in the results as well.
48
+#' @return \code{compareByCoord} returns a
49
+#'   \code{\link[S4Vectors:DataFrame-class]{DataFrame}} and
50
+#'   \code{plotCompareByCoord} returns a \code{ggplot} object, which can be
51
+#'   modified further. The \code{DataFrame} contains columns per sample as well
52
+#'   as the columns \code{names}, \code{positions} and \code{mod} incorporated
53
+#'   from the \code{coord} input. If \code{coord} contains a column
54
+#'   \code{Activity} this is included in the results as well.
55 55
 #' 
56 56
 #' @examples
57 57
 #' data(msi,package="RNAmodR")
... ...
@@ -6,7 +6,7 @@ NULL
6 6
   colours <- NA
7 7
   if(!is.null(input[["colours"]])){
8 8
     colours <- input[["colours"]]
9
-    if(!is.character(colours) || any(!.is_colour(colours))){
9
+    if(!is.character(colours) || any(!.are_colours(colours))){
10 10
       stop("'colours' must be valid colour representation, which can be ",
11 11
            "interpreted by col2rgb().",
12 12
            call. = FALSE)
... ...
@@ -97,43 +97,45 @@ NULL
97 97
 #' @name RNAmodR-datasets
98 98
 #' @title Example data in the RNAmodR package
99 99
 #' @description 
100
-#' This contains an example ModifierSet object
100
+#' The following datasets are contained in the RNAmodR package. They are used
101
+#' in the man page examples.
101 102
 #' @docType data
102 103
 #' @usage msi
103
-#' @usage psd
104
-#' @usage e5sd
105
-#' @format a \code{ModSetInosine} instance
104
+#' @format 
105
+#' \itemize{
106
+#' \item{msi} {a \code{ModSetInosine} instance}
107
+#' \item{sds} {a \code{SequenceDataSet} instance}
108
+#' \item{sdl} {a \code{SequenceDataList} instance}
109
+#' \item{psd} {a \code{PileupSequenceData} instance}
110
+#' \item{e5sd} {a \code{End5SequenceData} instance}
111
+#' \item{e3sd} {a \code{End3SequenceData} instance}
112
+#' \item{esd} {a \code{EndSequenceData} instance}
113
+#' \item{csd} {a \code{CoverageSequenceData} instance}
114
+#' \item{ne3sd} {a \code{NormEnd3SequenceData} instance}
115
+#' \item{ne5sd} {a \code{NormEnd5SequenceData} instance}
116
+#' \item{pesd} {a \code{ProtectedEndSequenceData} instance}
117
+#' }
106 118
 #' @keywords datasets
107 119
 "msi"
108 120
 #' @rdname RNAmodR-datasets
109
-#' @format a \code{SequenceDataSet} instance
110 121
 "sds"
111 122
 #' @rdname RNAmodR-datasets
112
-#' @format a \code{SequenceDataList} instance
113 123
 "sdl"
114 124
 #' @rdname RNAmodR-datasets
115
-#' @format a \code{PileupSequenceData} instance
116 125
 "psd"
117 126
 #' @rdname RNAmodR-datasets
118
-#' @format a \code{End5SequenceData} instance
119 127
 "e5sd"
120 128
 #' @rdname RNAmodR-datasets
121
-#' @format a \code{End3SequenceData} instance
122 129
 "e3sd"
123 130
 #' @rdname RNAmodR-datasets
124
-#' @format a \code{EndSequenceData} instance
125 131
 "esd"
126 132
 #' @rdname RNAmodR-datasets
127
-#' @format a \code{CoverageSequenceData} instance
128 133
 "csd"
129 134
 #' @rdname RNAmodR-datasets
130
-#' @format a \code{NormEnd3SequenceData} instance
131 135
 "ne3sd"
132 136
 #' @rdname RNAmodR-datasets
133
-#' @format a \code{NormEnd5SequenceData} instance
134 137
 "ne5sd"
135 138
 #' @rdname RNAmodR-datasets
136
-#' @format a \code{ProtectedEndSequenceData} instance
137 139
 "pesd"
138 140
 
139 141
 #' @name RNAmodR-development
... ...
@@ -10,10 +10,10 @@ NULL
10 10
 #' 
11 11
 #' @description 
12 12
 #' The \code{SequenceData} class is implemented to contain data on each position
13
-#' along a transcripts and holds the corresponding annotation data and
13
+#' along transcripts and holds the corresponding annotation data and
14 14
 #' nucleotide sequence of these transcripts. To access this data several
15 15
 #' \code{\link[=SequenceData-functions]{functions}} are available. The
16
-#' \code{SequenceData} class is a virtual class, from which specific class can
16
+#' \code{SequenceData} class is a virtual class, from which specific classes can
17 17
 #' be extended. Currently the following classes are implemented:
18 18
 #' 
19 19
 #' \itemize{
... ...
@@ -27,13 +27,13 @@ NULL
27 27
 #' \item{\code{\link[=ProtectedEndSequenceData-class]{ProtectedEndSequenceData}}}
28 28
 #' }
29 29
 #' 
30
-#' The annotation and sequence data can be accessed through \code{ranges} and
31
-#' \code{sequences}, respectively. Beaware, that the data is always given 
32
-#' according to genomic position with increasing \code{rownames}, but the
33
-#' sequence is given as the actual sequence of the transcript. Therefore, it 
34
-#' is necessary to treat the minus strand accordingly.
30
+#' The annotation and sequence data can be accessed through the functions
31
+#' \code{ranges} and \code{sequences}, respectively. Beaware, that the data is
32
+#' always provided according to genomic positions with increasing
33
+#' \code{rownames}, but the sequence is given as the actual sequence of the
34
+#' transcript. Therefore, it is necessary to treat the minus strand accordingly.
35 35
 #' 
36
-#' It is derived from the
36
+#' The \code{SequenceData} class is derived from the
37 37
 #' \code{\link[IRanges:DataFrameList-class]{CompressedSplitDataFrameList}} class
38 38
 #' with additional slots for annotation and sequence data. Some functionality is
39 39
 #' not inherited and not available, e.g. \code{cbind}, \code{rbind} amd
... ...
@@ -71,7 +71,10 @@ NULL
71 71
 #' @slot ranges a \code{\link[GenomicRanges:GRangesList-class]{GRangesList}} 
72 72
 #' object each element describing a transcript including its element. The 
73 73
 #' \code{GRangesList} is constructed from the 
74
-#' \code{\link[GenomicFeatures:transcriptsBy]{exonsBy(x, by="tx")}}.
74
+#' \code{\link[GenomicFeatures:transcriptsBy]{exonsBy(x, by="tx")}} function.
75
+#' If during construction a \code{GRangesList} is provided instead of a 
76
+#' character value pointing to a gff3 file or a \code{TxDb} object, it must have
77
+#' a comparable structure. 
75 78
 #' @slot sequences a \code{\link[Biostrings:XStringSet-class]{XStringSet}} of 
76 79
 #' type \code{sequencesType}.
77 80
 #' @slot sequencesType a \code{character} value for the class name of 
... ...
@@ -665,6 +668,13 @@ setMethod("rownames", "SequenceData",
665 668
 
666 669
 ################################################################################
667 670
 
671
+setGeneric( 
672
+  name = "SequenceData",
673
+  signature = c("annotation","sequences"),
674
+  def = function(dataType, bamfiles, annotation, sequences, seqinfo, ...)
675
+    standardGeneric("SequenceData")
676
+) 
677
+
668 678
 setMethod("SequenceData",
669 679
           signature = c(annotation = "character", sequences = "character"),
670 680
           function(dataType, bamfiles, annotation, sequences, seqinfo, ...){
... ...
@@ -29,14 +29,17 @@ NULL
29 29
 #' @return a \code{CoverageSequenceData} object
30 30
 #' 
31 31
 #' @examples
32
-#' # Construct a CoverageSequenceData object
33
-#' library(Rsamtools)
32
+#' # Construction of a CoverageSequenceData objectobject
33
+#' \dontrun{
34
+#' library(RNAmodR.Data)
35
+#' library(rtracklayer)
34 36
 #' annotation <- GFF3File(RNAmodR.Data.example.gff3())
35 37
 #' sequences <- RNAmodR.Data.example.fasta()
36 38
 #' files <- c(control = RNAmodR.Data.example.bam.1(),
37 39
 #'            treated = RNAmodR.Data.example.bam.2())
38 40
 #' csd <- CoverageSequenceData(files, annotation = annotation,
39 41
 #'                             sequences = sequences)
42
+#' }
40 43
 NULL
41 44
 
42 45
 #' @rdname CoverageSequenceData-class
... ...
@@ -4,41 +4,42 @@ NULL
4 4
 
5 5
 #' @name EndSequenceData-class
6 6
 #' @aliases End5SequenceData End3SequenceData EndSequenceData
7
-#' 
7
+#'
8 8
 #' @title End5SequenceData/End3SequenceData/EndSequenceData
9
-#' 
9
+#'
10 10
 #' @description
11 11
 #' The \code{End5SequenceData}/\code{End3SequenceData}/\code{EndSequenceData}
12
-#' aggregate the counts of read ends at each position along transcript. Whereas
13
-#' the first aggregate either the 5'-end or 3'-end, the \code{EndSequenceData}
14
-#' aggregates both.
15
-#' 
12
+#' classes aggregate the counts of read ends at each position along a
13
+#' transcript. \code{End5SequenceData}/\code{End3SequenceData} classes aggregate
14
+#' either the 5'-end or 3'-end, the \code{EndSequenceData} aggregates both.
15
+#'
16 16
 #' All three classes contain one column per data file named using the following
17 17
 #' naming convention \code{(end5/end3/end).condition.replicate}.
18
-#' 
18
+#'
19 19
 #' \code{aggregate} calculates the mean and sd for samples in the \code{control}
20 20
 #' and \code{treated} condition separatly.
21
-#' 
22
-#' @param bamfiles,annotation,seqinfo,grl,sequences,param,args,... See 
23
-#' \code{\link[=SequenceData-class]{SequenceData}} and 
21
+#'
22
+#' @param bamfiles,annotation,seqinfo,grl,sequences,param,args,... See
23
+#' \code{\link[=SequenceData-class]{SequenceData}} and
24 24
 #' \code{\link[=SequenceData-functions]{SequenceData-functions}}
25 25
 #' @param x a \code{End5SequenceData}, \code{End3SequenceData} or
26 26
 #' \code{EndSequenceData} object
27
-#' @param name For \code{getDataTrack}: a valid transcript name. Must be a name
28
-#' of \code{ranges(x)}
29
-#' @param condition For \code{\link{aggregate}}: condition for which the data 
27
+#' @param name For \code{\link[=visualizeDataByCoord]{getDataTrack}}: a valid
28
+#' transcript name. Must be a name of \code{ranges(x).}
29
+#' @param condition For \code{\link{aggregate}}: condition for which the data
30 30
 #' should be aggregated.
31
-#' 
32
-#' @return a \code{End5SequenceData}, a \code{End3SequenceData} or a 
31
+#'
32
+#' @return a \code{End5SequenceData}, a \code{End3SequenceData} or a
33 33
 #' \code{EndSequenceData} object
34
-#' 
34
+#'
35 35
 #' @examples
36
-#' # Construct a End5SequenceData object
37
-#' library(Rsamtools)
38
-#' annotation <- GFF3File(RNAmodR.Data.example.gff3())
39
-#' sequences <- RNAmodR.Data.example.fasta()
40
-#' files <- c(control = RNAmodR.Data.example.bam.1(),
41
-#'            treated = RNAmodR.Data.example.bam.2())
36
+#' # Construction of a End5SequenceData object
37
+#' library(RNAmodR.Data)
38
+#' library(rtracklayer)
39
+#' annotation <- GFF3File(RNAmodR.Data.example.man.gff3())
40
+#' sequences <- RNAmodR.Data.example.man.fasta()
41
+#' files <- c(control = RNAmodR.Data.example.wt.1(),
42
+#'            treated = RNAmodR.Data.example.wt.2())
42 43
 #' e5sd <- End5SequenceData(files, annotation = annotation,
43 44
 #'                         sequences = sequences)
44 45
 NULL
... ...
@@ -272,7 +273,7 @@ setMethod("getData",
272 273
   f <- .subset_to_condition(x@condition, condition)
273 274
   df <- x@unlistData[f]
274 275
   conditions <- unique(x@condition[f])
275
-  # set up some base values. replicates is here the same as the number of 
276
+  # set up some base values. replicates is here the same as the number of
276 277
   # columns, since a list per replicate is assumed
277 278
   # get means
278 279
   means <- IRanges::NumericList(
... ...
@@ -9,10 +9,9 @@ NULL
9 9
 #' 
10 10
 #' @description
11 11
 #' The \code{NormEnd5SequenceData}/\code{NormEnd3SequenceData}
12
-#' aggregate the counts of read ends (Either 5' or 3') at each position along 
13
-#' transcript. In addition the counts are then normalized to the length of the
14
-#' transcript and to the overlapping reads. Per sample three separate columns
15
-#' are stored named \code{ends},\code{norm.tx} and \code{norm.ol}.
12
+#' aggregate the counts of read ends (Either 5' or 3') at each position along a
13
+#' transcript. In addition, the number of counts are then normalized to the
14
+#' length of the transcript and to the overlapping reads.
16 15
 #' 
17 16
 #' Both classes contain three columns per data file named using the
18 17
 #' following naming convention \code{(normend5/normend3).condition.replicate}.
... ...
@@ -28,22 +27,25 @@ NULL
28 27
 #' \code{\link[=SequenceData-class]{SequenceData}} and
29 28
 #' \code{\link[=SequenceData-functions]{SequenceData-functions}}
30 29
 #' @param x a \code{CoverageSequenceData}
31
-#' @param name For \code{getDataTrack}: a valid transcript name. Must be a name
32
-#' of \code{ranges(x)}
30
+#' @param name For \code{\link[=visualizeDataByCoord]{getDataTrack}}: a valid 
31
+#' transcript name. Must be a name of \code{ranges(x)}
33 32
 #' @param condition For \code{\link{aggregate}}: condition for which the data 
34 33
 #' should be aggregated.
35 34
 #' 
36 35
 #' @return a \code{NormEnd5SequenceData} or \code{NormEnd3SequenceData} object
37 36
 #' 
38 37
 #' @examples
39
-#' # Construct a End5SequenceData object
40
-#' library(Rsamtools)
41
-#' annotation <- GFF3File(RNAmodR.Data.example.gff3())
42
-#' sequences <- RNAmodR.Data.example.fasta()
43
-#' files <- c(control = RNAmodR.Data.example.bam.1(),
44
-#'            treated = RNAmodR.Data.example.bam.2())
38
+#' # Construction of a NormEnd5SequenceData object
39
+#' library(RNAmodR.Data)
40
+#' library(rtracklayer)
41
+#' annotation <- GFF3File(RNAmodR.Data.example.man.gff3())
42
+#' sequences <- RNAmodR.Data.example.man.fasta()
43
+#' files <- c(control = RNAmodR.Data.example.wt.1(),
44
+#'            treated = RNAmodR.Data.example.wt.2())
45
+#' \dontrun{
45 46
 #' ne5sd <- NormEnd5SequenceData(files, annotation = annotation,
46
-#'                              sequences = sequences)
47
+#'                               sequences = sequences)
48
+#' }
47 49
 NULL
48 50
 
49 51
 #' @rdname NormEndSequenceData-class
... ...
@@ -18,26 +18,27 @@ NULL
18 18
 #' 
19 19
 #' \code{aggregate} calculates the mean and sd for each nucleotide in the
20 20
 #' \code{control} and \code{treated} condition separatly. The results are then
21
-#' normalized to a rowSum of 1.
21
+#' normalized to a row sum of 1.
22 22
 #' 
23 23
 #' @param bamfiles,annotation,seqinfo,grl,sequences,param,args,... See 
24 24
 #' \code{\link[=SequenceData-class]{SequenceData}} and
25 25
 #' \code{\link[=SequenceData-functions]{SequenceData-functions}}
26 26
 #' @param x a \code{PileupSequenceData}
27
-#' @param name For \code{getDataTrack}: a valid transcript name. Must be a name
28
-#' of \code{ranges(x)}
27
+#' @param name For \code{\link[=visualizeDataByCoord]{getDataTrack}}: a valid 
28
+#' transcript name. Must be a name of \code{ranges(x)}
29 29
 #' @param condition For \code{\link{aggregate}}: condition for which the data 
30 30
 #' should be aggregated.
31 31
 #' 
32 32
 #' @return a \code{PileupSequenceData} object
33 33
 #' 
34 34
 #' @examples
35
-#' # Construct a End5SequenceData object
36
-#' library(Rsamtools)
37
-#' annotation <- GFF3File(RNAmodR.Data.example.gff3())
38
-#' sequences <- RNAmodR.Data.example.fasta()
39
-#' files <- c(control = RNAmodR.Data.example.bam.1(),
40
-#'            treated = RNAmodR.Data.example.bam.2())
35
+#' # Construction of a PileupSequenceData object
36
+#' library(RNAmodR.Data)
37
+#' library(rtracklayer)
38
+#' annotation <- GFF3File(RNAmodR.Data.example.man.gff3())
39
+#' sequences <- RNAmodR.Data.example.man.fasta()
40
+#' files <- c(control = RNAmodR.Data.example.wt.1(),
41
+#'            treated = RNAmodR.Data.example.wt.2())
41 42
 #' psd <- PileupSequenceData(files, annotation = annotation,
42 43
 #'                           sequences = sequences)
43 44
 NULL
... ...
@@ -17,14 +17,15 @@ RNAMODR_PROT_SEQDATA_PLOT_DATA_COLOURS <- c(means = "#FBB4AE",
17 17
 #' @description
18 18
 #' \code{ProtectedEndSequenceData} implements
19 19
 #' \code{\link[=SequenceData-class]{SequenceData}} to contain and aggregate the
20
-#' start and ends of reads per position along the transcripts. 
21
-#' \code{ProtectedEndSequenceData} behaves specially and offsets the start 
22
-#' position by -1 to align the information on the 5'-3'-phosphate bonds to one
23
-#' position. The \code{ProtectedEndSequenceData} class is specifically used
24
-#' for the RiboMethSeq method.
20
+#' start and ends of reads per position along a transcript.
21
+#' \code{ProtectedEndSequenceData} offsets the start position by -1 to align the
22
+#' information on the 5'-3'-phosphate bonds to one position. The
23
+#' \code{ProtectedEndSequenceData} class is implemented specifically as required
24
+#' for the \code{RiboMethSeq} method.
25 25
 #' 
26
-#' Both classes contain three columns per data file named using the
27
-#' following naming convention \code{protectedend.condition.replicate}.
26
+#' The objects of type \code{ProtectedEndSequenceData} contain three columns per
27
+#' data file named using the following naming convention
28
+#' \code{protectedend.condition.replicate}.
28 29
 #' 
29 30
 #' \code{aggregate} calculates the mean and sd for samples in the \code{control}
30 31
 #' and \code{treated} condition separatly.
... ...
@@ -33,20 +34,21 @@ RNAMODR_PROT_SEQDATA_PLOT_DATA_COLOURS <- c(means = "#FBB4AE",
33 34
 #' \code{\link[=SequenceData-class]{SequenceData}} and
34 35
 #' \code{\link[=SequenceData-functions]{SequenceData-functions}}
35 36
 #' @param x a \code{ProtectedEndSequenceData}
36
-#' @param name For \code{getDataTrack}: a valid transcript name. Must be a name
37
-#' of \code{ranges(x)}
37
+#' @param name For \code{\link[=visualizeDataByCoord]{getDataTrack}}: a valid 
38
+#' transcript name. Must be a name of \code{ranges(x)}
38 39
 #' @param condition For \code{\link{aggregate}}: condition for which the data 
39 40
 #' should be aggregated.
40 41
 #' 
41 42
 #' @return a \code{ProtectedEndSequenceData} object
42 43
 #' 
43 44
 #' @examples 
44
-#' # Construct a ProtectedEndSequenceData object
45
-#' library(Rsamtools)
46
-#' annotation <- GFF3File(RNAmodR.Data.example.gff3())
47
-#' sequences <- RNAmodR.Data.example.fasta()
48
-#' files <- c(control = RNAmodR.Data.example.bam.1(),
49
-#'            treated = RNAmodR.Data.example.bam.2())
45
+#' # Construction of a ProtectedEndSequenceData object
46
+#' library(RNAmodR.Data)
47
+#' library(rtracklayer)
48
+#' annotation <- GFF3File(RNAmodR.Data.example.man.gff3())
49
+#' sequences <- RNAmodR.Data.example.man.fasta()
50
+#' files <- c(control = RNAmodR.Data.example.wt.1(),
51
+#'            treated = RNAmodR.Data.example.wt.2())
50 52
 #' pesd <- ProtectedEndSequenceData(files, annotation = annotation,
51 53
 #'                                  sequences = sequences)
52 54
 NULL
... ...
@@ -2,54 +2,6 @@
2 2
 #' @include SequenceData-class.R
3 3
 NULL
4 4
 
5
-#' @name visualizeData
6
-#' @aliases visualizeData visualizeDataByCoord
7
-#' 
8
-#' @title visualizeData
9
-#' 
10
-#' @description 
11
-#' title
12
-#' 
13
-#' @param x a \code{Modifier} or \code{ModifierSet} object.
14
-#' @param coord coordinates of a positions to subset to as a 
15
-#' \code{GRanges} object. The Parent column is expected to match the gene or 
16
-#' transcript name.
17
-#' @param name Only for \code{visualizeData}: the transcript name
18
-#' @param from Only for \code{visualizeData}: start position
19
-#' @param to Only for \code{visualizeData}: end position
20
-#' @param type the data type of data show as data tracks.
21
-#' @param showSequenceData \code{TRUE} or \code{FALSE}: should the sequence data
22
-#' be shown? (default: \code{seqdata = FALSE})
23
-#' @param showSequence \code{TRUE} or \code{FALSE}: should a sequence track be 
24
-#' shown? (default: \code{seqdata = TRUE})
25
-#' @param showAnnotation \code{TRUE} or \code{FALSE}: should a annotation track 
26
-#' be shown? (default: \code{seqdata = FALSE})
27
-#' @param window.size integer value for the number of positions on the left and 
28
-#' right site of the selected positions included in the plotting (default: 
29
-#' \code{window.size = 15L})
30
-#' @param perTranscript \code{TRUE} or \code{FALSE}: Should the positions shown
31
-#' per transcript? (default: \code{perTranscript = FALSE})
32
-#' @param ... optional parameters:
33
-#' \itemize{
34
-#' \item{\code{modified.seq}} {\code{TRUE} or \code{FALSE}. Should the sequence 
35
-#' shown with modified nucleotide positions? (default: 
36
-#' \code{modified.seq = FALSE})}
37
-#' \item{\code{additional.mod}} {other modifications, which should be shown
38
-#' in the annotation and sequence track. The must be a \code{GRanges} compatible
39
-#' with \code{\link[Modstrings:separate]{combineIntoModstrings}}.}
40
-#' \item{\code{annotation.track.pars}} {Parameters passed onto the 
41
-#' \code{\link[Gviz:AnnotationTrack-class]{AnnotationTrack}}.}
42
-#' \item{\code{sequence.track.pars}} {Parameters passed onto the 
43
-#' \code{\link[Gviz:SequenceTrack-class]{SequenceTrack}}.}
44
-#' }
45
-#' 
46
-#' @return a plot send to the active graphic device
47
-#' 
48
-#' @examples 
49
-#' data(msi,package="RNAmodR")
50
-#' visualizeData(msi, "2", from = 10L, to = 45L)
51
-NULL
52
-
53 5
 # normalization functions for visualizations -----------------------------------
54 6
 
55 7
 .norm_coord_for_visualization <- function(ranges, coord){
... ...
@@ -122,7 +74,7 @@ NULL
122 74
 
123 75
 
124 76
 #' @importFrom grDevices col2rgb
125
-.is_colour <- function(x) {
77
+.are_colours <- function(x) {
126 78
   vapply(x,
127 79
          function(z) {
128 80
            tryCatch(is.matrix(grDevices::col2rgb(z)),
... ...
@@ -132,12 +84,12 @@ NULL
132 84
 }
133 85
 
134 86
 .norm_viz_colour <- function(colour, type = NA){
135
-  if(!is.character(colour) || !.is_colour(colour)){
87
+  if(!is.character(colour) || any(!.are_colours(colour))){
136 88
     stop("'colour' must be a character vector and contain valid colours, which",
137 89
          "can be interpreted by col2rgb().",
138 90
          call. = FALSE)
139 91
   }
140
-  if(length(type) > 1L || !is.na(type)){
92
+  if(length(type) > 1L || !anyNA(type)){
141 93
     if(length(colour) != 1){
142 94
       if(is.null(names(colour)) || !all(names(colour) %in% type)  ){
143 95
            stop("'colour' must be a named character vector parallel to 'type' ",
... ...
@@ -9,8 +9,8 @@ NULL
9 9
 #' 
10 10
 #' @description 
11 11
 #' The \code{SequenceData}, \code{SequenceDataSet}, \code{SequenceDataList} and
12
-#' \code{SequenceDataFrame} share functionality. Have a look at the elements
13
-#' listed under Usage.
12
+#' \code{SequenceDataFrame} classes share functionality. Have a look at the 
13
+#' elements listed directly below.
14 14
 #' 
15 15
 #' @param x,object a \code{SequenceData}, \code{SequenceDataSet}, 
16 16
 #' \code{SequenceDataList} or a \code{SequenceDataFrame} object.
... ...
@@ -24,13 +24,13 @@ NULL
24 24
 #' 
25 25
 #' @return 
26 26
 #' \itemize{
27
-#' \item{\code{seqinfo}} {a \code{Seqinfo} object ()}
28
-#' \item{\code{sequences}} {a \code{RNAStingSet} object or a \code{RNAString} 
29
-#' object for a \code{SequenceDataFrame}}
30
-#' \item{\code{ranges}} {a \code{GRangesList} object with each element per 
31
-#' transcript or a \code{GRanges} object for a \code{SequenceDataFrame}}
32
-#' \item{\code{bamfiles}} {a \code{BamFileList} object or a SimpleList of 
33
-#' \code{BamFileList} objects for a \code{SequenceDataList}}
27
+#' \item{\code{seqinfo}:} {a \code{Seqinfo} object ().}
28
+#' \item{\code{sequences}:} {a \code{RNAStingSet} object or a \code{RNAString} 
29
+#' object for a \code{SequenceDataFrame}.}
30
+#' \item{\code{ranges}:} {a \code{GRangesList} object with each element per 
31
+#' transcript or a \code{GRanges} object for a \code{SequenceDataFrame}.}
32
+#' \item{\code{bamfiles}:} {a \code{BamFileList} object or a SimpleList of 
33
+#' \code{BamFileList} objects for a \code{SequenceDataList}.}
34 34
 #' }
35 35
 #' 
36 36
 #' @examples 
... ...
@@ -48,12 +48,16 @@ NULL
48 48
 #' @title The SequenceDataFrame class
49 49
 #' 
50 50
 #' @description 
51
-#' The \code{SequenceDataFrame} class contains data for positions along a 
52
-#' transcripts. It is used to describe elements from a \code{SequenceData}
51
+#' The \code{SequenceDataFrame} class contains data for positions along a single
52
+#' transcript. It is used to describe elements from a \code{SequenceData}
53 53
 #' object.
54 54
 #' 
55
-#' It is derived from the \code{\link[S4Vectors:DataFrame-class]{DataFrame}} 
56
-#' class.
55
+#' The \code{SequenceDataFrame} class is derived from the
56
+#' \code{\link[S4Vectors:DataFrame-class]{DataFrame}} class.
57
+#' 
58
+#' Subsetting of a \code{SequenceDataFrame} returns a \code{SequenceDataFrame} or 
59
+#' \code{DataFrame}, if it is subset by a column or row, respectively. The 
60
+#' \code{drop} argument is ignored for column subsetting.
57 61
 #' 
58 62
 #' @param df the data as a \code{DataFrame}.
59 63
 #' @param ranges a \code{GRanges} object containing all annotation elements
... ...
@@ -11,7 +11,7 @@ NULL
11 11
 #' @description 
12 12
 #' The \code{SequenceDataList} class is used to hold \code{SequenceData} or 
13 13
 #' \code{SequenceDataSet} objects as its elements. It is derived from the 
14
-#' \code{\link[S4Vectors:List-class]{List}}.
14
+#' \code{\link[S4Vectors:List-class]{List}} class.
15 15
 #' 
16 16
 #' The \code{SequenceDataList} is used to hold data from different sets of
17 17
 #' aligned reads. This allows multiple methods to be aggregated into one
... ...
@@ -10,7 +10,7 @@ NULL
10 10
 #' @description 
11 11
 #' The \code{SequenceDataSet} class is used to hold \code{SequenceData} objects
12 12
 #' as its elements. It is derived from the 
13
-#' \code{\link[S4Vectors:List-class]{List}}.
13
+#' \code{\link[S4Vectors:List-class]{List}} class.
14 14
 #' 
15 15
 #' The \code{SequenceDataSet} is used to hold different data types from the of
16 16
 #' same aligned reads. The same dataset can be used to generate multiple sets of
... ...
@@ -47,8 +47,10 @@ following naming convention \code{coverage.condition.replicate}.
47 47
 and \code{treated} condition separatly.
48 48
 }
49 49
 \examples{
50
-# Construct a CoverageSequenceData object
51
-library(Rsamtools)
50
+# Construction of a CoverageSequenceData objectobject
51
+\dontrun{
52
+library(RNAmodR.Data)
53
+library(rtracklayer)
52 54
 annotation <- GFF3File(RNAmodR.Data.example.gff3())
53 55
 sequences <- RNAmodR.Data.example.fasta()
54 56
 files <- c(control = RNAmodR.Data.example.bam.1(),
... ...
@@ -56,3 +58,4 @@ files <- c(control = RNAmodR.Data.example.bam.1(),
56 58
 csd <- CoverageSequenceData(files, annotation = annotation,
57 59
                             sequences = sequences)
58 60
 }
61
+}
... ...
@@ -53,28 +53,28 @@ EndSequenceData(bamfiles, annotation, sequences, seqinfo, ...)
53 53
 \S4method{getDataTrack}{End3SequenceData}(x, name, ...)
54 54
 }
55 55
 \arguments{
56
-\item{bamfiles, annotation, seqinfo, grl, sequences, param, args, ...}{See 
57
-\code{\link[=SequenceData-class]{SequenceData}} and 
56
+\item{bamfiles, annotation, seqinfo, grl, sequences, param, args, ...}{See
57
+\code{\link[=SequenceData-class]{SequenceData}} and
58 58
 \code{\link[=SequenceData-functions]{SequenceData-functions}}}
59 59
 
60 60
 \item{x}{a \code{End5SequenceData}, \code{End3SequenceData} or
61 61
 \code{EndSequenceData} object}
62 62
 
63
-\item{condition}{For \code{\link{aggregate}}: condition for which the data 
63
+\item{condition}{For \code{\link{aggregate}}: condition for which the data
64 64
 should be aggregated.}
65 65
 
66
-\item{name}{For \code{getDataTrack}: a valid transcript name. Must be a name
67
-of \code{ranges(x)}}
66
+\item{name}{For \code{\link[=visualizeDataByCoord]{getDataTrack}}: a valid
67
+transcript name. Must be a name of \code{ranges(x).}}
68 68
 }
69 69
 \value{
70
-a \code{End5SequenceData}, a \code{End3SequenceData} or a 
70
+a \code{End5SequenceData}, a \code{End3SequenceData} or a
71 71
 \code{EndSequenceData} object
72 72
 }
73 73
 \description{
74 74
 The \code{End5SequenceData}/\code{End3SequenceData}/\code{EndSequenceData}
75
-aggregate the counts of read ends at each position along transcript. Whereas
76
-the first aggregate either the 5'-end or 3'-end, the \code{EndSequenceData}
77
-aggregates both.
75
+classes aggregate the counts of read ends at each position along a
76
+transcript. \code{End5SequenceData}/\code{End3SequenceData} classes aggregate
77
+either the 5'-end or 3'-end, the \code{EndSequenceData} aggregates both.
78 78
 
79 79
 All three classes contain one column per data file named using the following
80 80
 naming convention \code{(end5/end3/end).condition.replicate}.
... ...
@@ -83,12 +83,13 @@ naming convention \code{(end5/end3/end).condition.replicate}.
83 83
 and \code{treated} condition separatly.
84 84
 }
85 85
 \examples{
86
-# Construct a End5SequenceData object
87
-library(Rsamtools)
88
-annotation <- GFF3File(RNAmodR.Data.example.gff3())
89
-sequences <- RNAmodR.Data.example.fasta()
90
-files <- c(control = RNAmodR.Data.example.bam.1(),
91
-           treated = RNAmodR.Data.example.bam.2())
86
+# Construction of a End5SequenceData object
87
+library(RNAmodR.Data)
88
+library(rtracklayer)
89
+annotation <- GFF3File(RNAmodR.Data.example.man.gff3())
90
+sequences <- RNAmodR.Data.example.man.fasta()
91
+files <- c(control = RNAmodR.Data.example.wt.1(),
92
+           treated = RNAmodR.Data.example.wt.2())
92 93
 e5sd <- End5SequenceData(files, annotation = annotation,
93 94
                         sequences = sequences)
94 95
 }
... ...
@@ -50,7 +50,8 @@ see also the man pages for the functions mentioned below.}
50 50
 \item{\code{aggregate}} {See \code{\link{aggregate}}.}
51 51
 \item{\code{modify}} {See \code{\link{modify}}.}
52 52
 \item{\code{getDataTrack}} {a list of 
53
-\code{\link[Gviz:DataTrack-class]{DataTrack}} object.}
53
+\code{\link[Gviz:DataTrack-class]{DataTrack}} objects. See 
54
+\code{\link{visualizeDataByCoord}}.}
54 55
 \item{\code{visualizeData}} {See \code{\link{visualizeDataByCoord}}.}
55 56
 \item{\code{visualizeDataByCoord}} {See \code{\link{visualizeDataByCoord}}.}
56 57
 }
... ...
@@ -23,12 +23,12 @@ the \code{\link[RNAmodR:Modifier-class]{Modifier}} and
23 23
 \code{\link[RNAmodR:ModifierSet-class]{ModifierSet}} classes.}
24 24
 
25 25
 \item{annotation}{annotation data, which must match the information contained
26
-in the BAM files. This is parameter is only required if \code{x} if not a 
26
+in the BAM files. This is parameter is only required, if \code{x} is not a 
27 27
 \code{Modifier} object.}
28 28
 
29 29
 \item{sequences}{sequences matching the target sequences the reads were 
30 30
 mapped onto. This must match the information contained in the BAM files. This
31
-is parameter is only required if \code{x} if not a \code{Modifier} object.}
31
+is parameter is only required, if \code{x} is not a \code{Modifier} object.}
32 32
 
33 33
 \item{seqinfo}{An optional \code{\link[GenomeInfoDb:Seqinfo-class]{Seqinfo}} 
34 34
 argument or character vector, which can be coerced to one, to subset the 
... ...
@@ -52,10 +52,10 @@ Inosine can be detected in RNA-Seq data by the conversion of A positions to
52 52
 G. This conversion is detected by \code{ModInosine} and used to search for 
53 53
 Inosine positions. \code{dataType} is \code{"PileupSequenceData"}.
54 54
 
55
-Only samples named \code{treated} are used for this analysis, since the
56
-A to G conversion is common feature among the reverse transcriptases usually
57
-emploied. Let us know, if that is not the case, and the class needs to be
58
-modified.
55
+Only samples labeled with the condition \code{treated} are used for this
56
+analysis, since the A to G conversion is common feature among the reverse
57
+transcriptases usually emploied. Let us know, if that is not the case, and
58
+the class needs to be modified.
59 59
 
60 60
 Further information on \code{\link[=ModInosine-functions]{Functions}} of 
61 61
 \code{ModInosine}.
... ...
@@ -63,16 +63,19 @@ Further information on \code{\link[=ModInosine-functions]{Functions}} of
63 63
 \details{
64 64
 \code{ModInosine} score: the scores for reported Inosine positions are 
65 65
 between 0 and 1. They are calculated as the relative amount of called G bases 
66
-(\code{(G / N)}) and only kept for A positions.
66
+(\code{(G / N)}) and only saved for genomic A positions.
67 67
 }
68 68
 \examples{
69 69
 # construction of ModInosine object
70
-sequences <- RNAmodR.Data.example.AAS.fasta()
71
-annotation <- GFF3File(RNAmodR.Data.example.AAS.gff3())
70
+library(RNAmodR.Data)
71
+library(rtracklayer)
72
+annotation <- GFF3File(RNAmodR.Data.example.man.gff3())
73
+sequences <- RNAmodR.Data.example.man.fasta()
72 74
 files <- c(treated = RNAmodR.Data.example.wt.1(),
73 75
            treated = RNAmodR.Data.example.wt.2(),
74 76
            treated = RNAmodR.Data.example.wt.3())
75 77
 mi <- ModInosine(files,annotation = annotation ,sequences = sequences)
78
+\dontrun{
76 79
 # construction of ModSetInosine object
77 80
 files <- list("SampleSet1" = c(treated = RNAmodR.Data.example.wt.1(),
78 81
                                treated = RNAmodR.Data.example.wt.2(),
... ...
@@ -83,6 +86,7 @@ files <- list("SampleSet1" = c(treated = RNAmodR.Data.example.wt.1(),
83 86
                                treated = RNAmodR.Data.example.trm8.2()))
84 87
 msi <- ModSetInosine(files, annotation = annotation, sequences = sequences)
85 88
 }
89
+}
86 90
 \author{
87 91
 Felix G.M. Ernst [aut]
88 92
 }
... ...
@@ -12,6 +12,8 @@
12 12
 \alias{Modifier,BamFileList-method}
13 13
 \title{The Modifier class}
14 14
 \usage{
15
+Modifier(className, x, annotation, sequences, seqinfo, ...)
16
+
15 17
 \S4method{Modifier}{SequenceData}(className, x, annotation = NULL,
16 18
   sequences = NULL, seqinfo = NULL, ...)
17 19
 
... ...
@@ -35,10 +37,10 @@
35 37
 
36 38
 \item{x}{the input which can be of the following types
37 39
 \itemize{
38
-\item{\code{SequenceData}:} {a single \code{SequenceData} or a list containg
39
-only \code{SequenceData} objects. The input will just be used as elements of
40
-the \code{Modifier} and must match the requirements of specific
41
-\code{Modifier} class }
40
+\item{\code{SequenceData}:} {a single \code{SequenceData} or a list
41
+containing only \code{SequenceData} objects. The input will just be used to
42
+file the \code{data} slot of the \code{Modifier} and must match the
43
+requirements of specific \code{Modifier} class.}
42 44
 \item{\code{BamFileList}:} {a named \code{BamFileList}}
43 45
 \item{\code{character}:} {a \code{character} vector, which must be coercible
44 46
 to a named \code{BamFileList} referencing existing bam files. Valid names are
... ...
@@ -46,53 +48,57 @@ to a named \code{BamFileList} referencing existing bam files. Valid names are
46 48
 }}
47 49
 
48 50
 \item{annotation}{annotation data, which must match the information contained
49
-in the BAM files. This is parameter is only required if \code{x} if not a 
50
-\code{Modifier} object.}
51
+in the BAM files. This parameter is only required if \code{x} is not a
52
+\code{SequenceData} object or a list of \code{SequenceData} objects.}
51 53
 
52
-\item{sequences}{sequences matching the target sequences the reads were 
53
-mapped onto. This must match the information contained in the BAM files. This
54
-is parameter is only required if \code{x} if not a \code{Modifier} object.}
54
+\item{sequences}{sequences matching the target sequences the reads were
55
+mapped onto. This must match the information contained in the BAM files.
56
+TThis parameter is only required if \code{x} is not a \code{SequenceData}
57
+object or a list of \code{SequenceData} objects.}
55 58
 
56
-\item{seqinfo}{optional \code{\link[GenomeInfoDb:Seqinfo]{Seqinfo}} to 
57
-subset the transcripts analyzed on a chromosome basis.}
59
+\item{seqinfo}{An optional \code{\link[GenomeInfoDb:Seqinfo-class]{Seqinfo}}
60
+argument or character vector, which can be coerced to one, to subset the
61
+sequences to be analyzed on a per chromosome basis.}
58 62
 
59 63
 \item{...}{Additional otpional parameters:
60 64
 \itemize{
61
-\item{\code{find.mod}:} {\code{TRUE} or \code{FALSE}: should the search for for 
62
-modifications be triggered upon construction? If not the search can be 
65
+\item{\code{find.mod}:} {\code{TRUE} or \code{FALSE}: should the search for
66
+for modifications be triggered upon construction? If not the search can be
63 67
 started by calling the \code{modify()} function.}
64 68
 }
65
-All other arguments will be passed onto the \code{SequenceData} objects.}
69
+All other arguments will be passed onto the \code{SequenceData} objects, if
70
+\code{x} is not a \code{SequenceData} object or a list of \code{SequenceData}
71
+objects.}
66 72
 }
67 73
 \value{
68 74
 a \code{Modifier} object of type \code{className}
69 75
 }
70 76
 \description{
71
-The \code{Modifier} class is a virtual class, which provides the central 
72
-functionality for searching for patterns of post-transcriptional RNA 
73
-modifications in high throughput sequencing data.
77
+The \code{Modifier} class is a virtual class, which provides the central
78
+functionality to search for post-transcriptional RNA modification patterns in
79
+high throughput sequencing data.
74 80
 
75 81
 Each subclass has to implement the following functions:
76 82
 
77 83
 \itemize{
78
-\item{\code{\link{aggregate}}: }{used for specific data aggregation}
79
-\item{\code{\link{modify}}: }{used for specific search for modifications}
84
+\item{\code{\link{aggregateData}}: }{used for specific data aggregation}
85
+\item{\code{\link{findMod}}: }{used for specific search for modifications}
80 86
 }
81 87
 
82 88
 Optionally the function \code{\link[=Modifier-functions]{settings<-}} can be
83 89
 implemented to store additional arguments, which the base class does not
84 90
 recognize.
85 91
 
86
-\code{Modifier} objects are constructed centrally by calling 
92
+\code{Modifier} objects are constructed centrally by calling
87 93
 \code{Modifier()} with a \code{className} matching the specific class to be
88 94
 constructed. This will trigger the immediate analysis, if \code{find.mod} is
89
-not set to \code{TRUE}.
95
+not set to \code{FALSE}.
90 96
 }
91 97
 \section{Slots}{
92 98
 
93 99
 \describe{
94
-\item{\code{mod}}{a \code{character} value, which needs to contain one or more 
95
-elements from the alphabet of a 
100
+\item{\code{mod}}{a \code{character} value, which needs to contain one or more
101
+elements from the alphabet of a
96 102
 \code{\link[Modstrings:ModRNAString]{ModR