RenameGenesSeurat | R Documentation |
This function replaces gene names across various slots within a specified assay
of a Seurat object. It is designed to be run prior to any data integration or downstream analysis
processes. The function targets the @counts
, @data
, and @meta.features
slots within
the specified assay, ensuring consistency in gene nomenclature across the object.
RenameGenesSeurat(
obj = ls.Seurat[[i]],
newnames = HGNC.updated[[i]]$Suggested.Symbol,
assay = "RNA",
slots = c("data", "counts", "meta.features")
)
obj |
A Seurat object containing the assay and slots to be updated. Default: |
newnames |
A character vector containing the new gene names intended to replace the
existing ones. Default: |
assay |
The name of the assay within the Seurat object where gene names will be updated;
Default: |
slots |
A character vector specifying which slots within the assay to update. Possible
values include |
It is crucial to run this function before any data integration or further analysis to ensure gene symbol consistency. The function does not support complex objects with multiple assays where dependencies between assays might lead to inconsistencies. Use with caution and verify the results.
This function modifies the Seurat object in place, changing gene symbols directly within the specified slots. Be sure to have a backup of your Seurat object if needed before applying this function.
## Not run:
if (interactive()) {
# Assuming `SeuratObj` is your Seurat object
# and `HGNC.updated.genes` contains the updated gene symbols
SeuratObj <- RenameGenesSeurat(
obj = SeuratObj,
newnames = HGNC.updated.genes$Suggested.Symbol
)
# `SeuratObj` now has updated gene symbols in the specified assay and slots
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.