The single_cell_object is expected to have rownames() and colnames()
build_model(
single_cell_object,
cell_type_annotations = NULL,
method = deconvolution_methods,
batch_ids = NULL,
bulk_gene_expression = NULL,
verbose = FALSE,
cell_type_column_name = NULL,
markers = NULL,
assay_name = NULL,
...
)
A matrix with the single-cell data. Rows are genes, columns are samples. Row and column names need to be set. Alternatively a SingleCellExperiment or an AnnData object can be provided. In that case, note that cell-type labels need to be indicated either directly providing a vector (cell_type_annotations) or by indicating the column name that indicates the cell-type labels (cell_type_column_name). (Anndata: obs object, SingleCellExperiment: colData object).
A vector of the cell type annotations. Has to be in the same order as the samples in single_cell_object.
A string specifying the method. Supported methods for which a signature/model can be built are AutoGeneS, BSeq-Sc, DWLS, CIBERSORTx, MOMF, Scaden
A vector of the ids of the samples or individuals.
A matrix of bulk data. Rows are genes, columns are samples. Necessary for MOMF and Scaden, defaults to NULL. Row and column names need to be set
Whether to produce an output on the console.
Name of the column in (Anndata: obs, SingleCellExperiment: colData), that contains the cell-type labels. Is only used if no cell_type_annotations vector is provided.
Named list of cell type marker genes. This parameter is only used by BSeq-sc. The type of gene identifiers (names(markers)) must be the same as the ones used as feature/row names in the single_cell_object.
Name of the assay/layer of the single_cell_object that should be used to extract the data
Additional parameters, passed to the algorithm used
The signature matrix. Rows are genes, columns are cell types.
# More examples can be found in the unit tests at tests/testthat/test-b-buildmodel.R
data("single_cell_data_1")
data("cell_type_annotations_1")
data("batch_ids_1")
data("bulk")
single_cell_data <- single_cell_data_1[1:2000, 1:500]
cell_type_annotations <- cell_type_annotations_1[1:500]
batch_ids <- batch_ids_1[1:500]
bulk <- bulk[1:2000, ]
signature_matrix_momf <- build_model(
single_cell_data, cell_type_annotations, "momf",
bulk_gene_expression = bulk
)