count_cell_types: Counts number of pixel occurrences for each cell type to be...

View source: R/CSIDE_utils.R

count_cell_typesR Documentation

Counts number of pixel occurrences for each cell type to be used in the CSIDE model

Description

The difference with aggregate_cell_types is that this function does filter out pixels based on total cell type weight, as occurs in the CSIDE algorithm.

Usage

count_cell_types(
  myRCTD,
  barcodes,
  cell_types,
  cell_type_threshold = 125,
  doublet_mode = T,
  weight_threshold = NULL
)

Arguments

barcodes

the barcodes, or pixel names, of the SpatialRNA object to be used when counting cell typel\.

cell_types

the cell types used for CSIDE. If null, cell types will be chosen with aggregate occurences of at least 'cell_type_threshold', as aggregated by aggregate_cell_types

cell_type_threshold

(default 125) min occurence of number of cells for each cell type to be used, as aggregated by aggregate_cell_types

doublet_mode

(default TRUE) if TRUE, uses RCTD doublet mode weights. Otherwise, uses RCTD full mode weights

weight_threshold

(default NULL) the threshold of total normalized weights across all cell types in cell_types per pixel to be included in the model. Default 0.99 for doublet_mode or 0.95 for full_mode.

RCTD

an RCTD object with annotated cell types e.g. from the run.RCTD function.

Value

a named vector of number of pixel occurrences for each cell type


dmcable/RCTD documentation built on Feb. 24, 2024, 11:03 p.m.