| AddMisc | R Documentation |
Adds arbitrary data to the @misc slot of a Seurat object with automatic key
conflict resolution. If the key already exists, automatically appends a numeric
suffix to ensure unique key naming (e.g., "mykey_1", "mykey_2").
AddMisc(
seurat_obj,
..., # key = value
cover = TRUE # overwrite existing data
)
seurat_obj |
A Seurat object to modify |
... |
key-value pairs to add to the |
cover |
Logical indicating whether to overwrite existing data. If (default TRUE). |
The modified Seurat object with added @misc data. The original object
structure is preserved with no other modifications.
If key doesn't exist: uses as-is
If key exists: appends the next available number (e.g., "key_1", "key_2")
If numbered keys exist (e.g., "key_2"): increments the highest number
## Not run:
# Basic usage
seurat_obj <- AddMisc(seurat_obj, "QC_stats" = qc_df)
# Auto-incrementing example
seurat_obj <- AddMisc(seurat_obj, markers = markers1)
seurat_obj <- AddMisc(seurat_obj, markers = markers2, cover=FALSE)
# Stores as "markers" and "markers_1"
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.