This function projects a query singleCellExperiment object onto the PCA space of a reference singleCellExperiment object. The PCA analysis on the reference data is assumed to be pre-computed and stored within the object.
projectPCA(
query_data,
reference_data,
query_cell_type_col,
ref_cell_type_col,
pc_subset = 1:10,
assay_name = "logcounts"
)
A SingleCellExperiment
object containing numeric expression matrix
for the query cells.
A SingleCellExperiment
object containing numeric expression matrix
for the reference cells.
character. The column name in the colData
of query_data
that identifies the cell types.
character. The column name in the colData
of reference_data
that identifies the cell types.
A numeric vector specifying the subset of principal components (PCs) to compare. Default is 1:10.
Name of the assay on which to perform computations. Defaults to "logcounts"
.
A data.frame
containing the projected data in rows (reference and query data combined).
This function assumes that the "PCA" element exists within the reducedDims
of the reference data
(obtained using reducedDim(reference_data)
) and that the genes used for PCA are present in both
the reference and query data. It performs centering and scaling of the query data based on the reference
data before projection.