Emanuel Soda authored on 13/05/2022 19:39:15
Showing50 changed files

... ...
@@ -58,6 +58,7 @@ Collate:
58 58
     'compute_metrics.R'
59 59
     'count_mapped_reads.R'
60 60
     'count_table.R'
61
+    'create_object.R'
61 62
     'distribution_mapped_reads.R'
62 63
     'filter_by.R'
63 64
     'find_common_hit.R'
... ...
@@ -76,4 +77,3 @@ Collate:
76 77
     'plot_zscore_distribution.R'
77 78
     'screenr-class.R'
78 79
     'zzz.R'
79
-    'create_object.R'
80 80
new file mode 100644
... ...
@@ -0,0 +1,36 @@
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}
0 37
new file mode 100644
... ...
@@ -0,0 +1,35 @@
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}
0 36
new file mode 100644
... ...
@@ -0,0 +1,30 @@
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}
0 31
new file mode 100644
... ...
@@ -0,0 +1,48 @@
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}
0 49
new file mode 100644
... ...
@@ -0,0 +1,27 @@
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}
0 28
new file mode 100644
... ...
@@ -0,0 +1,25 @@
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}
0 26
new file mode 100644
... ...
@@ -0,0 +1,48 @@
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}
0 49
new file mode 100644
... ...
@@ -0,0 +1,34 @@
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}
0 35
new file mode 100644
... ...
@@ -0,0 +1,23 @@
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}
0 24
new file mode 100644
... ...
@@ -0,0 +1,27 @@
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}
0 28
new file mode 100644
... ...
@@ -0,0 +1,64 @@
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}
0 65
new file mode 100644
... ...
@@ -0,0 +1,27 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/create_object.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}
0 28
new file mode 100644
... ...
@@ -0,0 +1,57 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/create_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}
0 58
new file mode 100644
... ...
@@ -0,0 +1,53 @@
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}
0 54
new file mode 100644
... ...
@@ -0,0 +1,52 @@
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}
0 53
new file mode 100644
... ...
@@ -0,0 +1,67 @@
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}
0 68
new file mode 100644
... ...
@@ -0,0 +1,41 @@
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}
0 42
new file mode 100644
... ...
@@ -0,0 +1,66 @@
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}
0 67
new file mode 100644
... ...
@@ -0,0 +1,38 @@
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}
0 39
new file mode 100644
... ...
@@ -0,0 +1,43 @@
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}
0 44
new file mode 100644
... ...
@@ -0,0 +1,28 @@
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}
0 29
new file mode 100644
... ...
@@ -0,0 +1,64 @@
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}
0 65
new file mode 100644
... ...
@@ -0,0 +1,28 @@
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}
0 29
new file mode 100644
... ...
@@ -0,0 +1,28 @@
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}
0 29
new file mode 100644
... ...
@@ -0,0 +1,29 @@
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}
0 30
new file mode 100644
... ...
@@ -0,0 +1,28 @@
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}
0 29
new file mode 100644
... ...
@@ -0,0 +1,24 @@
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}
0 25
new file mode 100644
... ...
@@ -0,0 +1,29 @@
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}
0 30
new file mode 100644
... ...
@@ -0,0 +1,61 @@
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}
0 62
new file mode 100644
... ...
@@ -0,0 +1,41 @@
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}
0 42
new file mode 100644
... ...
@@ -0,0 +1,42 @@
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}
0 43
new file mode 100644
... ...
@@ -0,0 +1,56 @@
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
+}
0 57
new file mode 100644
... ...
@@ -0,0 +1,60 @@
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,
13
+  ncol = 1,
14
+  fill_var = "Sample",
15
+  type = "boxplot",
16
+  scales = "free"
17
+)
18
+}
19
+\arguments{
20
+\item{screenR_Object}{The ScreenR object obtained using the
21
+\code{\link{create_screenr_object}}}
22
+
23
+\item{genes}{The vector of genes that will be displayed}
24
+
25
+\item{group_var}{The variable that as to be used to filter the data, for
26
+example the different treatment}
27
+
28
+\item{alpha}{A value for the opacity of the plot.
29
+Allowed values are in the range 0 to 1}
30
+
31
+\item{nrow}{The number of rows in case multiple genes are plotted}
32
+
33
+\item{ncol}{The number of columns in case multiple genes are plotted}
34
+
35
+\item{fill_var}{The variable used to fill the boxplot}
36
+
37
+\item{type}{The type of plot to use "boxplot" or "violinplot"}
38
+
39
+\item{scales}{The scales used for the facet.
40
+Possible values can be "free", "fixed" and "free_y"}
41
+}
42
+\value{
43
+A boxplot
44
+}
45
+\description{
46
+This function plots a boxplot for each sample for the genes
47
+             passed as input. It can be used to see the overall trend of a
48
+             gene and so to visualize if the gene is up or down regulated.
49
+}
50
+\examples{
51
+object <- get0("object", envir = asNamespace("ScreenR"))
52
+
53
+plot_boxplot(object,
54
+    genes = c("Gene_34"),
55
+    group_var = c("T1", "T2", "TRT"), nrow = 1, ncol = 2,
56
+    fill_var = "Day", type = "violinplot"
57
+)
58
+
59
+}
60
+\concept{plot}
0 61
new file mode 100644
... ...
@@ -0,0 +1,61 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/find_common_hit.R
3
+\name{plot_common_hit}
4
+\alias{plot_common_hit}
5
+\title{Plot common hit}
6
+\usage{
7
+plot_common_hit(
8
+  hit_zscore,
9
+  hit_camera,
10
+  hit_roast,
11
+  alpha = 0.5,
12
+  stroke_size = 0.5,
13
+  set_name_size = 4,
14
+  text_color = "black",
15
+  text_size = 4,
16
+  show_percentage = TRUE,
17
+  title = "",
18
+  color = c("#1B9E77", "#D95F02", "#7570B3"),
19
+  show_elements = TRUE
20
+)
21
+}
22
+\arguments{
23
+\item{hit_zscore}{The list of hits of the \code{\link{find_zscore_hit}}}
24
+
25
+\item{hit_camera}{The list of hits of the \code{\link{find_camera_hit}}}
26
+
27
+\item{hit_roast}{The list of hits of the \code{\link{find_roast_hit}}}
28
+
29
+\item{alpha}{A value for the opacity of the plot.
30
+Allowed values are in the range 0 to 1}
31
+
32
+\item{stroke_size}{Stroke size for drawing circles}
33
+
34
+\item{set_name_size}{Text size for set names}
35
+
36
+\item{text_color}{Text color for intersect contents}
37
+
38
+\item{text_size}{Text size for intersect contents}
39
+
40
+\item{show_percentage}{Show percentage for each set}
41
+
42
+\item{title}{The title to display above the plot}
43
+
44
+\item{color}{The three vector color for the venn}
45
+
46
+\item{show_elements}{Show set elements instead of count/percentage.}
47
+}
48
+\value{
49
+A vector containing the common hit
50
+}
51
+\description{
52
+This method plot the hits in common among the three methods is
53
+             a wrapper for the \code{\link[ggvenn]{ggvenn}} function.
54
+}
55
+\examples{
56
+hit_zscore <- data.frame(Gene = c("A", "B", "C", "D", "E"))
57
+hit_camera <- data.frame(Gene = c("A", "B", "C", "F", "H", "G"))
58
+hit_roast <- data.frame(Gene = c("A", "L", "N"))
59
+plot_common_hit(hit_zscore, hit_camera, hit_roast)
60
+
61
+}
0 62
new file mode 100644
... ...
@@ -0,0 +1,36 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/plot_mds.R
3
+\name{plot_explained_variance}
4
+\alias{plot_explained_variance}
5
+\title{Plot the explained variance by the PC}
6
+\usage{
7
+plot_explained_variance(
8
+  screenR_Object,
9
+  cumulative = FALSE,
10
+  color = "steelblue"
11
+)
12
+}
13
+\arguments{
14
+\item{screenR_Object}{The ScreenR object obtained using the
15
+\code{\link{create_screenr_object}}}
16
+
17
+\item{cumulative}{A boolean value which indicates whether or not to plot
18
+the cumulative variance. The default value is FALSE.}
19
+
20
+\item{color}{The color to fill the barplot the default value is steelblue}
21
+}
22
+\value{
23
+The explained variance plot
24
+}
25
+\description{
26
+This function plot the explained variance by the
27
+             Principal Component analysis.
28
+}
29
+\examples{
30
+object <- get0("object", envir = asNamespace("ScreenR"))
31
+
32
+plot_explained_variance(object)
33
+
34
+# For the cumulative plot
35
+plot_explained_variance(object, cumulative = TRUE)
36
+}
0 37
new file mode 100644
... ...
@@ -0,0 +1,38 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/plot_mapped_reads.R
3
+\name{plot_mapped_reads}
4
+\alias{plot_mapped_reads}
5
+\title{Plot mapped reads}
6
+\usage{
7
+plot_mapped_reads(
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 color that as 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
+("none", "left", "right", "bottom", "top")}
25
+}
26
+\value{
27
+return a ggplot object
28
+}
29
+\description{
30
+This function plots the number of reads mapped for each
31
+             sample. It internally call the \code{\link{count_mapped_reads}}
32
+             function, to compute the number of mapped reads.
33
+}
34
+\examples{
35
+object <- get0("object", envir = asNamespace("ScreenR"))
36
+
37
+plot_mapped_reads(object)
38
+}
0 39
new file mode 100644
... ...
@@ -0,0 +1,48 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/distribution_mapped_reads.R
3
+\name{plot_mapped_reads_distribution}
4
+\alias{plot_mapped_reads_distribution}
5
+\title{Plot the distribution of the mapped reads}
6
+\usage{
7
+plot_mapped_reads_distribution(
8
+  screenR_Object,
9
+  palette = NULL,
10
+  alpha = 1,
11
+  type = "boxplot"
12
+)
13
+}
14
+\arguments{
15
+\item{screenR_Object}{The ScreenR object obtained using the
16
+\code{\link{create_screenr_object}}.}
17
+
18
+\item{palette}{The color vector that as to be used for the plot.}
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{type}{The type of plot. The default is "boxplot" the other option is
24
+"density."}
25
+}
26
+\value{
27
+Return a tibble containing the number of mapped read for each sample
28
+}
29
+\description{
30
+This function creates a boxplot or a densityplot to show the
31
+             distribution of the mapped reads in different samples. This
32
+             function can be used to assess the quality of the samples.
33
+             Samples which show roughly the same distribution have
34
+             good quality.
35
+}
36
+\examples{
37
+object <- get0("object", envir = asNamespace("ScreenR"))
38
+
39
+# Boxplot
40
+plot_mapped_reads_distribution(object)
41
+
42
+# Density
43
+plot_mapped_reads_distribution(object, type = "density")
44
+
45
+plot_mapped_reads_distribution(object, type = "density", alpha = 0.2)
46
+
47
+}
48
+\concept{plot}
0 49
new file mode 100644
... ...
@@ -0,0 +1,42 @@
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
+}
0 43
new file mode 100644
... ...
@@ -0,0 +1,60 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/plot_trend.R
3
+\name{plot_trend}
4
+\alias{plot_trend}
5
+\title{Plot the trend hit gene}
6
+\usage{
7
+plot_trend(
8
+  screenR_Object,
9
+  genes,
10
+  group_var,
11
+  alpha = 0.5,
12
+  se = FALSE,
13
+  point_size = 1,
14
+  line_size = 1,
15
+  nrow = 1,
16
+  ncol = 1,
17
+  scales = "free"
18
+)
19
+}
20
+\arguments{
21
+\item{screenR_Object}{The ScreenR object obtained using the
22
+\code{\link{create_screenr_object}}}
23
+
24
+\item{genes}{The vector of genes to use}
25
+
26
+\item{group_var}{The variable that as to be used to filter the data, for
27
+example the different treatment}
28
+
29
+\item{alpha}{A value for the opacity of the plot.
30
+Allowed values are in the range 0 to 1}
31
+
32
+\item{se}{A boolean to indicate where or not to plot the standard error}
33
+
34
+\item{point_size}{The dimension of each dot}
35
+
36
+\item{line_size}{The dimension of the line}
37
+
38
+\item{nrow}{The number of rows in case multiple genes are plotted}
39
+
40
+\item{ncol}{The number of columns in case multiple genes are plotted}
41
+
42
+\item{scales}{The scales to be used in the facette}
43
+}
44
+\value{
45
+The plot of the trend over time for a specific treatment.
46
+}
47
+\description{
48
+This function plot the trend of a gene resulted as hit
49
+}
50
+\examples{
51
+object <- get0("object", envir = asNamespace("ScreenR"))
52
+
53
+plot_trend(object, genes = "Gene_42", group_var = c("T1", "T2", "TRT"))
54
+
55
+plot_trend(object,
56
+    genes = c("Gene_42", "Gene_100"),
57
+    group_var = c("T1", "T2", "TRT"),
58
+    nrow = 2
59
+)
60
+}
0 61
new file mode 100644
... ...
@@ -0,0 +1,39 @@
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
+}
0 40
new file mode 100644
... ...
@@ -0,0 +1,32 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/filter_by.R
3
+\name{remove_all_zero_row}
4
+\alias{remove_all_zero_row}
5
+\title{Remove rows that have zero count in all samples}
6
+\usage{
7
+remove_all_zero_row(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 ScreenR object with the count_table and the annotation_table
15
+        filtered.
16
+}
17
+\description{
18
+This function removes the rows that have zero count in
19
+             all samples. It takes care of updating both count_table and
20
+             annotation_table.
21
+             Very_Important: It has to be performed before the
22
+                             data normalization.
23
+}
24
+\examples{
25
+object <- get0("object", envir = asNamespace("ScreenR"))
26
+counts <- get_count_table(object)
27
+nrow(counts)
28
+object <- remove_all_zero_row(object)
29
+counts <- get_count_table(object)
30
+nrow(counts)
31
+}
32
+\concept{compute}
0 33
new file mode 100644
... ...
@@ -0,0 +1,24 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/camera_method.R
3
+\name{select_number_barcode}
4
+\alias{select_number_barcode}
5
+\title{Select  number of Barcode}
6
+\usage{
7
+select_number_barcode(gene, gene_symbols, number_barcode)
8
+}
9
+\arguments{
10
+\item{gene}{The gene name}
11
+
12
+\item{...}{
13
+  Arguments passed on to \code{\link[=unique_gene_symbols]{unique_gene_symbols}}
14
+  \describe{
15
+    \item{\code{gene_symbols}}{The gene symbols list}
16
+  }}
17
+}
18
+\value{
19
+The barcode of the gene passed as input
20
+}
21
+\description{
22
+Compute a unique gene symbol for gene
23
+}
24
+\keyword{internal}
0 25
new file mode 100644
... ...
@@ -0,0 +1,30 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/generics.R, R/screenr-class.R
3
+\name{set_annotation_table}
4
+\alias{set_annotation_table}
5
+\alias{set_annotation_table,screenr_object-method}
6
+\alias{set_annotation_table,screenr_object}
7
+\title{Set ScreenR annotation table}
8
+\usage{
9
+set_annotation_table(object, annotation_table)
10
+
11
+\S4method{set_annotation_table}{screenr_object}(object, annotation_table)
12
+}
13
+\arguments{
14
+\item{object}{The ScreenR object obtained using the
15
+\code{\link{create_screenr_object}}}
16
+
17
+\item{annotation_table}{a table containing the annotation for each shRNA}
18
+}
19
+\value{
20
+The ScreenR object with the annotation table
21
+}
22
+\description{
23
+Set function for the annotation table of the ScreenR object
24
+}
25
+\examples{
26
+object <- get0("object", envir = asNamespace("ScreenR"))
27
+annotation <- get_annotation_table(object)
28
+set_annotation_table(object, annotation)
29
+}
30
+\concept{objects}
0 31
new file mode 100644
... ...
@@ -0,0 +1,31 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/generics.R, R/screenr-class.R
3
+\name{set_count_table}
4
+\alias{set_count_table}
5
+\alias{set_count_table,screenr_object-method}
6
+\alias{set_count_table,screenr_object}
7
+\title{Set ScreenR count table}
8
+\usage{
9
+set_count_table(object, count_table)
10
+
11
+\S4method{set_count_table}{screenr_object}(object, count_table)
12
+}
13
+\arguments{
14
+\item{object}{The ScreenR object obtained using the
15
+\code{\link{create_screenr_object}}}
16
+
17
+\item{count_table}{A count table containing in each row an shRNA and in each
18
+column a sample}
19
+}
20
+\value{
21
+The ScreenR object with the count table
22
+}
23
+\description{
24
+Set function for the count table of the ScreenR object
25
+}
26
+\examples{
27
+object <- get0("object", envir = asNamespace("ScreenR"))
28
+counts <- get_count_table(object)
29
+set_count_table(object, counts)
30
+}
31
+\concept{objects}
0 32
new file mode 100644
... ...
@@ -0,0 +1,30 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/generics.R, R/screenr-class.R
3
+\name{set_data_table}
4
+\alias{set_data_table}
5
+\alias{set_data_table,screenr_object-method}
6
+\alias{set_data_table,screenr_object}
7
+\title{Set ScreenR data_table}
8
+\usage{
9
+set_data_table(object, data_table)
10
+
11
+\S4method{set_data_table}{screenr_object}(object, data_table)
12
+}
13
+\arguments{
14
+\item{object}{The ScreenR object obtained using the
15
+\code{\link{create_screenr_object}}}
16
+
17
+\item{data_table}{A count table in a tidy format}
18
+}
19
+\value{
20
+The ScreenR object with the set data_table
21
+}
22
+\description{
23
+Set function for the data_table of the ScreenR object
24
+}
25
+\examples{
26
+object <- get0("object", envir = asNamespace("ScreenR"))
27
+data_table <- get_data_table(object)
28
+set_data_table(object, data_table)
29
+}
30
+\concept{objects}
0 31
new file mode 100644
... ...
@@ -0,0 +1,30 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/generics.R, R/screenr-class.R
3
+\name{set_groups}
4
+\alias{set_groups}
5
+\alias{set_groups,screenr_object-method}
6
+\alias{set_groups,screenr_object}
7
+\title{Set ScreenR groups}
8
+\usage{
9
+set_groups(object, groups)
10
+
11
+\S4method{set_groups}{screenr_object}(object, groups)
12
+}
13
+\arguments{
14
+\item{object}{The ScreenR object obtained using the
15
+\code{\link{create_screenr_object}}}
16
+
17
+\item{groups}{The treatment and control groups}
18
+}
19
+\value{
20
+The ScreenR object containing the group field
21
+}
22
+\description{
23
+Set function for the groups of the ScreenR object
24
+}
25
+\examples{
26
+object <- get0("object", envir = asNamespace("ScreenR"))
27
+groups <- get_groups(object)
28
+set_groups(object, groups)
29
+}
30
+\concept{objects}
0 31
new file mode 100644
... ...
@@ -0,0 +1,32 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/generics.R, R/screenr-class.R
3