Generate a sample-level count matrix based on landmark assay and its weighted.nn object
Source:R/sample_level_object.R
GenerateSampleObject.RdReturns summed counts of weighted.nn for each landmark cell within each sample.
Usage
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,
verbose = TRUE,
...
)Arguments
- object
Seurat object
- nn.name
Name of the Neighbor object to use for the calculation
- 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
NormalizeDataandNormalizeChiSquared- 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.
- verbose
Print progress and diagnostic messages
- ...
Arguments to be passed to methods such as
CreateSeuratObject