Skip to content

Commit e825ef2

Browse files
committed
spelling & wording updates
1 parent a44e296 commit e825ef2

File tree

6 files changed

+36
-36
lines changed

6 files changed

+36
-36
lines changed

R/calculate-clusters.R

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#' @param algorithm Clustering algorithm to use. Must be one of "louvain" (default), "walktrap", or "leiden".
1616
#' @param weighting Weighting scheme to use. Must be one of "jaccard" (default), "rank", or "number"
1717
#' @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.
1919
#' @param objective_function Leiden-specific parameter for whether to use the Constant Potts Model ("CPM"; default)
2020
#' or "modularity"
2121
#' @param cluster_args List of additional arguments to pass to the chosen clustering function.
@@ -50,15 +50,15 @@
5050
#' # cluster directly from a matrix using default parameters
5151
#' cluster_df <- calculate_clusters(pca_matrix, seed = 11)
5252
#'
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
5454
#' cluster_df <- calculate_clusters(
5555
#' pca_matrix,
5656
#' algorithm = "leiden",
5757
#' resolution = 0.1,
5858
#' seed = 11
5959
#' )
6060
#'
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
6262
#' cluster_df <- calculate_clusters(
6363
#' pca_matrix,
6464
#' algorithm = "leiden",
@@ -71,8 +71,8 @@ calculate_clusters <- function(
7171
algorithm = c("louvain", "walktrap", "leiden"),
7272
weighting = c("jaccard", "rank", "number"),
7373
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
7676
cluster_args = list(),
7777
threads = 1,
7878
seed = NULL,
@@ -157,15 +157,15 @@ calculate_clusters <- function(
157157
#'
158158
#' This function first determines if the provided object is a SingleCellExperiment or
159159
#' 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
161161
#' "pca" for Seurat objects.
162162
#'
163163
#' @import SingleCellExperiment
164164
#' @import methods
165165
#'
166166
#' @param sc_object Either a SingleCellExperiment or Seurat object
167167
#' @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
169169
#' "pca" for Seurat objects.
170170
#'
171171
#' @return PC matrix with row names
@@ -174,13 +174,13 @@ calculate_clusters <- function(
174174
#'
175175
#' @examples
176176
#' \dontrun{
177-
#' # extract PC matrix from SCE object, assuming default name "PCA"
177+
#' # extract PC matrix from SCE object, using default name "PCA"
178178
#' pca_matrix <- extract_pc_matrix(sce_object)
179179
#'
180180
#' # extract PC matrix from SCE object with non-default name "PCA_MAT"
181181
#' pca_matrix <- extract_pc_matrix(sce_object, pc_name = "PCA_MAT")
182182
#'
183-
#' # extract PC matrix from Seurat object, assuming default name "pca"
183+
#' # extract PC matrix from Seurat object, using default name "pca"
184184
#' pca_matrix <- extract_pc_matrix(seurat_object)
185185
#' }
186186
extract_pc_matrix <- function(sc_object, pc_name = NULL) {
@@ -233,7 +233,7 @@ extract_pc_matrix <- function(sc_object, pc_name = NULL) {
233233
#' or Seurat object containing PCs. If a matrix is provided, rows should be cells
234234
#' and columns should be PCs, and row names should be cell ids (e.g., barcodes).
235235
#' @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
237237
#' SingleCellExperiment objects, and "pca" for Seurat objects.
238238
#'
239239
#' @return A matrix of PCs with row names representing cell ids

R/sweep-clusters.R

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#' For each algorithm specified, all parameters possible to use with that
1212
#' algorithm will be systematically varied. This function does not accept additional
1313
#' parameters besides those listed above.
14-
#' Note that defaults for some arguments may differ from the bluster::NNGraphParam() defaults.
14+
#' Note that defaults for some arguments may differ from the `bluster::NNGraphParam()` defaults.
1515
#' Specifically, the clustering algorithm defaults to "louvain" and the weighting scheme to "jaccard"
1616
#' to align with common practice in scRNA-seq analysis.
1717
#'
@@ -25,7 +25,7 @@
2525
#' "rank", or "number"
2626
#' @param nn Number of nearest neighbors to consider when sweeping parameters.
2727
#' Provide a vector of unique values to vary this parameter. The default is 10.
28-
#' @param resolution Resolution parameter used by louvain and leiden clustering only.
28+
#' @param resolution Resolution parameter used by Louvain and Leiden clustering only.
2929
#' Provide a vector of unique values to vary this parameter. The default is 1.
3030
#' @param objective_function Leiden-specific parameter for whether to use the
3131
#' Constant Potts Model ("CPM"; default) or "modularity". Provide a vector of unique values
@@ -39,22 +39,22 @@
3939
#' @return A list of data frames from performing clustering across all parameter combinations.
4040
#' Columns include `cluster_set` (identifier column for results from a single clustering run),
4141
#' `cell_id`, and `cluster`. Additional columns represent algorithm parameters and include at least:
42-
#' `algorithm`, `weighting`, and `nn`. Louvain and leiden clustering will also include `resolution`,
43-
#' and leiden clustering will further include `objective_function`.
42+
#' `algorithm`, `weighting`, and `nn`. Louvain and Leiden clustering will also include `resolution`,
43+
#' and Leiden clustering will further include `objective_function`.
4444
#'
4545
#' @export
4646
#'
4747
#' @examples
4848
#' \dontrun{
49-
#' # perform louvain clustering with jaccard weighting (defaults),
49+
#' # perform Louvain clustering with Jaccard weighting (defaults),
5050
#' # varying the nearest neighobor parameter, and set a seed for reproducibility
5151
#' cluster_df <- sweep_clusters(
5252
#' sce_object,
5353
#' nn = c(10, 15, 20, 25),
5454
#' seed = 11
5555
#' )
5656
#'
57-
#' # perform louvain clustering, with jaccard and rank weighting, and
57+
#' # perform Louvain clustering, with Jaccard and rank weighting, and
5858
#' # varying the nearest neighbor and resolution parameters.
5959
#' cluster_df <- sweep_clusters(
6060
#' sce_object,
@@ -65,8 +65,8 @@
6565
#' seed = 11
6666
#' )
6767
#'
68-
#' # perform walktrap and louvain clustering with jaccard weighting, and
69-
#' # varying the nearest neighbors for both algorithms, and resolution for louvain.
68+
#' # perform walktrap and Louvain clustering with Jaccard weighting, and
69+
#' # varying the nearest neighbors for both algorithms, and resolution for Louvain.
7070
#' cluster_df <- sweep_clusters(
7171
#' sce_object,
7272
#' algorithm = c("walktrap", "louvain"),
@@ -81,8 +81,8 @@ sweep_clusters <- function(
8181
algorithm = "louvain",
8282
weighting = "jaccard",
8383
nn = 10,
84-
resolution = 1, # louvain or leiden
85-
objective_function = "CPM", # leiden only
84+
resolution = 1, # Louvain or Leiden
85+
objective_function = "CPM", # Leiden only
8686
threads = 1,
8787
seed = NULL,
8888
pc_name = NULL) {

man/calculate_clusters.Rd

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/extract_pc_matrix.Rd

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/prepare_pc_matrix.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/sweep_clusters.Rd

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)