|
34 | 34 | #' neighbor and build graph, default is FALSE, meaning the nearest neighbor will be found in cells to cells, |
35 | 35 | #' features to features, cells to features respectively to build graph. |
36 | 36 | #' @param knn.graph.weighted logical whether consider the distance of nodes in the Nearest Neighbors, default is TRUE. |
37 | | -#' @param knn.k.use numeric the number of the Nearest Neighbors nodes, default is 600. |
| 37 | +#' @param knn.k.use numeric the number of the Nearest Neighbors nodes, default is 0.06 * number of gene in \code{data}. |
38 | 38 | #' @param rwr.restart the restart probability used for restart walk with restart, should be between 0 and 1, default is 0.75. |
39 | 39 | #' @param rwr.normalize.adj.method character the method to normalize the adjacency matrix of the input graph, |
40 | 40 | #' default is \code{laplacian}. |
41 | 41 | #' @param rwr.normalize.affinity logical whether normalize the activity (affinity) result score using quantile normalization, |
42 | 42 | #' default is FALSE. |
43 | 43 | #' @param rwr.prop.normalize logical whether divide the specific activity score by total activity score for a sample, |
44 | | -#' default is FALSE. |
| 44 | +#' default is FALSE. if \code{gset.idx.list} is celltype gene set, we recommend using TRUE. |
45 | 45 | #' @param rwr.threads the threads to run Random Walk With Restart (RWR), default is NULL, which will initialize with the default |
46 | 46 | #' number of threads, you can also set this using \code{RcppParallel::setThreadOptions(numThreads=10)}. |
47 | 47 | #' @param hyper.test.weighted character which method to weight the activity score of cell, should is one of "Hypergeometric", "Wallenius", |
@@ -161,7 +161,7 @@ setGeneric('runSGSA', |
161 | 161 | knn.used.reduction.dims = 30, |
162 | 162 | knn.combined.cell.feature = FALSE, |
163 | 163 | knn.graph.weighted = TRUE, |
164 | | - knn.k.use = 600, |
| 164 | + knn.k.use = round(0.06 * nrow(data)), |
165 | 165 | rwr.restart = .75, |
166 | 166 | rwr.normalize.adj.method = c("laplacian", "row", "column", "none"), |
167 | 167 | rwr.normalize.affinity = FALSE, |
@@ -200,7 +200,7 @@ setMethod('runSGSA', |
200 | 200 | knn.used.reduction.dims = 30, |
201 | 201 | knn.combined.cell.feature = FALSE, |
202 | 202 | knn.graph.weighted = TRUE, |
203 | | - knn.k.use = 600, |
| 203 | + knn.k.use = round(0.06 * nrow(data)), |
204 | 204 | rwr.restart = .75, |
205 | 205 | rwr.normalize.adj.method = c("laplacian", "row", "column", "none"), |
206 | 206 | rwr.normalize.affinity = FALSE, |
|
0 commit comments