15
15
# ' @param algorithm Clustering algorithm to use. Must be one of "louvain" (default), "walktrap", or "leiden".
16
16
# ' @param weighting Weighting scheme to use. Must be one of "jaccard" (default), "rank", or "number"
17
17
# ' @param nn Number of nearest neighbors. The default is 10.
18
- # ' @param resolution Resolution parameter used by louvain and leiden clustering only. Default is 1.
18
+ # ' @param resolution Resolution parameter used by Louvain and Leiden clustering only. Default is 1.
19
19
# ' @param objective_function Leiden-specific parameter for whether to use the Constant Potts Model ("CPM"; default)
20
20
# ' or "modularity"
21
21
# ' @param cluster_args List of additional arguments to pass to the chosen clustering function.
50
50
# ' # cluster directly from a matrix using default parameters
51
51
# ' cluster_df <- calculate_clusters(pca_matrix, seed = 11)
52
52
# '
53
- # ' # cluster directly from a matrix using the leiden algorithm with a resolution of 0.1
53
+ # ' # cluster directly from a matrix using the Leiden algorithm with a resolution of 0.1
54
54
# ' cluster_df <- calculate_clusters(
55
55
# ' pca_matrix,
56
56
# ' algorithm = "leiden",
57
57
# ' resolution = 0.1,
58
58
# ' seed = 11
59
59
# ' )
60
60
# '
61
- # ' # cluster directly from a matrix using the leiden algorithm with 3 iterations
61
+ # ' # cluster directly from a matrix using the Leiden algorithm with 3 iterations
62
62
# ' cluster_df <- calculate_clusters(
63
63
# ' pca_matrix,
64
64
# ' algorithm = "leiden",
@@ -71,8 +71,8 @@ calculate_clusters <- function(
71
71
algorithm = c(" louvain" , " walktrap" , " leiden" ),
72
72
weighting = c(" jaccard" , " rank" , " number" ),
73
73
nn = 10 ,
74
- resolution = 1 , # louvain or leiden
75
- objective_function = c(" CPM" , " modularity" ), # leiden only
74
+ resolution = 1 , # Louvain or Leiden
75
+ objective_function = c(" CPM" , " modularity" ), # Leiden only
76
76
cluster_args = list (),
77
77
threads = 1 ,
78
78
seed = NULL ,
@@ -157,15 +157,15 @@ calculate_clusters <- function(
157
157
# '
158
158
# ' This function first determines if the provided object is a SingleCellExperiment or
159
159
# ' Seurat object, and then extract the PC matrix. If no name for the PC matrix is provided,
160
- # ' this function will assume the name of "PCA" for SingleCellExperiment objects, and
160
+ # ' this function will use "PCA" for SingleCellExperiment objects, and
161
161
# ' "pca" for Seurat objects.
162
162
# '
163
163
# ' @import SingleCellExperiment
164
164
# ' @import methods
165
165
# '
166
166
# ' @param sc_object Either a SingleCellExperiment or Seurat object
167
167
# ' @param pc_name Optionally, the name of the PC matrix in the object. If this is
168
- # ' not provided, the name "PCA" is assumed for SingleCellExperiment objects, and
168
+ # ' not provided, the name "PCA" is used for SingleCellExperiment objects, and
169
169
# ' "pca" for Seurat objects.
170
170
# '
171
171
# ' @return PC matrix with row names
@@ -174,13 +174,13 @@ calculate_clusters <- function(
174
174
# '
175
175
# ' @examples
176
176
# ' \dontrun{
177
- # ' # extract PC matrix from SCE object, assuming default name "PCA"
177
+ # ' # extract PC matrix from SCE object, using default name "PCA"
178
178
# ' pca_matrix <- extract_pc_matrix(sce_object)
179
179
# '
180
180
# ' # extract PC matrix from SCE object with non-default name "PCA_MAT"
181
181
# ' pca_matrix <- extract_pc_matrix(sce_object, pc_name = "PCA_MAT")
182
182
# '
183
- # ' # extract PC matrix from Seurat object, assuming default name "pca"
183
+ # ' # extract PC matrix from Seurat object, using default name "pca"
184
184
# ' pca_matrix <- extract_pc_matrix(seurat_object)
185
185
# ' }
186
186
extract_pc_matrix <- function (sc_object , pc_name = NULL ) {
@@ -233,7 +233,7 @@ extract_pc_matrix <- function(sc_object, pc_name = NULL) {
233
233
# ' or Seurat object containing PCs. If a matrix is provided, rows should be cells
234
234
# ' and columns should be PCs, and row names should be cell ids (e.g., barcodes).
235
235
# ' @param pc_name Optionally, the name of the PC matrix in the object. Not used for
236
- # ' matrices. If this is not provided, the name "PCA" is assumed for
236
+ # ' matrices. If this is not provided, the name "PCA" is used for
237
237
# ' SingleCellExperiment objects, and "pca" for Seurat objects.
238
238
# '
239
239
# ' @return A matrix of PCs with row names representing cell ids
0 commit comments