`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"
)

Arguments

scmpObj

object of Class scMaSigPro. See ScMaSigPro for more details.

bin_mem_col

Column name in the Dense metadata storing information about the members of the bins. (Default is 'scmp_bin_members').

bin_col

Column name in the Dense metadata storing information about the bin labels. (Default is 'scmp_bin').

assay_name

Name of the Assay in the assay_name object from which retrieve the counts. (Default = "counts").

cluster_count_by

A character string specifying the method to use to aggregate counts within each cluster. Available options are 'mean' or 'sum'. (Default = "sum").

Value

A matrix. The matrix includes pseudo bulk counts with each row being a gene and each column being a bin.

Details

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.

Author

Priyansh Srivastava spriyansh29@gmail.com