Skip to content

Commit

Permalink
Update docs for get_mean_ratio, mostly related to <10 cell warning
Browse files Browse the repository at this point in the history
  • Loading branch information
lahuuki committed Aug 7, 2024
1 parent 3fd3c02 commit 4192530
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions R/get_mean_ratio.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
#' Calculate the mean ratio value and rank for each gene for each cell type in the `sce`
#' object, to identify effective marker genes for deconvolution.
#'
#' Improved argument names and documentaion, but same functionalty from `get_mean_ratio2()`.
#' Note if a cell type has < 10 cells the MeanRatio results may be unstable.
#' See rational in OSCA: <https://bioconductor.org/books/3.19/OSCA.multisample/multi-sample-comparisons.html#performing-the-de-analysis>
#'
#' @param sce [SummarizedExperiment-class][SummarizedExperiment::SummarizedExperiment-class]
#' (or any derivative class) object containing single cell/nucleus gene expression data
#' @param cellType_col A `character(1)` name of the column in the
#' [colData()][SummarizedExperiment::SummarizedExperiment-class] of `sce` that
#' denotes the cell type or group of interest
#' denotes the cell type or group of interest.
#' @param assay_name A `character(1)` specifying the name of the
#' [assay()][SummarizedExperiment::SummarizedExperiment-class] in the
#' `sce` object to use to rank expression values. Defaults to `logcounts` since
Expand Down Expand Up @@ -82,7 +83,7 @@ get_mean_ratio <- function(

ct_table <- table(sce[[cellType_col]])

if (any(ct_table < 10)) warning("One or more cell types has < 10 cells, this may result in unstable marker genes results")
if (any(ct_table < 10)) warning("One or more cell types has < 10 cells, this may result in unstable marker genes results. Check details of get_mean_ratio() for more info")

sce_assay <- as.matrix(SummarizedExperiment::assays(sce)[[assay_name]])

Expand Down
5 changes: 3 additions & 2 deletions man/get_mean_ratio.Rd

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

0 comments on commit 4192530

Please sign in to comment.