Browse code

export plsda

Jaehyun Joo authored on 25/10/2021 12:33:39
Showing 4 changed files

... ...
@@ -30,6 +30,7 @@ export(.get_poplinData_names)
30 30
 export(.get_poplinReducedData_data_character)
31 31
 export(.get_poplinReducedData_data_integer)
32 32
 export(.get_poplinReducedData_data_missing)
33
+export(.poplin_annotate)
33 34
 export(.poplin_history)
34 35
 export(.set_poplinData_data_character)
35 36
 export(.set_poplinData_data_integer)
... ...
@@ -74,6 +75,7 @@ export(poplin_normalize_vast)
74 75
 export(poplin_normalize_vsn)
75 76
 export(poplin_reduce)
76 77
 export(poplin_reduce_pca)
78
+export(poplin_reduce_plsda)
77 79
 export(poplin_reduce_tsne)
78 80
 export(poplin_reduced)
79 81
 export(poplin_reduced_list)
... ...
@@ -151,6 +153,9 @@ importFrom(heatmaply,heatmaply)
151 153
 importFrom(heatmaply,is.na10)
152 154
 importFrom(methods,as)
153 155
 importFrom(methods,new)
156
+importFrom(stats,cutree)
157
+importFrom(stats,dist)
158
+importFrom(stats,hclust)
154 159
 importFrom(stats,lm.wfit)
155 160
 importFrom(stats,loess)
156 161
 importFrom(stats,mad)
... ...
@@ -269,3 +269,9 @@ setGeneric(
269 269
   "poplin_reduce_tsne",
270 270
   function(x, ...) standardGeneric("poplin_reduce_tsne")
271 271
 )
272
+
273
+##' @export
274
+setGeneric(
275
+  "poplin_reduce_plsda",
276
+  function(x, ...) standardGeneric("poplin_reduce_plsda")
277
+)
... ...
@@ -7,7 +7,7 @@
7 7
     method,
8 8
     pca = .poplin_reduce_pca(x, ncomp = ncomp, ...),
9 9
     tsne = .poplin_reduce_tsne(x, ncomp = ncomp, ...),
10
-    plsda = .poplin_reduce_tsne(x, y = y, ncomp = ncomp, ...)
10
+    plsda = .poplin_reduce_plsda(x, y = y, ncomp = ncomp, ...)
11 11
   )
12 12
 }
13 13
 
... ...
@@ -50,5 +50,23 @@ setMethod(
50 50
   }
51 51
 )
52 52
 
53
+setMethod(
54
+  "poplin_reduce_plsda",
55
+  "matrix",
56
+  function(x, ...) {
57
+    .poplin_impute_plsda(x, ...)
58
+  }
59
+)
60
+
61
+setMethod(
62
+  "poplin_reduce_plsda",
63
+  "poplin",
64
+  function(x, poplin_in, poplin_out, ...) {
65
+    .reduced_extract_and_assign(x, .poplin_reduce_plsda,
66
+                                poplin_in, poplin_out)
67
+  }
68
+)
69
+
70
+
53 71
 
54 72