Estimates cell-type fractions from bulk RNA-seq data using the Rectangle
method. Accepts either a pre-built signature (from build_model_rectanglepy())
or single-cell data for a one-step run.
deconvolute_rectanglepy(
bulk_gene_expression,
signature = NULL,
single_cell_object = NULL,
cell_type_annotations = NULL,
correct_mrna_bias = TRUE,
optimize_cutoffs = TRUE,
p = 0.015,
lfc = 1.5,
n_cpus = NULL,
gene_expression_threshold = 0.5,
verbose = FALSE
)A matrix of bulk data. Rows are genes, columns are samples. Row and column names must be set. TPM normalized.
Path to a .pkl file created by build_model_rectanglepy().
When NULL, single_cell_object and cell_type_annotations are required and
the signature is built internally.
A matrix with the single-cell data. Rows are genes, columns are cells. Row and column names must be set. Raw counts expected. Only used when signature is NULL.
A vector of cell type labels. Only used when signature is NULL.
Whether to correct for mRNA content bias. Default: TRUE.
Whether to optimize DE cutoffs during signature building. Only used when signature is NULL. Default: TRUE.
P-value cutoff for DE analysis. Only used when signature is NULL and optimize_cutoffs = FALSE.
Log fold-change cutoff. Only used when signature is NULL and optimize_cutoffs = FALSE.
Number of CPUs. NULL uses all available.
Gene expression threshold for DE analysis. Only used when signature is NULL. Default: 0.5.
Whether to print progress to the console. Default: FALSE.
A matrix with rows = samples and columns = cell types (including an "Unknown" column representing uncharacterized cellular content).