R/sample_level_object.R
GenerateSampleObject.RdReturns 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,
...
)Seurat object
Name of the Neighbor object to use for the calculation
(e.g. "weighted.nn" as produced by FindmmNN or
PrepareSampleObject).
the number of nearest neighbors to perform the summing
the name of the sketch.assay you used to perform the FindmmNN()
Whether to return the data as a Seurat object. Default is TRUE
Name for the new assay containing landmark counts
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')
Method for normalization. Supports LogNormalize and ChiSquared. see details at
NormalizeData and NormalizeChiSquared
Scale factor for Log-Normalization, see NormalizeData
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.
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.
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.
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).
Print progress and diagnostic messages
Arguments to be passed to methods such as CreateSeuratObject
return a Seurat object that contains a count matrix with number of landmark as rows, sample as columns