Returns summed counts of weighted.nn for each landmark cell within each sample.

GenerateSampleObject(
  object,
  nn.name = NULL,
  k.nn = 5,
  sketch.assay = "LANDMARK",
  return.seurat = TRUE,
  new_assay_name = "LMC",
  group.by = "ident",
  normalization.method = "ChiSquared",
  scale.factor = 10000,
  rename.group.by = NULL,
  add.meta.data = TRUE,
  remove.sketch.cell.from.col = TRUE,
  cells.use = NULL,
  verbose = TRUE,
  ...
)

Arguments

object

Seurat object

nn.name

Name of the Neighbor object to use for the calculation (e.g. "weighted.nn" as produced by FindmmNN or PrepareSampleObject).

k.nn

the number of nearest neighbors to perform the summing

sketch.assay

the name of the sketch.assay you used to perform the FindmmNN()

return.seurat

Whether to return the data as a Seurat object. Default is TRUE

new_assay_name

Name for the new assay containing landmark counts

group.by

Category (or vector of categories) for grouping (e.g, Donor ID); 'ident' by default To use multiple categories, specify a vector, such as c('batch', 'replicate')

normalization.method

Method for normalization. Supports LogNormalize and ChiSquared. see details at NormalizeData and NormalizeChiSquared

scale.factor

Scale factor for Log-Normalization, see NormalizeData

rename.group.by

if rename.group.by is NULL, the rownames of the landmark matrix will used the original cell IDs. But, user can indicate which meta-data column to use to rename the rows. A suffix of "_LM" + order number will be added automatically.

add.meta.data

if TRUE, the function will automatically detect sample-level meta-data (based on 'group.by') and append it to the sample-level object; if FALSE, it will not do so.

remove.sketch.cell.from.col

if TRUE, the function will detect if the columns of the NN object and remove the cells that have been used as the landmark cells.

cells.use

An optional character vector of cell names to subset before building the sample-level matrix. When non-NULL, only cells in this vector (that are also present in the NN object) are retained. Default is NULL (use all cells).

verbose

Print progress and diagnostic messages

...

Arguments to be passed to methods such as CreateSeuratObject

Value

return a Seurat object that contains a count matrix with number of landmark as rows, sample as columns