Browse code

correct the spell of some word

Emanuel Soda authored on 11/05/2022 07:43:39
Showing1 changed files
... ...
@@ -135,6 +135,3 @@ test_that("find_robust_zscore_hit median ", {
135 135
     hit_zscore_R <- find_robust_zscore_hit(table, number_barcode = 2)
136 136
     expect_equal(class(hit_zscore_R)[[1]], "grouped_df")
137 137
 })
138
-
139
-
140
-
Browse code

codecov.yml cche git rompe23

Emanuel Soda authored on 11/05/2022 07:12:15
Showing1 changed files
... ...
@@ -135,3 +135,6 @@ test_that("find_robust_zscore_hit median ", {
135 135
     hit_zscore_R <- find_robust_zscore_hit(table, number_barcode = 2)
136 136
     expect_equal(class(hit_zscore_R)[[1]], "grouped_df")
137 137
 })
138
+
139
+
140
+
Browse code

Other issue

Emanuel Soda authored on 24/04/2022 17:14:38
Showing1 changed files
... ...
@@ -4,139 +4,134 @@ data <- count_table
4 4
 annotaion <- annotation_table
5 5
 
6 6
 groups <- factor(c(
7
-  "T1/T2", "T1/T2", "Treated", "Treated", "Treated",
8
-  "Control", "Control", "Control", "Treated", "Treated", "Treated",
9
-  "Control", "Control", "Control"
7
+    "T1/T2", "T1/T2", "Treated", "Treated", "Treated",
8
+    "Control", "Control", "Control", "Treated", "Treated", "Treated",
9
+    "Control", "Control", "Control"
10 10
 ))
11 11
 
12 12
 
13 13
 palette <- c(
14
-  "#1B9E75", "#1B9E75", "#D95F02", "#D95F02", "#D95F02",
15
-  "#7570B3", "#7570B3", "#7570B3", "#E7298A", "#E7298A", "#E7298A",
16
-  "#66A61E", "#66A61E", "#66A61E"
14
+    "#1B9E75", "#1B9E75", "#D95F02", "#D95F02", "#D95F02",
15
+    "#7570B3", "#7570B3", "#7570B3", "#E7298A", "#E7298A", "#E7298A",
16
+    "#66A61E", "#66A61E", "#66A61E"
17 17
 )
18 18
 
19 19
 create_test_object <- function() {
20
-  data <- data %>%
21
-    dplyr::filter(Barcode != "*")
22
-
23
-  colnames(data) <- c(
24
-    "Barcode", "T1", "T2", "Time3_TRT_A", "Time3_TRT_B", "Time3_TRT_C",
25
-    "Time3_A", "Time3_B", "Time3_C", "Time4_TRT_A", "Time4_TRT_B",
26
-    "Time4_TRT_C", "Time4_A", "Time4_B", "Time4_c"
27
-  )
28
-  obj <- create_screenr_object(
29
-    table = data,
30
-    annotation = annotaion, groups = groups, replicates = c("")
31
-  )
32
-  obj <- normalize_data(obj)
33
-  obj <- compute_data_table(obj)
34
-
35
-  obj@data_table <- obj@data_table  %>%
36
-    dplyr::filter(Gene %in% paste0("Gene_", seq(1, 10)))
37
-
38
-  obj@normalized_count_table <- obj@normalized_count_table   %>%
39
-    dplyr::filter(Barcode %in% obj@data_table$Barcode)
40
-
41
-  obj@count_table <- obj@count_table   %>%
42
-    dplyr::filter(Barcode %in% obj@data_table$Barcode)
43
-
44
-  obj@annotation_table <- obj@annotation_table   %>%
45
-    dplyr::filter(Barcode %in% obj@data_table$Barcode)
46
-
47
-  return(obj)
20
+    data <- data %>%
21
+        dplyr::filter(Barcode != "*")
22
+
23
+    colnames(data) <- c(
24
+        "Barcode", "T1", "T2", "Time3_TRT_A", "Time3_TRT_B", "Time3_TRT_C",
25
+        "Time3_A", "Time3_B", "Time3_C", "Time4_TRT_A", "Time4_TRT_B",
26
+        "Time4_TRT_C", "Time4_A", "Time4_B", "Time4_c"
27
+    )
28
+    obj <- create_screenr_object(
29
+        table = data,
30
+        annotation = annotaion, groups = groups, replicates = c("")
31
+    )
32
+    obj <- normalize_data(obj)
33
+    obj <- compute_data_table(obj)
34
+
35
+    obj@data_table <- obj@data_table %>%
36
+        dplyr::filter(Gene %in% paste0("Gene_", seq(1, 10)))
37
+
38
+    obj@normalized_count_table <- obj@normalized_count_table %>%
39
+        dplyr::filter(Barcode %in% obj@data_table$Barcode)
40
+
41
+    obj@count_table <- obj@count_table %>%
42
+        dplyr::filter(Barcode %in% obj@data_table$Barcode)
43
+
44
+    obj@annotation_table <- obj@annotation_table %>%
45
+        dplyr::filter(Barcode %in% obj@data_table$Barcode)
46
+
47
+    return(obj)
48 48
 }
