Skip to content

Commit

Permalink
changed an argument name to be more standardized
Browse files Browse the repository at this point in the history
  • Loading branch information
jr-leary7 committed Mar 21, 2024
1 parent 31debbc commit 4f44e1e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions R/sortObservations.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#' @importFrom dplyr arrange
#' @description Since the GEE & GLMM modes require data to be sorted by sample ID and pseudotime, this function provides a simple way to do so for a range of inputs.
#' @param expr.mat Either a \code{SingleCellExperiment} or \code{Seurat} object from which counts can be extracted, or a matrix of integer-valued counts with genes as rows & cells as columns. Defaults to NULL.
#' @param pt A vector of pseudotime values used to sort the observations. May contain NA values. Defaults to NULL.
#' @param pt.vec A vector of pseudotime values used to sort the observations. May contain NA values. Defaults to NULL.
#' @param id.vec A vector of subject IDs used to sort the observations. Defaults to NULL.
#' @return An object of the same class as the input \code{expr.mat}, but sorted by sample ID & pseudotime.
#' @details
Expand All @@ -21,14 +21,14 @@
#' id.vec = sim_counts$subject)

sortObservations <- function(expr.mat = NULL,
pt = NULL,
pt.vec = NULL,
id.vec = NULL) {
# check inputs
if (is.null(expr.mat) || is.null(pt) || is.null(id.vec)) { stop("You forgot some inputs to sortObservations().") }
if (any(is.na(id.vec))) { stop("The subject ID vector must not contain any NA values.") }
# create table with subject ID and pseudotime
subj_df <- data.frame(ID = id.vec,
PT = pt,
PT = pt.vec,
Cell = colnames(expr.mat))
# arrange by subject ID then pseudotime
subj_df <- dplyr::arrange(subj_df,
Expand Down
4 changes: 2 additions & 2 deletions man/sortObservations.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4f44e1e

Please sign in to comment.