Do the input gene names match unique values in the corresponding object?
Source:R/check-scalar-matchesUniqueGeneNames.R
check-scalar-matchesUniqueGeneNames.Rd
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.
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