49 49
 test_that("ROAST", {
50
-  testthat::skip_on_cran()
51
-  testthat::skip_on_bioc()
52
-
53
-  object <- create_test_object()
54
-
55
-  matrix <- model.matrix(~ object@groups)
56
-  colnames(matrix) <- c("Control", "T1/T2", "Treated")
57
-
58
-  roast_hit <- suppressWarnings(find_roast_hit(
59
-    screenR_Object = object,
60
-    matrix_model = matrix, contrast = "Treated"
61
-  ))
62
-  expect_equal(class(roast_hit)[[1]], "tbl_df")
50
+    object <- create_test_object()
51
+    matrix <- model.matrix(~ object@groups)
52
+    colnames(matrix) <- c("Control", "T1/T2", "Treated")
53
+
54
+    roast_hit <- suppressWarnings(find_roast_hit(
55
+        screenR_Object = object,
56
+        matrix_model = matrix, contrast = "Treated"
57
+    ))
58
+    expect_equal(class(roast_hit)[[1]], "tbl_df")
63 59
 })
64 60
 
65 61
 
66 62
 test_that("Camera", {
67
-  object <- create_test_object()
68
-
69
-  matrix <- model.matrix(~ object@groups)
70
-  colnames(matrix) <- c("Control", "T1/T2", "Treated")
71
-  camera_hit <- suppressWarnings(find_camera_hit(
72
-    screenR_Object = object,
73
-    matrix_model = matrix, contrast = "Treated"
74
-  ))
75
-  expect_equal(class(camera_hit)[1], "tbl_df")
63
+    object <- create_test_object()
64
+
65
+    matrix <- model.matrix(~ object@groups)
66
+    colnames(matrix) <- c("Control", "T1/T2", "Treated")
67
+    camera_hit <- suppressWarnings(find_camera_hit(
68
+        screenR_Object = object,
69
+        matrix_model = matrix, contrast = "Treated"
70
+    ))
71
+    expect_equal(class(camera_hit)[1], "tbl_df")
76 72
 })
77 73
 
78 74
 
79 75
 
80 76
 test_that("Hit Z-score per giorno", {
81
-  object <- create_test_object()
77
+    object <- create_test_object()
82 78
 
83
-  # In order to speed up the test we will compute the metrics only for a
84
-  # subset of the genes
85
-  genes <- c("Gene_1", "Gene_5")
86
-  object@data_table <- object@data_table[object@data_table$Gene %in% genes, ]
79
+    # In order to speed up the test we will compute the metrics only for a
80
+    # subset of the genes
81
+    genes <- c("Gene_1", "Gene_5")
82
+    object@data_table <- object@data_table[object@data_table$Gene %in% genes, ]
87 83
 
88
-  table <- compute_metrics(object,
89
-                           treatment = "TRT", control = "Time3",
90
-                           day = "Time3"
91
-  )
84
+    table <- compute_metrics(object,
85
+        treatment = "TRT", control = "Time3",
86
+        day = "Time3"
87
+    )
92 88
 
93
-  hit_table <- find_zscore_hit(table, number_barcode = 2)
94
-  expect_equal(class(hit_table)[1], "tbl_df")
89
+    hit_table <- find_zscore_hit(table, number_barcode = 2)
90
+    expect_equal(class(hit_table)[1], "tbl_df")
95 91
 })
96 92
 
97 93
 
98 94
 test_that("Find_Zscore_hit mean", {
99
-  object <- create_test_object()
95
+    object <- create_test_object()
100 96
 
101
-  genes <- c("Gene_1", "Gene_5")
102
-  object@data_table <- object@data_table[object@data_table$Gene %in% genes, ]
97
+    genes <- c("Gene_1", "Gene_5")
98
+    object@data_table <- object@data_table[object@data_table$Gene %in% genes, ]
103 99
 
104
-  table <- compute_metrics(object,
105
-                           control = "Time3", treatment = "TRT",
106
-                           day = c("Time3")
107
-  )
100
+    table <- compute_metrics(object,
101
+        control = "Time3", treatment = "TRT",
102
+        day = c("Time3")
103
+    )
108 104
 
109
-  hit_zscore <- find_zscore_hit(table, number_barcode = 2, metric = "mean")
105
+    hit_zscore <- find_zscore_hit(table, number_barcode = 2, metric = "mean")
110 106
 
111
-  expect_equal(class(hit_zscore)[[1]], "tbl_df")
107
+    expect_equal(class(hit_zscore)[[1]], "tbl_df")
112 108
 })
