`pb_counts()` creates a dataframe of pseudo bulk counts from single cell counts. It does this by either taking the mean or sum of counts across cells in each bin, depending on the specified method.
pb_counts(
scmpObj,
bin_mem_col = scmpObj@Parameters@bin_mem_col,
bin_col = scmpObj@Parameters@bin_col,
assay_name = "counts",
cluster_count_by = "sum"
)
object of Class scMaSigPro. See ScMaSigPro
for more details.
Column name in the Dense metadata storing information about the members of the bins. (Default is 'scmp_bin_members').
Column name in the Dense metadata storing information about the bin labels. (Default is 'scmp_bin').
Name of the Assay in the assay_name object from which retrieve the counts. (Default = "counts").
A character string specifying the method to use to aggregate counts within each cluster. Available options are 'mean' or 'sum'. (Default = "sum").
A matrix. The matrix includes pseudo bulk counts with each row being a gene and each column being a bin.
The function operates by iterating over each row of the pseudo_bulk_profile. For each bin, it identifies the cells that belong to the bin and selects their counts from the counts data frame. It then calculates the mean or sum of these counts (depending on the specified method), and adds these to a new data frame of pseudo bulk counts. The result is a pseudo bulk counts data frame where each row is a gene and each column is a bin.