check.genes: Check if Gene Names exist in Seurat Object or HGNC Database

View source: R/Seurat.Utils.R

check.genesR Documentation

Check if Gene Names exist in Seurat Object or HGNC Database

Description

Verifies the presence of specified gene names within a Seurat object or queries them against the HGNC database. This function is useful for ensuring gene names are correctly formatted and exist within the dataset or are recognized gene symbols.

Usage

check.genes(
  genes,
  makeuppercase = FALSE,
  HGNC.lookup = FALSE,
  obj,
  assay.slot = c("RNA", "integrated")[1],
  data.slot = c("counts", "data")[2],
  verbose = TRUE,
  ...
)

Arguments

genes

A vector of gene names to be checked.

makeuppercase

If TRUE, converts all gene names to uppercase before checking. Default: FALSE.

HGNC.lookup

If TRUE, attempts to look up any missing genes in the HGNC database to verify their existence. Default: FALSE.

obj

The Seurat object against which the gene names will be checked.

assay.slot

Assay slot of the Seurat object to check for gene names. Default: 'RNA'.

data.slot

Data slot of the assay to check for gene names. Default: 'data'.

verbose

If TRUE, prints information about any missing genes. Default: TRUE.

See Also

GetAssayData, qHGNC

Examples

## Not run: 
if (interactive()) {
  # Check for the presence of a gene name in uppercase
  check.genes(genes = "top2a", makeuppercase = TRUE, obj = combined.obj)

  # Check for a gene name with verbose output and HGNC lookup
  check.genes(genes = "VGLUT2", verbose = TRUE, HGNC.lookup = TRUE, obj = combined.obj)
}

## End(Not run)


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