113 109
 
114 110
 test_that("Find_Score_hit median ", {
115
-  object <- create_test_object()
111
+    object <- create_test_object()
116 112
 
117
-  genes <- c("Gene_1", "Gene_5")
118
-  object@data_table <- object@data_table[object@data_table$Gene %in% genes, ]
113
+    genes <- c("Gene_1", "Gene_5")
114
+    object@data_table <- object@data_table[object@data_table$Gene %in% genes, ]
119 115
 
120
-  table <- compute_metrics(object,
121
-                           control = "Time3", treatment = "TRT",
122
-                           day = c("Time3")
123
-  )
124
-  hit_zscore <- find_zscore_hit(table, number_barcode = 4)
116
+    table <- compute_metrics(object,
117
+        control = "Time3", treatment = "TRT",
118
+        day = c("Time3")
119
+    )
120
+    hit_zscore <- find_zscore_hit(table, number_barcode = 4)
125 121
 
126
-  expect_equal(class(hit_zscore)[[1]], "tbl_df")
122
+    expect_equal(class(hit_zscore)[[1]], "tbl_df")
127 123
 })
128 124
 
129 125
 test_that("find_robust_zscore_hit median ", {
130
-  object <- create_test_object()
126
+    object <- create_test_object()
131 127
 
132
-  genes <- c("Gene_1", "Gene_5")
133
-  object@data_table <- object@data_table[object@data_table$Gene %in% genes, ]
128
+    genes <- c("Gene_1", "Gene_5")
129
+    object@data_table <- object@data_table[object@data_table$Gene %in% genes, ]
134 130
 
135
-  table <- compute_metrics(object,
136
-                           control = "Time3", treatment = "TRT",
137
-                           day = c("Time3")
138
-  )
139
-  hit_zscore_R <- find_robust_zscore_hit(table, number_barcode = 2)
140
-  expect_equal(class(hit_zscore_R)[[1]], "grouped_df")
131
+    table <- compute_metrics(object,
132
+        control = "Time3", treatment = "TRT",
133
+        day = c("Time3")
134
+    )
135
+    hit_zscore_R <- find_robust_zscore_hit(table, number_barcode = 2)
136
+    expect_equal(class(hit_zscore_R)[[1]], "grouped_df")
141 137
 })
142
-
Browse code

addressing other issue

Emanuel Soda authored on 24/04/2022 16:12:04
Showing1 changed files
... ...
@@ -25,7 +25,7 @@ create_test_object <- function() {
25 25
     "Time3_A", "Time3_B", "Time3_C", "Time4_TRT_A", "Time4_TRT_B",
26 26
     "Time4_TRT_C", "Time4_A", "Time4_B", "Time4_c"
27 27
   )
