
Build Rectangle Signatures
build_model_rectangle.RdBuilds a RectangleSignatureResult from single-cell count data. If a spatial
object is provided, Rectangle can use the matching bulk/spatial expression
profiles while optimizing signature cutoffs.
Usage
build_model_rectangle(
single_cell_obj,
spatial_obj = NULL,
cell_type_col = "cell_ontology_class",
assay_sc = "counts",
assay_sp = "counts",
optimize_cutoffs = TRUE,
p = 0.015,
lfc = 1.5,
n_cpus = 1L,
gene_expression_threshold = 0.5
)Arguments
- single_cell_obj
SingleCellExperiment.- spatial_obj
Optional
SpatialExperiment.- cell_type_col
Column in
single_cell_objcontaining cell type labels.- assay_sc
Single-cell assay to use. Rectangle expects raw counts.
- assay_sp
Spatial assay to use. Use raw UMI counts or CPM for UMI-based spatial data; Rectangle rescales each spot to a total of one million. For non-UMI full-length data, supply TPM. Do not use log-transformed values.
- optimize_cutoffs
Optimize Rectangle signature cutoffs.
- p
P-value cutoff used when
optimize_cutoffs = FALSE.- lfc
Log-fold-change cutoff used when
optimize_cutoffs = FALSE.- n_cpus
Number of CPU cores to use in Rectangle (default: 1).
- gene_expression_threshold
Rectangle gene expression threshold.