Browse code

Fix bug because of underscore in cell type

Former-commit-id: 247fd7d1fa1a07d81cc034cf4274a00016b7c9d0

nttvy authored on 01/06/2021 12:23:20
Showing 5 changed files

... ...
@@ -47,10 +47,11 @@ setGeneric("train_classifier",
47 47
 #' 
48 48
 #' @param seurat_tag_slot string, name of slot in cell meta data 
49 49
 #' indicating cell tag/label in the training object.
50
-#' Strings indicating cell types are expected in this slot. 
50
+#' Strings indicating cell types are expected in this slot.
51 51
 #' For \code{\link{Seurat}} object, default value is "active.ident".  
52
-#' Expected values are string or binary/logical, 
53
-#' 0/"no"/F/FALSE: not being new cell type, 1/"yes"/T/TRUE: being new cell type.
52
+#' Expected values are string (A-Z, a-z, 0-9, no special character accepted) 
53
+#' or binary/logical, 0/"no"/F/FALSE: not being new cell type, 
54
+#' 1/"yes"/T/TRUE: being new cell type.
54 55
 #' @param seurat_parent_tag_slot string, name of a slot in cell meta data 
55 56
 #' indicating assigned/predicted cell type. Default is "predicted_cell_type". 
56 57
 #' This slot would have been filled automatically 
... ...
@@ -193,8 +194,9 @@ setMethod("train_classifier", c("train_obj" = "Seurat"),
193 194
 #' @param sce_tag_slot string, name of annotation slot indicating 
194 195
 #' cell tag/label in the training object.
195 196
 #' For \code{\link{SingleCellExperiment}} object, default value is "ident".  
196
-#' Expected values are string or binary/logical, 
197
-#' 0/"no"/F/FALSE: not being new cell type, 1/"yes"/T/TRUE: being new cell type.
197
+#' Expected values are string (A-Z, a-z, 0-9, no special character accepted) 
198
+#' or binary/logical, 0/"no"/F/FALSE: not being new cell type, 
199
+#' 1/"yes"/T/TRUE: being new cell type.
198 200
 #' @param sce_parent_tag_slot string, name of a slot in cell meta data 
199 201
 #' indicating pre-assigned/predicted cell type. 
200 202
 #' Default field is "predicted_cell_type".
... ...
@@ -339,8 +341,8 @@ setGeneric("test_classifier", function(test_obj, classifier,
339 341
 #' indicating cell tag/label in the testing object.
340 342
 #' Strings indicating cell types are expected in this slot. 
341 343
 #' For \code{\link{Seurat}} object, default value is "active.ident". 
342
-#' Expected values is string or binary/logical, 
343
-#' 0/"no"/F/FALSE: not being new cell type, 
344
+#' Expected values are string (A-Z, a-z, 0-9, no special character accepted) 
345
+#' or binary/logical, 0/"no"/F/FALSE: not being new cell type, 
344 346
 #' 1/"yes"/T/TRUE: being new cell type.
345 347
 #' @param seurat_parent_tag_slot string, name of tag slot in cell meta data
346 348
 #' indicating pre-assigned/predicted parent cell type. 
... ...
@@ -444,8 +446,8 @@ setMethod("test_classifier", c("test_obj" = "Seurat",
444 446
 #' indicating cell tag/label in the testing object.
445 447
 #' Strings indicating cell types are expected in this slot. 
446 448
 #' Default value is "ident".  
447
-#' Expected values are string or binary/logical, 
448
-#' 0/"no"/F/FALSE: not being new cell type, 
449
+#' Expected values are string (A-Z, a-z, 0-9, no special character accepted) 
450
+#' or binary/logical, 0/"no"/F/FALSE: not being new cell type, 
449 451
 #' 1/"yes"/T/TRUE: being new cell type.
450 452
 #' @param sce_parent_tag_slot string, name of tag slot in cell meta data
451 453
 #' indicating pre-assigned/predicted parent cell type. 
452 454
Binary files a/data/default_models.rda and b/data/default_models.rda differ
... ...
@@ -69,8 +69,8 @@ the new_models.rda file.}
69 69
 indicating cell tag/label in the testing object.
70 70
 Strings indicating cell types are expected in this slot. 
71 71
 For \code{\link{Seurat}} object, default value is "active.ident". 
72
-Expected values is string or binary/logical, 
73
-0/"no"/F/FALSE: not being new cell type, 
72
+Expected values are string (A-Z, a-z, 0-9, no special character accepted) 
73
+or binary/logical, 0/"no"/F/FALSE: not being new cell type, 
74 74
 1/"yes"/T/TRUE: being new cell type.}
75 75
 
76 76
 \item{seurat_parent_tag_slot}{string, name of tag slot in cell meta data
... ...
@@ -90,8 +90,8 @@ Default to "counts", which contains unnormalized data.}
90 90
 indicating cell tag/label in the testing object.
91 91
 Strings indicating cell types are expected in this slot. 
92 92
 Default value is "ident".  
93
-Expected values are string or binary/logical, 
94
-0/"no"/F/FALSE: not being new cell type, 
93
+Expected values are string (A-Z, a-z, 0-9, no special character accepted) 
94
+or binary/logical, 0/"no"/F/FALSE: not being new cell type, 
95 95
 1/"yes"/T/TRUE: being new cell type.}
96 96
 
97 97
 \item{sce_parent_tag_slot}{string, name of tag slot in cell meta data
... ...
@@ -78,10 +78,11 @@ new_models.rda file.}
78 78
 
79 79
 \item{seurat_tag_slot}{string, name of slot in cell meta data 
80 80
 indicating cell tag/label in the training object.
81
-Strings indicating cell types are expected in this slot. 
81
+Strings indicating cell types are expected in this slot.
82 82
 For \code{\link{Seurat}} object, default value is "active.ident".  
83
-Expected values are string or binary/logical, 
84
-0/"no"/F/FALSE: not being new cell type, 1/"yes"/T/TRUE: being new cell type.}
83
+Expected values are string (A-Z, a-z, 0-9, no special character accepted) 
84
+or binary/logical, 0/"no"/F/FALSE: not being new cell type, 
85
+1/"yes"/T/TRUE: being new cell type.}
85 86
 
86 87
 \item{seurat_parent_tag_slot}{string, name of a slot in cell meta data 
87 88
 indicating assigned/predicted cell type. Default is "predicted_cell_type". 
... ...
@@ -99,8 +100,9 @@ and "scale.data". Default to "counts", which contains unnormalized data.}
99 100
 \item{sce_tag_slot}{string, name of annotation slot indicating 
100 101
 cell tag/label in the training object.
101 102
 For \code{\link{SingleCellExperiment}} object, default value is "ident".  
102
-Expected values are string or binary/logical, 
103
-0/"no"/F/FALSE: not being new cell type, 1/"yes"/T/TRUE: being new cell type.}
103
+Expected values are string (A-Z, a-z, 0-9, no special character accepted) 
104
+or binary/logical, 0/"no"/F/FALSE: not being new cell type, 
105
+1/"yes"/T/TRUE: being new cell type.}
104 106
 
105 107
 \item{sce_parent_tag_slot}{string, name of a slot in cell meta data 
106 108
 indicating pre-assigned/predicted cell type. 
... ...
@@ -104,9 +104,14 @@ To launch cell type identification, we simply call the `classify_cells`
104 104
 function. A detailed description of all parameters can be found through
105 105
 the function's help page `?classify_cells`.
106 106
 
107
+Here we use only 3 classifiers for B cells, T cells and NK cells to reduce 
108
+computational cost of this vignette. If users want to use all pretrained 
109
+classifiers on their dataset, `cell_types = 'all'` can be used.
107 110
 ```{r}
108 111
 seurat.obj <- classify_cells(classify_obj = tirosh_mel80_example, 
109
-                             cell_types = 'all', path_to_models = 'default')
112
+                             seurat_assay = 'RNA', seurat_slot = 'data',
113
+                             cell_types = c('B cells', 'NK', 'T cells'), 
114
+                             path_to_models = 'default')
110 115
 ```
111 116
 
112 117
 #### Parameters
... ...
@@ -130,7 +135,7 @@ but with additional columns in the metadata table.
130 135
 
131 136
 ```{r}
132 137
 # display the additional metadata fields
133
-seurat.obj[[]][c(20:30), c(8:21)]
138
+seurat.obj[[]][c(50:60), c(8:16)]
134 139
 ```
135 140
 New columns are:
136 141