28
-  obj <- create_screenR_object(
28
+  obj <- create_screenr_object(
29 29
     table = data,
30 30
     annotation = annotaion, groups = groups, replicates = c("")
31 31
   )
Browse code

addressed reviews issue

Emanuel Soda authored on 23/04/2022 18:12:48
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,142 @@
1
+data("count_table", package = "ScreenR")
2
+data("annotation_table", package = "ScreenR")
3
+data <- count_table
4
+annotaion <- annotation_table
5
+
6
+groups <- factor(c(
7
+  "T1/T2", "T1/T2", "Treated", "Treated", "Treated",
8
+  "Control", "Control", "Control", "Treated", "Treated", "Treated",
9
+  "Control", "Control", "Control"
10
+))
11
+
12
+
13
+palette <- c(
14
+  "#1B9E75", "#1B9E75", "#D95F02", "#D95F02", "#D95F02",
15
+  "#7570B3", "#7570B3", "#7570B3", "#E7298A", "#E7298A", "#E7298A",
16
+  "#66A61E", "#66A61E", "#66A61E"
17
+)
18
+
19
+create_test_object <- function() {
20
+  data <- data %>%
21
+    dplyr::filter(Barcode != "*")
22
+
23
+  colnames(data) <- c(
24
+    "Barcode", "T1", "T2", "Time3_TRT_A", "Time3_TRT_B", "Time3_TRT_C",
25
+    "Time3_A", "Time3_B", "Time3_C", "Time4_TRT_A", "Time4_TRT_B",
26
+    "Time4_TRT_C", "Time4_A", "Time4_B", "Time4_c"
27
+  )
28
+  obj <- create_screenR_object(
29
+    table = data,
30
+    annotation = annotaion, groups = groups, replicates = c("")
31
+  )
32
+  obj <- normalize_data(obj)
33
+  obj <- compute_data_table(obj)
34
+
35
+  obj@data_table <- obj@data_table  %>%
36
+    dplyr::filter(Gene %in% paste0("Gene_", seq(1, 10)))
37
+
38
+  obj@normalized_count_table <- obj@normalized_count_table   %>%
39
+    dplyr::filter(Barcode %in% obj@data_table$Barcode)
40
+
41
+  obj@count_table <- obj@count_table   %>%
42
+    dplyr::filter(Barcode %in% obj@data_table$Barcode)
43
+
44
+  obj@annotation_table <- obj@annotation_table   %>%
45
+    dplyr::filter(Barcode %in% obj@data_table$Barcode)
46
+
47
+  return(obj)
48
+}
49
+test_that("ROAST", {
50
+  testthat::skip_on_cran()
51
+  testthat::skip_on_bioc()
52
+
53
+  object <- create_test_object()
54
+
55
+  matrix <- model.matrix(~ object@groups)
56
+  colnames(matrix) <- c("Control", "T1/T2", "Treated")
57
+
58
+  roast_hit <- suppressWarnings(find_roast_hit(
59
+    screenR_Object = object,
60
+    matrix_model = matrix, contrast = "Treated"
61
+  ))
62
+  expect_equal(class(roast_hit)[[1]], "tbl_df")
63
+})
64
+
65
+
66
+test_that("Camera", {
67
+  object <- create_test_object()
68
+
69
+  matrix <- model.matrix(~ object@groups)
70
+  colnames(matrix) <- c("Control", "T1/T2", "Treated")
71
+  camera_hit <- suppressWarnings(find_camera_hit(
72
+    screenR_Object = object,
73
+    matrix_model = matrix, contrast = "Treated"
74
+  ))
75
+  expect_equal(class(camera_hit)[1], "tbl_df")
76
+})
77
+
78
+
79
+
80
+test_that("Hit Z-score per giorno", {
81
+  object <- create_test_object()
82
+
83
+  # In order to speed up the test we will compute the metrics only for a
84
+  # subset of the genes
85
+  genes <- c("Gene_1", "Gene_5")
86
+  object@data_table <- object@data_table[object@data_table$Gene %in% genes, ]
87
+
88
+  table <- compute_metrics(object,
89
+                           treatment = "TRT", control = "Time3",
90
+                           day = "Time3"
91
+  )
92
+
93
+  hit_table <- find_zscore_hit(table, number_barcode = 2)
94
+  expect_equal(class(hit_table)[1], "tbl_df")
95
+})
96
+
97
+
98
+test_that("Find_Zscore_hit mean", {
99
+  object <- create_test_object()
100
+
101
+  genes <- c("Gene_1", "Gene_5")
102
+  object@data_table <- object@data_table[object@data_table$Gene %in% genes, ]
103
+
104
+  table <- compute_metrics(object,
105
+                           control = "Time3", treatment = "TRT",
106
+                           day = c("Time3")
107
+  )
108
+
109
+  hit_zscore <- find_zscore_hit(table, number_barcode = 2, metric = "mean")
110
+
111
+  expect_equal(class(hit_zscore)[[1]], "tbl_df")
112
+})
113
+
114
+test_that("Find_Score_hit median ", {
115
+  object <- create_test_object()
116
+
117
+  genes <- c("Gene_1", "Gene_5")
118
+  object@data_table <- object@data_table[object@data_table$Gene %in% genes, ]
119
+
120
+  table <- compute_metrics(object,
121
+                           control = "Time3", treatment = "TRT",
122
+                           day = c("Time3")
123
+  )
124
+  hit_zscore <- find_zscore_hit(table, number_barcode = 4)
125
+
126
+  expect_equal(class(hit_zscore)[[1]], "tbl_df")
127
+})
128
+
129
+test_that("find_robust_zscore_hit median ", {
130
+  object <- create_test_object()
131
+
132
+  genes <- c("Gene_1", "Gene_5")
133
+  object@data_table <- object@data_table[object@data_table$Gene %in% genes, ]
134
+
135
+  table <- compute_metrics(object,
136
+                           control = "Time3", treatment = "TRT",
137
+                           day = c("Time3")
138
+  )
139
+  hit_zscore_R <- find_robust_zscore_hit(table, number_barcode = 2)
140
+  expect_equal(class(hit_zscore_R)[[1]], "grouped_df")
141
+})
142
+