symbolToR: function to *reversibly* convert HGNC gene symbols to valid R...

Description Usage Arguments Value Author(s) Examples

Description

This function reversibly converts HGNC gene symbols to valid R names by prepending "symbol.", and making the following substitutions: "-" to "hyphen", "@" to "ampersand", and "/" to "forwardslash".

Usage

1

Arguments

x

vector of HGNC symbols

Value

a vector of valid R names, of the same length as x, which can be converted to the same HGNC symbols using the rToSymbol function.

Author(s)

Levi Waldron and Markus Riester

Examples

1
2
3
4
5
6
7
library(HGNChelper)

data("hgnc.table", envir=environment())

hgnc.symbols <- as.character(na.omit(unique(hgnc.table[ ,2])))
if( !identical(all.equal(hgnc.symbols, rToSymbol(make.names(symbolToR(hgnc.symbols)))), TRUE))
     stop("HGNC mapping was not reversible.")

lwaldron/MistakenIdentities documentation built on May 21, 2019, 9 a.m.