RemoveGenesSeurat: Remove Specific Genes from a Seurat Object

View source: R/Seurat.Utils.R

RemoveGenesSeuratR Documentation

Remove Specific Genes from a Seurat Object

Description

Removes specified genes from the metadata, counts, data, and scale.data slots of a Seurat object. This operation is typically performed prior to data integration to ensure that gene sets are consistent across multiple datasets. The function modifies the Seurat object in place.

Usage

RemoveGenesSeurat(obj = ls.Seurat[[i]], symbols2remove = c("TOP2A"))

Arguments

obj

A Seurat object. Default: ls.Seurat[[i]] (please ensure to replace i with the actual index or variable).

symbols2remove

A character vector specifying the genes to be removed from the Seurat object; Default: c("TOP2A").

Details

This function directly modifies the ⁠@counts⁠, ⁠@data⁠, and ⁠@scale.data⁠ slots within the RNA assay of the provided Seurat object, as well as the ⁠@meta.data⁠ slot. It's important to run this function as one of the initial steps after creating the Seurat object and before proceeding with downstream analyses or integration processes.

Value

A Seurat object with the specified genes removed from the mentioned slots.

Examples

## Not run: 
if (interactive()) {
  # Assuming `SeuratObj` is your Seurat object and you want to remove the gene "TOP2A"
  updatedSeuratObj <- RemoveGenesSeurat(obj = SeuratObj, symbols2remove = "TOP2A")
  # Now `updatedSeuratObj` does not contain "TOP2A" in the specified slots
}

## End(Not run)


vertesy/Seurat.utils documentation built on Dec. 4, 2024, 5:20 p.m.