Browse code

riesco a risolvere sto problema dei lower?

Emanuel Soda authored on 13/05/2022 19:37:23
Showing57 changed files

... ...
@@ -58,8 +58,6 @@ Collate:
58 58
     'compute_metrics.R'
59 59
     'count_mapped_reads.R'
60 60
     'count_table.R'
61
-    'create_screenr_obj.R'
62
-    'create_screenr_object.R'
63 61
     'distribution_mapped_reads.R'
64 62
     'filter_by.R'
65 63
     'find_common_hit.R'
... ...
@@ -78,3 +76,4 @@ Collate:
78 76
     'plot_zscore_distribution.R'
79 77
     'screenr-class.R'
80 78
     'zzz.R'
79
+    'create_object.R'
81 80
new file mode 100644
... ...
@@ -0,0 +1,92 @@
1
+#' @title Create the ScreenR Object
2
+#' @description Initial function to create the Screen Object.
3
+#' @param table The count table obtained from the read alignment that
4
+#'                    contains the Barcodes as rows and samples as columns.
5
+#' @param annotation The annotation table containing the information
6
+#'                        for each Barcode and the association to the
7
+#'                        corresponding Gene
8
+#' @param groups A factor containing the experimental design label
9
+#' @param replicates A vector containing the replicates label
10
+#' @importFrom rlang .data
11
+#' @importFrom methods new
12
+#' @concept objects
13
+#' @return An object containing all the needed information for the analysis.
14
+#' @export
15
+#' @examples
16
+#' count_table <-
17
+#'     data.frame(
18
+#'         Barcode = c("Code_1", "Code_2", "Code_3", "Code_3"),
19
+#'         Time_3_rep1 = c("3520", "3020", "1507", "1400"),
20
+#'         Time_3_rep2 = c("3500", "3000", "1457", "1490"),
21
+#'         Time_3_TRT_rep1 = c("1200", "1100", "1300", "1350"),
22
+#'         Time_3_TRT_rep2 = c("1250", "1000", "1400", "1375")
23
+#'     )
24
+#' annotation_table <-
25
+#'     data.frame(
26
+#'         Gene = c("Gene_1", "Gene_1", "Code_2", "Code_2"),
27
+#'         Barcode = c("Code_1", "Code_2", "Code_3", "Code_3"),
28
+#'         Gene_ID = rep(NA, 4), Sequence = rep(NA, 4),
29
+#'         Library = rep(NA, 4)
30
+#'     )
31
+#'
32
+#' groups <- factor(c("Control", "Control", "Treated", "Treated"))
33
+#' obj <- create_screenr_object(
34
+#'     table = count_table,
35
+#'     annotation = annotation_table,
36
+#'     groups = groups, replicates = c("")
37
+#' )
38
+#' obj
39
+create_screenr_object <- function(table = NULL, annotation = NULL,
40
+                                  groups = NULL, replicates = c("")) {
41
+    # arcode <- as.factor(table$Barcode)
42
+    annotation$Barcode <- as.factor(annotation$Barcode)
43
+    object <- methods::new("screenr_object",
44
+                           count_table = tibble(table),
45
+                           annotation_table = tibble(annotation), groups = groups,
46
+                           replicates = replicates, normalized_count_table = tibble(),
47
+                           data_table = tibble()
48
+    )
49
+    return(object)
50
+}
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+#' @title Create edgeR Object
63
+#' @description Utility function that using the screenr-class
64
+#'              object create the corresponding edgeR object.
65
+#'              This function and other utility function enables the user to
66
+#'              not worry abut the implementation and just focus
67
+#'              on the analysis. The ScreenR package will take care of the rest.
68
+#' @param screenR_Object The ScreenR object obtained using the
69
+#'                       \code{\link{create_screenr_object}}
70
+#' @importFrom  edgeR DGEList
71
+#' @return The edgeR object will all the needed information for the analysis.
72
+#' @concept objects
73
+#' @export
74
+#' @examples
75
+#' object <- get0("object", envir = asNamespace("ScreenR"))
76
+#' create_edger_obj(object)
77
+create_edger_obj <- function(screenR_Object) {
78
+    # First create the Matrix of the Count table
79
+    counts <- screenR_Object@normalized_count_table
80
+    counts <- as.matrix(dplyr::select_if(counts, is.numeric))
81
+    # The group for the treatment
82
+    groups <- screenR_Object@groups
83
+
84
+    # The annotation
85
+    genes <- screenR_Object@annotation_table
86
+
87
+    # Create the edgeR object
88
+    DGEList <- edgeR::DGEList(counts = counts,
89
+                              group = groups,
90
+                              genes = genes)
91
+    return(DGEList)
92
+}
0 93
deleted file mode 100644
... ...
@@ -1,31 +0,0 @@
1
-#' @title Create edgeR Object
2
-#' @description Utility function that using the screenr-class
3
-#'              object create the corresponding edgeR object.
4
-#'              This function and other utility function enables the user to
5
-#'              not worry abut the implementation and just focus
6
-#'              on the analysis. The ScreenR package will take care of the rest.
7
-#' @param screenR_Object The ScreenR object obtained using the
8
-#'                       \code{\link{create_screenr_object}}
9
-#' @importFrom  edgeR DGEList
10
-#' @return The edgeR object will all the needed information for the analysis.
11
-#' @concept objects
12
-#' @export
13
-#' @examples
14
-#' object <- get0("object", envir = asNamespace("ScreenR"))
15
-#' create_edger_obj(object)
16
-create_edger_obj <- function(screenR_Object) {
17
-    # First create the Matrix of the Count table
18
-    counts <- screenR_Object@normalized_count_table
19
-    counts <- as.matrix(dplyr::select_if(counts, is.numeric))
20
-    # The group for the treatment
21
-    groups <- screenR_Object@groups
22
-
23
-    # The annotation
24
-    genes <- screenR_Object@annotation_table
25
-
26
-    # Create the edgeR object
27
-    DGEList <- edgeR::DGEList(counts = counts,
28
-                              group = groups,
29
-                              genes = genes)
30
-    return(DGEList)
31
-}
32 0
new file mode 100644
... ...
@@ -0,0 +1,33 @@
1
+#' @title Plot distribution Z-score
2
+#' @description This function plots the Log2FC Z-score distribution of the
3
+#'              treated vs control in the different time points.
4
+#'
5
+#' @param time_point_measure A list containing the table for each time
6
+#'                           point. Each table contains for each barcode
7
+#'                           the counts for the treated and control the Log2FC,
8
+#'                           Zscore, ZscoreRobust, Day.
9
+#'
10
+#' @param alpha A value for the opacity of the plot.
11
+#'              Allowed values are in the range 0 to 1
12
+#' @importFrom rlang .data
13
+#' @return return the density plot of the distribution of the Z-score
14
+#' @export
15
+#' @examples
16
+#' object <- get0("object", envir = asNamespace("ScreenR"))
17
+#'
18
+#' table1 <- compute_metrics(object,
19
+#'     control = "TRT", treatment = "Time3",
20
+#'     day = "Time3"
21
+#' )
22
+#'
23
+#' table2 <- compute_metrics(object,
24
+#'     control = "TRT", treatment = "Time4",
25
+#'     day = "Time4"
26
+#' )
27
+#'
28
+#' plot_zscore_distribution(list(table1, table2), alpha = 0.5)
29
+plot_zscore_distribution <- function(time_point_measure, alpha = 1) {
30
+  dplyr::bind_rows(time_point_measure) %>%
31
+    ggplot(aes(x = .data$Log2FC, fill = .data$Day)) +
32
+    geom_density(alpha = alpha)
33
+}
0 34
new file mode 100644
... ...
@@ -0,0 +1,265 @@
1
+#' @include  generics.R
2
+
3
+#' @title S4 ScreenR object class
4
+#' The screenr_object class is the main object of the package, it is passed
5
+#' to a series of function to perform the analysis.
6
+#'
7
+#' @slot count_table It is used to store the count table to perform the
8
+#'                   analysis
9
+#' @slot annotation_table It is used to store the annotation of the shRNA
10
+#' @slot groups It is used to store the vector of treated and untreated
11
+#' @slot replicates It is used to store information about the replicates
12
+#' @slot normalized_count_table It is used to store a normalized version of
13
+#'                              the count table
14
+#' @slot data_table It is used to store a tidy format of the count table
15
+#' @exportClass screenr_object
16
+#' @concept objects
17
+#' @rdname get_count_table
18
+#' @examples
19
+#' data("count_table", package = "ScreenR")
20
+#' data("annotation_table", package = "ScreenR")
21
+#'
22
+#' groups <- factor(c(
23
+#'     "T1/T2", "T1/T2", "Treated", "Treated", "Treated",
24
+#'     "Control", "Control", "Control", "Treated", "Treated",
25
+#'     "Treated", "Control", "Control", "Control"
26
+#' ))
27
+#'
28
+#' obj <- create_screenr_object(
29
+#'     table = count_table,
30
+#'     annotation = annotation_table,
31
+#'     groups = groups,
32
+#'     replicates = c("")
33
+#' )
34
+screenr_object <- setClass("screenr_object", methods::representation(
35
+  count_table = "data.frame",
36
+  annotation_table = "data.frame", groups = "factor", replicates = "vector",
37
+  normalized_count_table = "data.frame", data_table = "data.frame"
38
+))
39
+
40
+
41
+
42
+
43
+# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
44
+#                                 S4 methods
45
+# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
46
+
47
+#' @rdname get_count_table
48
+#' @aliases get_count_table,screenr_object
49
+#' @export
50
+setMethod(
51
+  f = "get_count_table",
52
+  signature = "screenr_object",
53
+  definition = function(object) {
54
+    if (is.null(object)) {
55
+      stop("The object is not defined!")
56
+    }
57
+    count_table <- slot(object = object, name = "count_table")
58
+    cat(
59
+      "ScreenR count table containing:\n",
60
+      nrow(x = count_table), "rows\n",
61
+      ncol(x = count_table), "columns\n"
62
+    )
63
+    return(count_table)
64
+  }
65
+)
66
+
67
+
68
+#' @rdname get_annotation_table
69
+#' @aliases get_annotation_table,screenr_object
70
+#' @export
71
+setMethod(
72
+  f = "get_annotation_table",
73
+  signature = "screenr_object",
74
+  definition = function(object) {
75
+    if (is.null(object)) {
76
+      stop("The object is not defined!")
77
+    }
78
+    annotation_table <- slot(object = object, name = "annotation_table")
79
+    cat(
80
+      "ScreenR annotation table containing:\n",
81
+      nrow(annotation_table),
82
+      "rows\n",
83
+      ncol(annotation_table),
84
+      "columns\n"
85
+    )
86
+    return(annotation_table)
87
+  }
88
+)
89
+
90
+
91
+#' @export
92
+#' @aliases get_groups,screenr_object
93
+#' @rdname get_groups
94
+setMethod(
95
+  f = "get_groups",
96
+  signature = "screenr_object",
97
+  definition = function(object) {
98
+    if (is.null(object)) {
99
+      stop("The object is not defined!")
100
+    }
101
+    return(slot(object = object, name = "groups"))
102
+  }
103
+)
104
+
105
+
106
+#' @export
107
+#' @aliases get_replicates,screenr_object
108
+#' @rdname get_replicates
109
+setMethod(
110
+  f = "get_replicates",
111
+  signature = "screenr_object",
112
+  definition = function(object) {
113
+    if (is.null(object)) {
114
+      stop("The object is not defined!")
115
+    }
116
+    return(slot(object = object, name = "replicates"))
117
+  }
118
+)
119
+
120
+
121
+#' @export
122
+#' @aliases get_normalized_count_table,screenr_object
123
+#' @rdname get_normalized_count_table
124
+setMethod(
125
+  f = "get_normalized_count_table",
126
+  signature = "screenr_object",
127
+  definition = function(object) {
128
+    if (is.null(object)) {
129
+      stop("The object is not defined!")
130
+    }
131
+    normalized_count_table <-
132
+      slot(object = object, name = "normalized_count_table")
133
+    cat(
134
+      "ScreenR normalized count table containing:\n",
135
+      nrow(x = normalized_count_table), "rows\n",
136
+      ncol(x = normalized_count_table), "columns\n"
137
+    )
138
+    return(normalized_count_table)
139
+  }
140
+)
141
+
142
+
143
+#' @export
144
+#' @aliases get_data_table,screenr_object
145
+#' @rdname get_data_table
146
+setMethod(
147
+  f = "get_data_table",
148
+  signature = "screenr_object",
149
+  definition = function(object) {
150
+    if (is.null(object)) {
151
+      stop("The object is not defined!")
152
+    }
153
+    data_table <-
154
+      slot(object = object, name = "data_table")
155
+    cat(
156
+      "ScreenR normalized data table containing:\n",
157
+      nrow(x = data_table), "rows\n",
158
+      ncol(x = data_table), "columns\n"
159
+    )
160
+    return(data_table)
161
+  }
162
+)
163
+
164
+
165
+#' @export
166
+#' @aliases set_count_table,screenr_object
167
+#' @rdname set_count_table
168
+setMethod(
169
+  f = "set_count_table",
170
+  signature = "screenr_object",
171
+  definition = function(object, count_table) {
172
+    if (is.null(object)) {
173
+      stop("The object is not defined!")
174
+    }
175
+    slot(object = object, name = "count_table") <- count_table
176
+    return(object)
177
+  }
178
+)
179
+
180
+
181
+#' @export
182
+#' @aliases set_annotation_table,screenr_object
183
+#' @rdname set_annotation_table
184
+setMethod(
185
+  f = "set_annotation_table",
186
+  signature = "screenr_object",
187
+  definition = function(object, annotation_table) {
188
+    if (is.null(object)) {
189
+      stop("The object is not defined!")
190
+    }
191
+    slot(object = object, name = "annotation_table") <- annotation_table
192
+    return(object)
193
+  }
194
+)
195
+
196
+
197
+#' @export
198
+#' @aliases set_groups,screenr_object
199
+#' @rdname set_groups
200
+setMethod(
201
+  f = "set_groups",
202
+  signature = "screenr_object",
203
+  definition = function(object, groups) {
204
+    if (is.null(object)) {
205
+      stop("The object is not defined!")
206
+    }
207
+    slot(object = object, name = "groups") <- groups
208
+    return(object)
209
+  }
210
+)
211
+
212
+
213
+
214
+#' @export
215
+#' @aliases set_replicates,screenr_object
216
+#' @rdname set_replicates
217
+setMethod(
218
+  f = "set_replicates",
219
+  signature = "screenr_object",
220
+  definition = function(object, replicates) {
221
+    if (is.null(object)) {
222
+      stop("The object is not defined!")
223
+    }
224
+    slot(object = object, name = "replicates") <- replicates
225
+    return(object)
226
+  }
227
+)
228
+
229
+
230
+#' @export
231
+#' @aliases set_normalized_count_table,screenr_object
232
+#' @rdname set_normalized_count_table
233
+setMethod(
234
+  f = "set_normalized_count_table",
235
+  signature = "screenr_object",
236
+  definition = function(object, normalized_count_table) {
237
+    if (is.null(object)) {
238
+      stop("The object is not defined!")
239
+    }
240
+    slot(
241
+      object = object,
242
+      name = "normalized_count_table"
243
+    ) <- normalized_count_table
244
+    return(object)
245
+  }
246
+)
247
+
248
+
249
+#' @export
250
+#' @aliases set_data_table,screenr_object
251
+#' @rdname set_data_table
252
+setMethod(
253
+  f = "set_data_table",
254
+  signature = "screenr_object",
255
+  definition = function(object, data_table) {
256
+    if (is.null(object)) {
257
+      stop("The object is not defined!")
258
+    }
259
+    slot(
260
+      object = object,
261
+      name = "data_table"
262
+    ) <- data_table
263
+    return(object)
264
+  }
265
+)
0 266
deleted file mode 100644
... ...
@@ -1,36 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/ScreenR-pacakage.R
3
-\docType{package}
4
-\name{ScreenR-package}
5
-\alias{ScreenR-package}
6
-\alias{ScreenR}
7
-\title{Tools for analyzing shRNAs screening data}
8
-\description{
9
-\strong{ScreenR} is an easy and effective package to perform hits
10
-identification in loss of function High Throughput Biological
11
-Screening performed with shRNAs library. ScreenR combines the
12
-power of software like edgeR with the simplicity of the Tidyverse
13
-metapackage. ScreenR executes a pipeline able to find candidate
14
-hits from barcode counts data and integrates a wide range of
15
-visualization for each step of the analysis.
16
-}
17
-\details{
18
-\strong{ScreenR} takes the a count table as input and create the
19
-screenr_object to perform the analysis. Throught the pipeline
20
-\strong{ScreenR} enable the user to perform quality control, visual
21
-inspection, dimensionality reduction of the data. Using three statistical
22
-methods:
23
-
24
-\itemize{
25
-  \item \href{https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2922896}{ROAST}
26
-  \item \href{https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3458527/}{CAMERA}
27
-  \item \href{https://pubmed.ncbi.nlm.nih.gov/21515799/}{Z-score}
28
-  }
29
-it is able to find new candidate hits. Moreover in order to improve the
30
-quality of the hit found it is also possible to further filter the list of
31
-hit using other filter like the variance and the slope filters.
32
-}
33
-\author{
34
-Emanuel Michele Soda \email{emanuelsoda@gmail.com}
35
-}
36
-\keyword{internal}
37 0
deleted file mode 100644
... ...
@@ -1,35 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/annotation_table.R
3
-\docType{data}
4
-\name{annotation_table}
5
-\alias{annotation_table}
6
-\title{Table for the annotation of Barcode}
7
-\format{
8
-A data frame with 5320 rows and 2 columns obtained from a
9
-        loss-of-function genetic screening. This table is used to
10
-        store information about the shRNAs:
11
-\describe{
12
-  \item{Gene}{It Contains the gene name}
13
-  \item{Barcode}{It contains an ID that identify each barcode
14
-                 (it is an unique identifier for an shRNA). I
15
-                 t can be use to merge the annotation table with t
16
-                 he count table}
17
-
18
-  \item{Gene_ID}{It Contains a unique Gene ID}
19
-
20
-  \item{Sequence}{It contains the cDNA sequence of the shRNA associated to
21
-                  the barcode}
22
-
23
-  \item{Library}{It contains the library from which the shRNA come from.
24
-                 In this case is a pooled from
25
-                 \url{https://cellecta.com/}{cellecta}}
26
-}
27
-}
28
-\usage{
29
-data(annotation_table)
30
-}
31
-\description{
32
-Table for the annotation of Barcode
33
-}
34
-\concept{data}
35
-\keyword{datasets}
36 0
deleted file mode 100644
... ...
@@ -1,30 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/barcode_lost.R
3
-\name{barcode_lost}
4
-\alias{barcode_lost}
5
-\title{Count number of barcode lost}
6
-\usage{
7
-barcode_lost(screenR_Object)
8
-}
9
-\arguments{
10
-\item{screenR_Object}{The ScreenR object obtained using the
11
-\code{\link{create_screenr_object}}}
12
-}
13
-\value{
14
-Return a tibble containing the number of barcode lost for each
15
-        sample
16
-}
17
-\description{
18
-This function counts the number of barcodes lost during the
19
-             sequencing. A barcode is lost if its associated shRNA has zero
20
-             mapped read in a sample.
21
-}
22
-\examples{
23
-object <- get0("object", envir = asNamespace("ScreenR"))
24
-
25
-# In order to count the number of barcodes lost just the ScreenR object is
26
-# needed
27
-head(barcode_lost(object))
28
-
29
-}
30
-\concept{compute}
31 0
deleted file mode 100644
... ...
@@ -1,48 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/camera_method.R
3
-\name{compute_camera}
4
-\alias{compute_camera}
5
-\title{Compute Camera}
6
-\usage{
7
-compute_camera(
8
-  xglm,
9
-  lrt,
10
-  DGEList,
11
-  matrix_model,
12
-  contrast,
13
-  number_barcode = 3,
14
-  thresh = 1e-04,
15
-  lfc = 1
16
-)
17
-}
18
-\arguments{
19
-\item{xglm}{object created with \code{\link[edgeR]{estimateDisp}}}
20
-
21
-\item{lrt}{object created with \code{\link[edgeR]{glmFit}}}
22
-
23
-\item{DGEList}{edgeR object}
24
-
25
-\item{...}{
26
-  Arguments passed on to \code{\link[=find_camera_hit]{find_camera_hit}}
27
-  \describe{
28
-    \item{\code{matrix_model}}{The matrix that will be used to perform the
29
-linear model analysis created using
30
-\code{\link[stats]{model.matrix}}}
31
-    \item{\code{thresh}}{The threshold for the False Discovery Rate (FDR) that has to be
32
-used to select the statistically significant hits.}
33
-    \item{\code{lfc}}{The Log2FC threshold.}
34
-    \item{\code{number_barcode}}{Number of barcode that as to be differentially
35
-expressed (DE)in order to consider the gene associated
36
-DE. Example a gene is associated
37
-with 10 shRNA we consider a gene DE if it has at least
38
-number_barcode = 5 shRNA DE.}
39
-  }}
40
-}
41
-\value{
42
-The list of hits found by the camera method
43
-}
44
-\description{
45
-This internal function computes the actual hits using  the
46
-             camera method.
47
-}
48
-\keyword{internal}
49 0
deleted file mode 100644
... ...
@@ -1,27 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/compute_data_table.R
3
-\name{compute_data_table}
4
-\alias{compute_data_table}
5
-\title{Compute data Table}
6
-\usage{
7
-compute_data_table(screenR_Object)
8
-}
9
-\arguments{
10
-\item{screenR_Object}{The ScreenR object obtained using the
11
-\code{\link{create_screenr_object}}}
12
-}
13
-\value{
14
-ScreenR_Object with the data_table filed containing the table.
15
-}
16
-\description{
17
-This function computes the data table that will be used
18
-             for the analysis. The data_table is a tidy and normalized
19
-             version of the original count_table and will be used
20
-             throughout the analysis.
21
-}
22
-\examples{
23
-object <- get0("object", envir = asNamespace("ScreenR"))
24
-object <- compute_data_table(object)
25
-head(slot(object, "data_table"))
26
-}
27
-\concept{compute}
28 0
deleted file mode 100644
... ...
@@ -1,25 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/plot_mds.R
3
-\name{compute_explained_variance}
4
-\alias{compute_explained_variance}
5
-\title{Compute explained variance}
6
-\usage{
7
-compute_explained_variance(screenR_Object)
8
-}
9
-\arguments{
10
-\item{screenR_Object}{The Object of the package}
11
-}
12
-\value{
13
-A data.frame containing all the information of the variance
14
-        expressed by the components
15
-}
16
-\description{
17
-This  is an internal function  used to compute
18
-             the explained variance by each of the Principal Components.
19
-}
20
-\examples{
21
-object <- get0("object", envir = asNamespace("ScreenR"))
22
-
23
-compute_explained_variance(object)
24
-}
25
-\keyword{internal}
26 0
deleted file mode 100644
... ...
@@ -1,48 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/compute_metrics.R
3
-\name{compute_metrics}
4
-\alias{compute_metrics}
5
-\title{Compute Metrics}
6
-\usage{
7
-compute_metrics(screenR_Object, control, treatment, day)
8
-}
9
-\arguments{
10
-\item{screenR_Object}{The ScreenR object obtained using the
11
-\code{\link{create_screenr_object}}}
12
-
13
-\item{control}{A string specifying the sample that as to be used as
14
-control in the analysis.
15
-This string has to be equal to the interested sample in the
16
-Treatment column of the data_table slot}
17
-
18
-\item{treatment}{A string specifying the sample that as to be used as
19
-treatment in the analysis.
20
-This string has to be equal to the interested sample in the
21
-Treatment column of the data_table slot.}
22
-
23
-\item{day}{A string containing the day (time point) to consider in the
24
-metrics computation.
25
-This string has to be equal to the interested sample in the
26
-Day column of the data_table slot.}
27
-}
28
-\value{
29
-Return a tibble with all the measure computed.
30
-}
31
-\description{
32
-This function computes the metrics that will be then used
33
-             to compute the z-score using the function
34
-             \code{\link{find_zscore_hit}} starting from the screenr object
35
-             for a given treatment in a given day. More information about the
36
-             z-score and other metrics used in genetic screening can be found
37
-             at this paper
38
-             \href{https://pubmed.ncbi.nlm.nih.gov/21515799/}{z-score}
39
-}
40
-\examples{
41
-object <- get0("object", envir = asNamespace("ScreenR"))
42
-metrics <- compute_metrics(object,
43
-    control = "TRT",
44
-    treatment = "Time3", day = "Time3"
45
-)
46
-head(metrics)
47
-}
48
-\concept{compute}
49 0
deleted file mode 100644
... ...
@@ -1,34 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/filter_by.R
3
-\name{compute_slope}
4
-\alias{compute_slope}
5
-\title{Compute Slope of a Gene}
6
-\usage{
7
-compute_slope(screenR_Object, genes, group_var)
8
-}
9
-\arguments{
10
-\item{screenR_Object}{The ScreenR object obtained using the
11
-\code{\link{create_screenr_object}}}
12
-
13
-\item{genes}{The genes for which the slope as to be computed. Those genes
14
-are the result of the three statistical methods selection}
15
-
16
-\item{group_var}{The variable to use  as independent variable (x)
17
-for the linear model}
18
-}
19
-\value{
20
-A tibble containing in each row the gene and the corresponding Slope
21
-}
22
-\description{
23
-This function is used to compute the slope of the gene passed
24
-             as input
25
-}
26
-\examples{
27
-object <- get0("object", envir = asNamespace("ScreenR"))
28
-
29
-compute_slope(object,
30
-    genes = c("Gene_42", "Gene_24"),
31
-    group_var = c("T1", "T2", "TRT")
32
-)
33
-}
34
-\concept{compute}
35 0
deleted file mode 100644
... ...
@@ -1,23 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/plot_trend.R
3
-\name{compute_trend}
4
-\alias{compute_trend}
5
-\title{Compute trend}
6
-\usage{
7
-compute_trend(screenR_Object, genes, group_var)
8
-}
9
-\arguments{
10
-\item{screenR_Object}{object created with \code{\link[edgeR]{estimateDisp}}}
11
-
12
-\item{genes}{a list of genes}
13
-
14
-\item{group_var}{the variable that as to be used as grouping variable}
15
-}
16
-\value{
17
-A table with the trend of the genes passed as input
18
-}
19
-\description{
20
-This is an internal function  used to computes the trend of
21
-             a gene
22
-}
23
-\keyword{internal}
24 0
deleted file mode 100644
... ...
@@ -1,27 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/count_mapped_reads.R
3
-\name{count_mapped_reads}
4
-\alias{count_mapped_reads}
5
-\title{Count the number of mapped read}
6
-\usage{
7
-count_mapped_reads(screenR_Object)
8
-}
9
-\arguments{
10
-\item{screenR_Object}{The ScreenR object obtained using the
11
-\code{\link{create_screenr_object}}}
12
-}
13
-\value{
14
-Return a tibble containing the number of mapped read for sample
15
-}
16
-\description{
17
-This function counts the number of reads for each barcode
18
-             in each sample. It is a quality control function (QC) to see if
19
-             the biological protocol went as planned.
20
-             If a sample has very low mapped compared to the other means
21
-             that is has a lower quality.
22
-}
23
-\examples{
24
-object <- get0("object", envir = asNamespace("ScreenR"))
25
-head(count_mapped_reads(object))
26
-}
27
-\concept{compute}
28 0
deleted file mode 100644
... ...
@@ -1,64 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/count_table.R
3
-\docType{data}
4
-\name{count_table}
5
-\alias{count_table}
6
-\title{Table of the count table}
7
-\format{
8
-A data frame with 5323 rows and 15 variables obtained from
9
-        barcode alignment to the reference genome/library.
10
-\describe{
11
-  \item{Barcode}{It contains an ID that identify each barcode. It can be use
12
-  to marge the annotation table with the count table. A Barcode is a unique
13
-  identifier of an shRNA. In a genetic screening multiple slightly different
14
-  shRNAs perform a knockout a gene each with its efficacy. For this reason
15
-  it is importat to keep track of each shRNA using a unique barcode.}
16
-
17
- \item{Time_1}{It contains the counts at time zero}
18
-
19
-  \item{Time_2}{It contains the counts after the cell were washed}
20
-  \item{Time_3_TRT_rep1}{It contains the counts for the first replicate
21
-                of the treated at the first time point}
22
-
23
-  \item{Time_3_TRT_rep2}{It contains the counts for the second replicate
24
-                of the treated at the first time point}
25
-
26
-  \item{Time_3_TRT_rep3}{It contains the counts for the third replicate
27
-                of the treated at the first time point}
28
-
29
-  \item{Time_3_rep1}{It contains the counts for the first replicate of the
30
-                control at the first time point}
31
-
32
-  \item{Time_3_rep2}{It contains the counts for the second replicate of the
33
-                control at the first time point}
34
-
35
-  \item{Time_3_rep3}{It contains the counts for the third replicate of the
36
-                control at the first time point}
37
-
38
-  \item{Time_4_TRT_rep1}{It contains the counts for the first replicate
39
-                of the treated at the second time point}
40
-
41
-  \item{Time_4_TRT_rep2}{It contains the counts for the second replicate
42
-                of the treated at the second time point}
43
-
44
-  \item{Time_4_TRT_rep3}{It contains the counts for the third replicate
45
-                of the treated at the second time point}
46
-
47
-  \item{Time_4_rep1}{It contains the counts for the first replicate of the
48
-                control at the second time point}
49
-
50
-  \item{Time_4_rep2}{It contains the counts for the second replicate of the
51
-                control at the second time point}
52
-
53
-  \item{Time_4_rep3}{It contains the counts for the third replicate of the
54
-                control at the second time point}
55
-}
56
-}
57
-\usage{
58
-data(count_table)
59
-}
60
-\description{
61
-Table of the count table
62
-}
63
-\concept{data}
64
-\keyword{datasets}
65 0
deleted file mode 100644
... ...
@@ -1,57 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/create_screenr_object.R
3
-\name{create_screenr_object}
4
-\alias{create_screenr_object}
5
-\title{Create the ScreenR Object}
6
-\usage{
7
-create_screenr_object(
8
-  table = NULL,
9
-  annotation = NULL,
10
-  groups = NULL,
11
-  replicates = c("")
12
-)
13
-}
14
-\arguments{
15
-\item{table}{The count table obtained from the read alignment that
16
-contains the Barcodes as rows and samples as columns.}
17
-
18
-\item{annotation}{The annotation table containing the information
19
-for each Barcode and the association to the
20
-corresponding Gene}
21
-
22
-\item{groups}{A factor containing the experimental design label}
23
-
24
-\item{replicates}{A vector containing the replicates label}
25
-}
26
-\value{
27
-An object containing all the needed information for the analysis.
28
-}
29
-\description{
30
-Initial function to create the Screen Object.
31
-}
32
-\examples{
33
-count_table <-
34
-    data.frame(
35
-        Barcode = c("Code_1", "Code_2", "Code_3", "Code_3"),
36
-        Time_3_rep1 = c("3520", "3020", "1507", "1400"),
37
-        Time_3_rep2 = c("3500", "3000", "1457", "1490"),
38
-        Time_3_TRT_rep1 = c("1200", "1100", "1300", "1350"),
39
-        Time_3_TRT_rep2 = c("1250", "1000", "1400", "1375")
40
-    )
41
-annotation_table <-
42
-    data.frame(
43
-        Gene = c("Gene_1", "Gene_1", "Code_2", "Code_2"),
44
-        Barcode = c("Code_1", "Code_2", "Code_3", "Code_3"),
45
-        Gene_ID = rep(NA, 4), Sequence = rep(NA, 4),
46
-        Library = rep(NA, 4)
47
-    )
48
-
49
-groups <- factor(c("Control", "Control", "Treated", "Treated"))
50
-obj <- create_screenr_object(
51
-    table = count_table,
52
-    annotation = annotation_table,
53
-    groups = groups, replicates = c("")
54
-)
55
-obj
56
-}
57
-\concept{objects}
58 0
deleted file mode 100644
... ...
@@ -1,27 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/create_screenr_obj.R
3
-\name{create_edger_obj}
4
-\alias{create_edger_obj}
5
-\title{Create edgeR Object}
6
-\usage{
7
-create_edger_obj(screenR_Object)
8
-}
9
-\arguments{
10
-\item{screenR_Object}{The ScreenR object obtained using the
11
-\code{\link{create_screenr_object}}}
12
-}
13
-\value{
14
-The edgeR object will all the needed information for the analysis.
15
-}
16
-\description{
17
-Utility function that using the screenr-class
18
-             object create the corresponding edgeR object.
19
-             This function and other utility function enables the user to
20
-             not worry abut the implementation and just focus
21
-             on the analysis. The ScreenR package will take care of the rest.
22
-}
23
-\examples{
24
-object <- get0("object", envir = asNamespace("ScreenR"))
25
-create_edger_obj(object)
26
-}
27
-\concept{objects}
28 0
deleted file mode 100644
... ...
@@ -1,57 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/create_screenr_object.R
3
-\name{create_screenr_object}
4
-\alias{create_screenr_object}
5
-\title{Create the ScreenR Object}
6
-\usage{
7
-create_screenr_object(
8
-  table = NULL,
9
-  annotation = NULL,
10
-  groups = NULL,
11
-  replicates = c("")
12
-)
13
-}
14
-\arguments{
15
-\item{table}{The count table obtained from the read alignment that
16
-contains the Barcodes as rows and samples as columns.}
17
-
18
-\item{annotation}{The annotation table containing the information
19
-for each Barcode and the association to the
20
-corresponding Gene}
21
-
22
-\item{groups}{A factor containing the experimental design label}
23
-
24
-\item{replicates}{A vector containing the replicates label}
25
-}
26
-\value{
27
-An object containing all the needed information for the analysis.
28
-}
29
-\description{
30
-Initial function to create the Screen Object.
31
-}
32
-\examples{
33
-count_table <-
34
-    data.frame(
35
-        Barcode = c("Code_1", "Code_2", "Code_3", "Code_3"),
36
-        Time_3_rep1 = c("3520", "3020", "1507", "1400"),
37
-        Time_3_rep2 = c("3500", "3000", "1457", "1490"),
38
-        Time_3_TRT_rep1 = c("1200", "1100", "1300", "1350"),
39
-        Time_3_TRT_rep2 = c("1250", "1000", "1400", "1375")
40
-    )
41
-annotation_table <-
42
-    data.frame(
43
-        Gene = c("Gene_1", "Gene_1", "Code_2", "Code_2"),
44
-        Barcode = c("Code_1", "Code_2", "Code_3", "Code_3"),
45
-        Gene_ID = rep(NA, 4), Sequence = rep(NA, 4),
46
-        Library = rep(NA, 4)
47
-    )
48
-
49
-groups <- factor(c("Control", "Control", "Treated", "Treated"))
50
-obj <- create_screenr_object(
51
-    table = count_table,
52
-    annotation = annotation_table,
53
-    groups = groups, replicates = c("")
54
-)
55
-obj
56
-}
57
-\concept{objects}
58 0
deleted file mode 100644
... ...
@@ -1,53 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/filter_by.R
3
-\name{filter_by_slope}
4
-\alias{filter_by_slope}
5
-\title{Filter using the slope filter}
6
-\usage{
7
-filter_by_slope(
8
-  screenR_Object,
9
-  genes,
10
-  group_var_treatment,
11
-  group_var_control,
12
-  slope_control,
13
-  slope_treatment
14
-)
15
-}
16
-\arguments{
17
-\item{screenR_Object}{The ScreenR object obtained using the
18
-\code{\link{create_screenr_object}}}
19
-
20
-\item{genes}{The genes for which the slope as to be computed. Those genes
21
-are the result of the three statistical methods selection}
22
-
23
-\item{group_var_treatment}{The variable to use as independent variable (x)
24
-for the linear model of the treatment}
25
-
26
-\item{group_var_control}{The variable to use as independent variable (x)
27
-for the linear model of the the control}
28
-
29
-\item{slope_control}{A value used as threshold for the control slope}
30
-
31
-\item{slope_treatment}{A value used as threshold for the treatment slope}
32
-}
33
-\value{
34
-A data frame with the slope for the treatment and the control
35
-        for each gene
36
-}
37
-\description{
38
-This function is used to improve the quality of the hits found.
39
-             It computes a regression line in the different samples ad uses
40
-             the slope of this line to see the trend
41
-}
42
-\examples{
43
-object <- get0("object", envir = asNamespace("ScreenR"))
44
-
45
-filter_by_slope(
46
-    screenR_Object = object, genes = c("Gene_1", "Gene_2"),
47
-    group_var_treatment = c("T1", "T2", "TRT"),
48
-    group_var_control = c("T1", "T2", "Time3", "Time4"),
49
-    slope_control = 0.5, slope_treatment = 1
50
-)
51
-
52
-}
53
-\concept{filter}
54 0
deleted file mode 100644
... ...
@@ -1,52 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/filter_by.R
3
-\name{filter_by_variance}
4
-\alias{filter_by_variance}
5
-\title{Filter using the variance filter}
6
-\usage{
7
-filter_by_variance(
8
-  screenR_Object,
9
-  genes,
10
-  matrix_model,
11
-  variance = 0.5,
12
-  contrast
13
-)
14
-}
15
-\arguments{
16
-\item{screenR_Object}{The ScreenR object obtained using the
17
-\code{\link{create_screenr_object}}}
18
-
19
-\item{genes}{The genes for which the variance as to be computed.
20
-Those genes are the result of the three statistical
21
-methods selection}
22
-
23
-\item{matrix_model}{a matrix created using \code{\link[stats]{model.matrix}}}
24
-
25
-\item{variance}{The maximum value of variance accepted}
26
-
27
-\item{contrast}{The variable to use as X for the linear model
28
-for the Treatment}
29
-}
30
-\value{
31
-A data frame with the variance for the treatment and the control
32
-        for each gene
33
-}
34
-\description{
35
-This function is used to improve the quality of the hits.
36
-             It compute the variance among the hits and filter the one with
37
-             a value greater than the threshold set
38
-}
39
-\examples{
40
-object <- get0("object", envir = asNamespace("ScreenR"))
41
-matrix_model <- model.matrix(~ slot(object, "groups"))
42
-colnames(matrix_model) <- c("Control", "T1_T2", "Treated")
43
-contrast <- limma::makeContrasts(Treated - Control, levels = matrix_model)
44
-
45
-data <- filter_by_variance(
46
-    screenR_Object = object, genes = c("Gene_42"),
47
-    matrix_model = matrix_model, contrast = contrast
48
-)
49
-head(data)
50
-
51
-}
52
-\concept{filter}
53 0
deleted file mode 100644
... ...
@@ -1,67 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/camera_method.R
3
-\name{find_camera_hit}
4
-\alias{find_camera_hit}
5
-\title{Find Camera Hit}
6
-\usage{
7
-find_camera_hit(
8
-  screenR_Object,
9
-  matrix_model,
10
-  contrast,
11
-  number_barcode = 3,
12
-  thresh = 1e-04,
13
-  lfc = 1,
14
-  direction = "Down"
15
-)
16
-}
17
-\arguments{
18
-\item{screenR_Object}{The ScreenR object obtained using the
19
-\code{\link{create_screenr_object}}}
20
-
21
-\item{matrix_model}{The matrix that will be used to perform the
22
-linear model analysis created using
23
-\code{\link[stats]{model.matrix}}}
24
-
25
-\item{contrast}{A vector or a single value indicating the index or the name
26
-of the column the model_matrix with which perform the
27
-analysis}
28
-
29
-\item{number_barcode}{Number of barcode that as to be differentially
30
-expressed (DE)in order to consider the gene associated
31
-DE. Example a gene is associated
32
-with 10 shRNA we consider a gene DE if it has at least
33
-number_barcode = 5 shRNA DE.}
34
-
35
-\item{thresh}{The threshold for the False Discovery Rate (FDR) that has to be
36
-used to select the statistically significant hits.}
37
-
38
-\item{lfc}{The Log2FC threshold.}
39
-
40
-\item{direction}{String containing the direction of the variation,
41
-"Down" for the down regulation "Up" for the up regulation.}
42
-}
43
-\value{
44
-The data frame containing the hit found using the camera method
45
-}
46
-\description{
47
-This function implements the method by proposed by Wu and
48
-             Smyth (2012).
49
-             The original \code{\link[limma]{camera}} method is a gene set
50
-             test, here is applied in the contest of a genetic screening
51
-             and so it erforms a competitive barcode set test.
52
-             The paper can be found here
53
-     \href{https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3458527/}{CAMERA}
54
-}
55
-\examples{
56
-object <- get0("object", envir = asNamespace("ScreenR"))
57
-
58
-matrix <- model.matrix(~ slot(object, "groups"))
59
-colnames(matrix) <- c("Control", "T1/T2", "Treated")
60
-
61
-result <- find_camera_hit(
62
-    screenR_Object = object,
63
-    matrix_model = matrix, contrast = "Treated"
64
-)
65
-head(result)
66
-}
67
-\concept{find}
68 0
deleted file mode 100644
... ...
@@ -1,41 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/find_common_hit.R
3
-\name{find_common_hit}
4
-\alias{find_common_hit}
5
-\title{Find common hit}
6
-\usage{
7
-find_common_hit(hit_zscore, hit_camera, hit_roast, common_in = 3)
8
-}
9
-\arguments{
10
-\item{hit_zscore}{The matrix obtained by the \code{\link{find_zscore_hit}}
11
-method}
12
-
13
-\item{hit_camera}{The matrix obtained by the \code{\link{find_camera_hit}}
14
-method}
15
-
16
-\item{hit_roast}{The matrix obtained by the \code{\link{find_roast_hit}}
17
-method}
18
-
19
-\item{common_in}{Number of methods in which the hit has to be in common
20
-in order to be considered a candidate hit.
21
-The default value is 3, which means that has to be present
22
-in the result of all the three methods.}
23
-}
24
-\value{
25
-A vector containing the common hit
26
-}
27
-\description{
28
-This method find the hit in common between the three methods
29
-}
30
-\examples{
31
-hit_zscore <- data.frame(Gene = c("A", "B", "C", "D", "E"))
32
-hit_camera <- data.frame(Gene = c("A", "B", "C", "F", "H", "G"))
33
-hit_roast <- data.frame(Gene = c("A", "L", "N"))
34
-
35
-# common among all the three methods
36
-find_common_hit(hit_zscore, hit_camera, hit_roast)
37
-
38
-# common among at least two of the three methods
39
-find_common_hit(hit_zscore, hit_camera, hit_roast, common_in = 2)
40
-}
41
-\concept{find}
42 0
deleted file mode 100644
... ...
@@ -1,66 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/find_roast_hit.R
3
-\name{find_roast_hit}
4
-\alias{find_roast_hit}
5
-\title{Find Roast Hit}
6
-\usage{
7
-find_roast_hit(
8
-  screenR_Object,
9
-  matrix_model,
10
-  contrast,
11
-  nrot = 9999,
12
-  number_barcode = 3,
13
-  direction = "Down",
14
-  p_val = 0.05
15
-)
16
-}
17
-\arguments{
18
-\item{screenR_Object}{The ScreenR object obtained using the
19
-\code{\link{create_screenr_object}}}
20
-
21
-\item{matrix_model}{The matrix that will be used to perform the
22
-linear model analysis. Created using
23
-\code{\link[stats]{model.matrix}}}
24
-
25
-\item{contrast}{A vector or a single value indicating the index or the name
26
-of the column the model_matrix to which perform the analysis}
27
-
28
-\item{nrot}{Number of rotation to perform the test.
29
-Higher number of rotation leads to more statistically significant
30
-result.}
31
-
32
-\item{number_barcode}{Number of barcode that as to be differentially
33
-expressed (DE)in order to consider the gene associated
34
-DE. Example a gene is associated
35
-with 10 shRNA we consider a gene DE if it has at least
36
-number_barcode = 5 shRNA DE.}
37
-
38
-\item{direction}{Direction of variation}
39
-
40
-\item{p_val}{The value that as to be used as p-value cut off}
41
-}
42
-\value{
43
-The hits found by ROAST method
44
-}
45
-\description{
46
-Find the hit using the roast method. Roast is a competitive gene
47
-             set test which uses rotation instead of permutation. Here is
48
-             applied in a contest of a genetic screening so it perform a
49
-             barcode competitive test testing for barcode which are
50
-             differentially expressed within a gene. More information can be
51
-             found in
52
-          \href{https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2922896/}{Roast}
53
-}
54
-\examples{
55
-set.seed(42)
56
-object <- get0("object", envir = asNamespace("ScreenR"))
57
-matrix_model <- model.matrix(~ slot(object, "groups"))
58
-colnames(matrix_model) <- c("Control", "T1_T2", "Treated")
59
-
60
-result <- find_roast_hit(object,
61
-    matrix_model = matrix_model,
62
-    contrast = "Treated", nrot = 100
63
-)
64
-head(result)
65
-}
66
-\concept{find}
67 0
deleted file mode 100644
... ...
@@ -1,38 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/find_robust_zscore_hit.R
3
-\name{find_robust_zscore_hit}
4
-\alias{find_robust_zscore_hit}
5
-\title{Title Find robust Z-score Hit}
6
-\usage{
7
-find_robust_zscore_hit(table_treate_vs_control, number_barcode)
8
-}
9
-\arguments{
10
-\item{table_treate_vs_control}{A table computed with the function
11
-\code{compute_data_table}.
12
-It contain for each barcode the associated
13
-Gene the counts in the treated and control
14
-and the value for the Log2FC, Zscore,
15
-ZscoreRobust in each day.}
16
-
17
-\item{number_barcode}{Number of barcode that as to be differentially
18
-expressed (DE)in order to consider the gene associated
19
-DE. Example a gene is associated
20
-with 10 shRNA we consider a gene DE if it has at least
21
-number_barcode = 5 shRNA DE.}
22
-}
23
-\value{
24
-Return a tibble containing the hit for the robust Z-score
25
-}
26
-\description{
27
-Title Find robust Z-score Hit
28
-}
29
-\examples{
30
-object <- get0("object", envir = asNamespace("ScreenR"))
31
-table <- compute_metrics(object,
32
-    control = "TRT", treatment = "Time3",
33
-    day = "Time3"
34
-)
35
-result <- find_robust_zscore_hit(table, number_barcode = 6)
36
-head(result)
37
-}
38
-\concept{find}
39 0
deleted file mode 100644
... ...
@@ -1,43 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/find_zscore_hit.R
3
-\name{find_zscore_hit}
4
-\alias{find_zscore_hit}
5
-\title{Title Find Z-score Hit}
6
-\usage{
7
-find_zscore_hit(table_treate_vs_control, number_barcode = 6, metric = "median")
8
-}
9
-\arguments{
10
-\item{table_treate_vs_control}{table computed with the function
11
-\code{compute_data_table}}
12
-
13
-\item{number_barcode}{Number of barcode that as to be differentially
14
-expressed (DE)in order to consider the gene associated
15
-DE. Example a gene is associated
16
-with 10 shRNA we consider a gene DE if it has at least
17
-number_barcode = 5 shRNA DE.}
18
-
19
-\item{metric}{A string containing the metric to use. The value allowed are
20
-"median" or "mean".}
21
-}
22
-\value{
23
-Return a tibble containing the hit for the Z-score
24
-}
25
-\description{
26
-Title Find Z-score Hit
27
-}
28
-\examples{
29
-object <- get0("object", envir = asNamespace("ScreenR"))
30
-table <- compute_metrics(object,
31
-    control = "TRT", treatment = "Time3",
32
-    day = "Time3"
33
-)
34
-
35
-# For the the median
36
-result <- find_zscore_hit(table, number_barcode = 6)
37
-head(result)
38
-
39
-# For the mean
40
-result <- find_zscore_hit(table, number_barcode = 6, metric = "mean")
41
-head(result)
42
-}
43
-\concept{find}
44 0
deleted file mode 100644
... ...
@@ -1,28 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/generics.R, R/screenr-class.R
3
-\name{get_annotation_table}
4
-\alias{get_annotation_table}
5
-\alias{get_annotation_table,screenr_object-method}
6
-\alias{get_annotation_table,screenr_object}
7
-\title{Get ScreenR annotation table}
8
-\usage{
9
-get_annotation_table(object)
10
-
11
-\S4method{get_annotation_table}{screenr_object}(object)
12
-}
13
-\arguments{
14
-\item{object}{The ScreenR object obtained using the
15
-\code{\link{create_screenr_object}}}
16
-}
17
-\value{
18
-The annotation table of the ScreenR object
19
-}
20
-\description{
21
-Get function for the annotation table of the ScreenR object
22
-}
23
-\examples{
24
-object <- get0("object", envir = asNamespace("ScreenR"))
25
-annotation_table <- get_annotation_table(object)
26
-head(annotation_table)
27
-}
28
-\concept{objects}
29 0
deleted file mode 100644
... ...
@@ -1,64 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/generics.R, R/screenr-class.R
3
-\docType{class}
4
-\name{get_count_table}
5
-\alias{get_count_table}
6
-\alias{screenr_object-class}
7
-\alias{screenr_object}
8
-\alias{get_count_table,screenr_object-method}
9
-\alias{get_count_table,screenr_object}
10
-\title{Get ScreenR count table}
11
-\usage{
12
-get_count_table(object)
13
-
14
-\S4method{get_count_table}{screenr_object}(object)
15
-}
16
-\arguments{
17
-\item{object}{The ScreenR object obtained using the
18
-\code{\link{create_screenr_object}}}
19
-}
20
-\value{
21
-The count table of the ScreenR object
22
-}
23
-\description{
24
-Get function for the count table of the ScreenR object
25
-}
26
-\section{Slots}{
27
-
28
-\describe{
29
-\item{\code{count_table}}{It is used to store the count table to perform the
30
-analysis}
31
-
32
-\item{\code{annotation_table}}{It is used to store the annotation of the shRNA}
33
-
34
-\item{\code{groups}}{It is used to store the vector of treated and untreated}
35
-
36
-\item{\code{replicates}}{It is used to store information about the replicates}
37
-
38
-\item{\code{normalized_count_table}}{It is used to store a normalized version of
39
-the count table}
40
-
41
-\item{\code{data_table}}{It is used to store a tidy format of the count table}
42
-}}
43
-
44
-\examples{
45
-object <- get0("object", envir = asNamespace("ScreenR"))
46
-count_table <- get_count_table(object)
47
-head(count_table)
48
-data("count_table", package = "ScreenR")
49
-data("annotation_table", package = "ScreenR")
50
-
51
-groups <- factor(c(
52
-    "T1/T2", "T1/T2", "Treated", "Treated", "Treated",
53
-    "Control", "Control", "Control", "Treated", "Treated",
54
-    "Treated", "Control", "Control", "Control"
55
-))
56
-
57
-obj <- create_screenr_object(
58
-    table = count_table,
59
-    annotation = annotation_table,
60
-    groups = groups,
61
-    replicates = c("")
62
-)
63
-}
64
-\concept{objects}
65 0
deleted file mode 100644
... ...
@@ -1,28 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/generics.R, R/screenr-class.R
3
-\name{get_data_table}
4
-\alias{get_data_table}
5
-\alias{get_data_table,screenr_object-method}
6
-\alias{get_data_table,screenr_object}
7
-\title{Get ScreenR data_table}
8
-\usage{
9
-get_data_table(object)
10
-
11
-\S4method{get_data_table}{screenr_object}(object)
12
-}
13
-\arguments{
14
-\item{object}{The ScreenR object obtained using the
15
-\code{\link{create_screenr_object}}}
16
-}
17
-\value{
18
-The data_table of the ScreenR object
19
-}
20
-\description{
21
-Get function for the data_table of the ScreenR object
22
-}
23
-\examples{
24
-object <- get0("object", envir = asNamespace("ScreenR"))
25
-data_table <- get_data_table(object)
26
-data_table
27
-}
28
-\concept{objects}
29 0
deleted file mode 100644
... ...
@@ -1,28 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/generics.R, R/screenr-class.R
3
-\name{get_groups}
4
-\alias{get_groups}
5
-\alias{get_groups,screenr_object-method}
6
-\alias{get_groups,screenr_object}
7
-\title{Get ScreenR groups}
8
-\usage{
9
-get_groups(object)
10
-
11
-\S4method{get_groups}{screenr_object}(object)
12
-}
13
-\arguments{
14
-\item{object}{The ScreenR object obtained using the
15
-\code{\link{create_screenr_object}}}
16
-}
17
-\value{
18
-The groups of the ScreenR object
19
-}
20
-\description{
21
-Get function for the groups of the ScreenR object
22
-}
23
-\examples{
24
-object <- get0("object", envir = asNamespace("ScreenR"))
25
-groups <- get_groups(object)
26
-groups
27
-}
28
-\concept{objects}
29 0
deleted file mode 100644
... ...
@@ -1,29 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/generics.R, R/screenr-class.R
3
-\name{get_normalized_count_table}
4
-\alias{get_normalized_count_table}
5
-\alias{get_normalized_count_table,screenr_object-method}
6
-\alias{get_normalized_count_table,screenr_object}
7
-\title{Get ScreenR normalized_count_table}
8
-\usage{
9
-get_normalized_count_table(object)
10
-
11
-\S4method{get_normalized_count_table}{screenr_object}(object)
12
-}
13
-\arguments{
14
-\item{object}{The ScreenR object obtained using the
15
-\code{\link{create_screenr_object}}}
16
-}
17
-\value{
18
-The normalized_count_table of the ScreenR object
19
-}
20
-\description{
21
-Get function for the normalized_count_table of
22
-             the ScreenR object
23
-}
24
-\examples{
25
-object <- get0("object", envir = asNamespace("ScreenR"))
26
-normalized_count_table <- get_normalized_count_table(object)
27
-normalized_count_table
28
-}
29
-\concept{objects}
30 0
deleted file mode 100644
... ...
@@ -1,28 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/generics.R, R/screenr-class.R
3
-\name{get_replicates}
4
-\alias{get_replicates}
5
-\alias{get_replicates,screenr_object-method}
6
-\alias{get_replicates,screenr_object}
7
-\title{Get ScreenR replicates}
8
-\usage{
9
-get_replicates(object)
10
-
11
-\S4method{get_replicates}{screenr_object}(object)
12
-}
13
-\arguments{
14
-\item{object}{The ScreenR object obtained using the
15
-\code{\link{create_screenr_object}}}
16
-}
17
-\value{
18
-The replicates of the ScreenR object
19
-}
20
-\description{
21
-Get function for the replicates of the ScreenR object
22
-}
23
-\examples{
24
-object <- get0("object", envir = asNamespace("ScreenR"))
25
-replicates <- get_replicates(object)
26
-replicates
27
-}
28
-\concept{objects}
29 0
deleted file mode 100644
... ...
@@ -1,24 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/mapped_reads.R
3
-\name{mapped_reads}
4
-\alias{mapped_reads}
5
-\title{Mapped Reads}
6
-\usage{
7
-mapped_reads(screenR_Object)
8
-}
9
-\arguments{
10
-\item{screenR_Object}{The ScreenR object obtained using the
11
-\code{\link{create_screenr_object}}}
12
-}
13
-\value{
14
-Return a tibble containing the number of mapped read for sample
15
-}
16
-\description{
17
-This function returns the number of mapped reads inside the
18
-             ScreenR object
19
-}
20
-\examples{
21
-object <- get0("object", envir = asNamespace("ScreenR"))
22
-mapped_reads(object)
23
-}
24
-\concept{compute}
25 0
deleted file mode 100644
... ...
@@ -1,29 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/normalize_data.R
3
-\name{normalize_data}
4
-\alias{normalize_data}
5
-\title{Normalize data}
6
-\usage{
7
-normalize_data(screenR_Object)
8
-}
9
-\arguments{
10
-\item{screenR_Object}{The ScreenR object obtained using the
11
-\code{\link{create_screenr_object}}}
12
-}
13
-\value{
14
-Return the ScreenR object with the normalize data
15
-}
16
-\description{
17
-This function perform a normalization on the data considering
18
-             the fact that each shRNA has a defined length so this will not
19
-             influence the data. Basically is computed the sum for
20
-             each row and then multiply by 1e6. At the end the data obtained
21
-             will be Count Per Million.
22
-}
23
-\examples{
24
-object <- get0("object", envir = asNamespace("ScreenR"))
25
-object <- normalize_data(object)
26
-
27
-slot(object, "normalized_count_table")
28
-}
29
-\concept{compute}
30 0
deleted file mode 100644
... ...
@@ -1,42 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/plot_mds.R
3
-\name{plot_mds}
4
-\alias{plot_mds}
5
-\title{Multidimensional Scaling Plot}
6
-\usage{
7
-plot_mds(
8
-  screenR_Object,
9
-  groups = NULL,
10
-  alpha = 0.8,
11
-  size = 2.5,
12
-  color = "black"
13
-)
14
-}
15
-\arguments{
16
-\item{screenR_Object}{The Object of the package
17
-\code{\link{create_screenr_object}}}
18
-
19
-\item{groups}{The vector that has to be used to fill the plot if NULL the
20
-function will use the default groups slot in the object passed
21
-as input.}
22
-
23
-\item{alpha}{The opacity of the labels.
24
-Possible value are in a range from 0 to 1.}
25
-
26
-\item{size}{The dimension of the labels. The default value is 2.5}
27
-
28
-\item{color}{The color of the labels. The default value is black}
29
-}
30
-\value{
31
-The MDS Plot
32
-}
33
-\description{
34
-Plot samples on a two-dimensional scatterplot so that
35
-             distances on the plot approximate the typical log2 fold
36
-             changes between the samples.
37
-}
38
-\examples{
39
-object <- get0("object", envir = asNamespace("ScreenR"))
40
-
41
-plot_mds(object)
42
-}
43 0
deleted file mode 100644
... ...
@@ -1,39 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/plot_zscore_distribution.R
3
-\name{plot_zscore_distribution}
4
-\alias{plot_zscore_distribution}
5
-\title{Plot distribution Z-score}
6
-\usage{
7
-plot_zscore_distribution(time_point_measure, alpha = 1)
8
-}
9
-\arguments{
10
-\item{time_point_measure}{A list containing the table for each time
11
-point. Each table contains for each barcode
12
-the counts for the treated and control the Log2FC,
13
-Zscore, ZscoreRobust, Day.}
14
-
15
-\item{alpha}{A value for the opacity of the plot.
16
-Allowed values are in the range 0 to 1}
17
-}
18
-\value{
19
-return the density plot of the distribution of the Z-score
20
-}
21
-\description{
22
-This function plots the Log2FC Z-score distribution of the
23
-             treated vs control in the different time points.
24
-}
25
-\examples{
26
-object <- get0("object", envir = asNamespace("ScreenR"))
27
-
28
-table1 <- compute_metrics(object,
29
-    control = "TRT", treatment = "Time3",
30
-    day = "Time3"
31
-)
32
-
33
-table2 <- compute_metrics(object,
34
-    control = "TRT", treatment = "Time4",
35
-    day = "Time4"
36
-)
37
-
38
-plot_zscore_distribution(list(table1, table2), alpha = 0.5)
39
-}
40 0
deleted file mode 100644
... ...
@@ -1,61 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/plot_barcode_hit.R
3
-\name{plot_barcode_hit}
4
-\alias{plot_barcode_hit}
5
-\title{Plot barcode hit}
6
-\usage{
7
-plot_barcode_hit(
8
-  screenR_Object,
9
-  matrix_model,
10
-  contrast,
11
-  number_barcode = 3,
12
-  gene,
13
-  quantile = c(-0.5, 0.5),
14
-  labels = c("Negative logFC", "Positive logFC")
15
-)
16
-}
17
-\arguments{
18
-\item{screenR_Object}{The ScreenR object obtained using the
19
-\code{\link{create_screenr_object}}}
20
-
21
-\item{matrix_model}{The matrix that will be used to perform the
22
-linear model analysis. It is created using
23
-model.matrix.}
24
-
25
-\item{contrast}{An object created with \code{\link[limma]{makeContrasts}}
26
-function.}
27
-
28
-\item{number_barcode}{Number of barcode that as to be differentially
29
-expressed (DE) in order to consider the associated gene
30
-DE. Example a gene is associated with 10 shRNA we
31
-consider a gene DE if it has at least
32
-number_barcode = 5 shRNA DE.}
33
-
34
-\item{gene}{The name of the gene that has to be plot}
35
-
36
-\item{quantile}{Quantile to display on the plot}
37
-
38
-\item{labels}{The label to be displayed on the quantile side}
39
-}
40
-\value{
41
-The barcode plot
42
-}
43
-\description{
44
-Create a barcode plot for a hit.
45
-             A barcode plot displays if the hit is differentially up or
46
-             down regulated. If most of the vertical line are on the left
47
-             side the gene associated to the barcodes is down regulated
48
-             otherwise is up regulated.
49
-}
50
-\examples{
51
-object <- get0("object", envir = asNamespace("ScreenR"))
52
-matrix_model <- model.matrix(~ slot(object, "groups"))
53
-colnames(matrix_model) <- c("Control", "T1_T2", "Treated")
54
-contrast <- limma::makeContrasts(Treated - Control, levels = matrix_model)
55
-
56
-plot_barcode_hit(object, matrix_model,
57
-    contrast = contrast,
58
-    gene = "Gene_300"
59
-)
60
-}
61
-\concept{plot}
62 0
deleted file mode 100644
... ...
@@ -1,41 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/barcode_lost.R
3
-\name{plot_barcode_lost}
4
-\alias{plot_barcode_lost}
5
-\title{Plot number of barcode lost}
6
-\usage{
7
-plot_barcode_lost(
8
-  screenR_Object,
9
-  palette = NULL,
10
-  alpha = 1,
11
-  legende_position = "none"
12
-)
13
-}
14
-\arguments{
15
-\item{screenR_Object}{The ScreenR object obtained using the
16
-\code{\link{create_screenr_object}}}
17
-
18
-\item{palette}{A vector of colors to be used to fill the barplot.}
19
-
20
-\item{alpha}{A value for the opacity of the plot.
21
-Allowed values are in the range 0 to 1}
22
-
23
-\item{legende_position}{Where to positioning the legend of the plot.
24
-Allowed values are in the "top", "bottom", "right",
25
-"left", "none".}
26
-}
27
-\value{
28
-Returns the plot displaying the number of barcode lost in each
29
-        sample
30
-}
31
-\description{
32
-This function plots the number of barcode lost in each sample.
33
-             Usually lots of barcodes lost mean that the sample has low
34
-             quality.
35
-}
36
-\examples{
37
-object <- get0("object", envir = asNamespace("ScreenR"))
38
-
39
-plot_barcode_lost(object)
40
-}
41
-\concept{plot}
42 0
deleted file mode 100644
... ...
@@ -1,42 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/barcode_lost.R
3
-\name{plot_barcode_lost_for_gene}
4
-\alias{plot_barcode_lost_for_gene}
5
-\title{Plot number of barcode lost for  gene}
6
-\usage{
7
-plot_barcode_lost_for_gene(screenR_Object, facet = TRUE, samples)
8
-}
9
-\arguments{
10
-\item{screenR_Object}{The ScreenR object obtained using the
11
-\code{\link{create_screenr_object}}}
12
-
13
-\item{facet}{A boolean to use the facet.}
14
-
15
-\item{samples}{A vector of samples that as to be visualize}
16
-}
17
-\value{
18
-Return the plot displaying the number of barcode lost for each gene
19
-        in each sample.
20
-}
21
-\description{
22
-This function plots the number of barcodes lost in each sample
23
-             for each gene. Usually in a genetic screening each gene is
24
-             is associated with multiple shRNAs and so barcodes. For this
25
-             reason a reasonable number of barcodes associated with the
26
-             gene has to be retrieved in order to have a robust result.
27
-             Visualizing the number of genes that have lost lot's of barcode
28
-             is a Quality Check procedure in order to be aware of the number
29
-             of barcode for the hit identified.
30
-}
31
-\examples{
32
-object <- get0("object", envir = asNamespace("ScreenR"))
33
-
34
-plot_barcode_lost_for_gene(object,
35
-    samples = c("Time3_A", "Time3_B")
36
-)
37
-plot_barcode_lost_for_gene(object,
38
-    samples = c("Time3_A", "Time3_B"),
39
-    facet = FALSE
40
-)
41
-}
42
-\concept{plot}
43 0
deleted file mode 100644
... ...
@@ -1,56 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/plot_barcode_trend.R
3
-\name{plot_barcode_trend}
4
-\alias{plot_barcode_trend}
5
-\title{Plot the trend over time of the barcodes}
6
-\usage{
7
-plot_barcode_trend(
8
-  list_data_measure,
9
-  genes,
10
-  n_col = 1,
11
-  size_line = 1,
12
-  color = NULL
13
-)
14
-}
15
-\arguments{
16
-\item{list_data_measure}{A list containing the measure table of the
17
-different time point. Generated using the
18
-compute_metrics function.}
19
-
20
-\item{genes}{The vector of genes name.}
21
-
22
-\item{n_col}{The number of column to use in the facet wrap.}
23
-
24
-\item{size_line}{The thickness of the line.}
25
-
26
-\item{color}{The vector of colors. One color for each barcode.}
27
-}
28
-\value{
29
-The trend plot for the genes in input.
30
-}
31
-\description{
32
-Plot the log2FC over time of the barcodes in the different
33
-             time point. This plot is useful to check we efficacy of each
34
-             shRNA. Good shRNAs should have consistent trend trend over time.
35
-}
36
-\examples{
37
-object <- get0("object", envir = asNamespace("ScreenR"))
38
-
39
-metrics <- dplyr::bind_rows(
40
-    compute_metrics(object,
41
-        control = "TRT", treatment = "Time3",
42
-        day = "Time3"
43
-    ),
44
-    compute_metrics(object,
45
-        control = "TRT", treatment = "Time4",
46
-        day = "Time4"
47
-    )
48
-)
49
-# Multiple Genes
50
-plot_barcode_trend(metrics,
51
-    genes = c("Gene_1", "Gene_50"),
52
-    n_col = 2
53
-)
54
-# Single Gene
55
-plot_barcode_trend(metrics, genes = "Gene_300")
56
-}
57 0
deleted file mode 100644
... ...
@@ -1,60 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/plot_boxplot.R
3
-\name{plot_boxplot}
4
-\alias{plot_boxplot}
5
-\title{Plot Barcodes Hit}
6
-\usage{
7
-plot_boxplot(
8
-  screenR_Object,
9
-  genes,
10
-  group_var,
11
-  alpha = 0.5,
12
-  nrow = 1,