Skip to contents

This assert check determines if a user-defined gene name query is using only unique (non-amgibuous) symbols. It is designed to be used for gene plotting particularly when performing single-cell RNA-seq marker analysis.

Usage

matchesUniqueGeneNames(x, genes)

Arguments

x

Object.

genes

character. Gene identifiers.

Value

TRUE on success; FALSE on failure, with cause set.

Note

Updated 2022-10-18.

Examples

x <- SummarizedExperiment::SummarizedExperiment(
    assays = matrix(
        data = seq_len(16L),
        nrow = 4L,
        ncol = 4L,
        dimnames = list(
            paste0("gene", seq_len(4L)),
            paste0("sample", seq_len(4L))
        )
    ),
    rowData = S4Vectors::DataFrame(
        "geneId" = paste0("ENSG0000000000", seq_len(4L)),
        "geneName" = paste0("SYMBOL", seq_len(4L))
    )
)
genes <- SummarizedExperiment::rowData(x)$geneName

## TRUE ====
matchesUniqueGeneNames(x = x, genes = genes)
#> [1] TRUE