Last chance! 50% off unlimited learning
Sale ends in
This function takes a Seurat object with gene identifiers as row names (e.g., RefSeq, Ensembl, Entrez) and converts those identifiers to gene symbols (or Ensembl Gene IDs) using the biomaRt package. The function can handle various types of gene identifiers and returns a Seurat object with updated row names.
ConvertGeneIdentifiers(
seurat_object,
id_type = "refseq",
to_id_type = "symbol"
)
A Seurat object with updated gene names (row names) based on the specified conversion.
A Seurat object. The row names of the Seurat object's data or assay slot should represent gene identifiers (e.g., RefSeq, Ensembl, or Entrez IDs).
A string specifying the type of the input gene identifiers. Options are: "refseq", "ensembl", "entrez". Default is "refseq".
A string specifying the type of output gene identifiers. Options are: "symbol", "ensembl". Default is "symbol".
# \donttest{
# Read 10X counts data from matrix.mtx, barcodes.tsv and genes.tsv
library(Seurat)
counts <- Read10X(data.dir = "../inst/extdata", gene.column = 1)
# Create Seurat object without batch correction
seurat_obj <- SeuratPreprocess(counts)
seurat_obj <- SeuratLowDim(seurat_obj)
# Convert RefSeq IDs to gene symbols
seurat_obj_converted <- ConvertGeneIdentifiers(
seurat_obj,
id_type = "refseq",
to_id_type = "symbol"
)
# }
Run the code above in your browser using DataLab