matchesGene2Symbol: Check that user-defined gene input matches expected values

Description Usage Arguments Value Note Examples

View source: R/matchesGene2Symbol.R

Description

Check that user-defined gene input matches expected values

Usage

1
matchesGene2Symbol(x, genes, gene2symbol, .xname = getNameInParent(x))

Arguments

x

Object.

genes

character. Gene identifiers.

gene2symbol

Gene2Symbol. Gene-to-symbol mappings. Must contain geneID and geneName columns. See Gene2Symbol for more information.

.xname

Name of object defined in x. Not intended to be used directly.

Value

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

Note

Updated 2019-08-11.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
x <- S4Vectors::DataFrame(
    "sample1" = c(1L, 2L),
    "sample2" = c(3L, 4L),
    row.names = c("gene1", "gene2")
)
print(x)

g2s <- Gene2Symbol(
    object = S4Vectors::DataFrame(
        geneID = c("ENSG00000000003", "ENSG00000000005"),
        geneName = c("TSPAN6", "TNMD"),
        row.names = rownames(x)
    )
)
print(g2s)

geneIDs <- g2s[["geneID"]]
print(geneIDs)

geneNames <- g2s[["geneName"]]
print(geneNames)

matchesGene2Symbol(x = x, genes = geneIDs, gene2symbol = g2s)
matchesGene2Symbol(x = x, genes = geneNames, gene2symbol = g2s)

acidgenomics/basejump documentation built on Nov. 21, 2019, 1:36 a.m.