idReplace: A function to convert a matrix/dataframes's genomic...

Description Usage Arguments Details Value Examples

View source: R/idReplace.R

Description

Gene ids are converted before being substituted for the original ids in the input data.

Usage

1
idReplace(input, format_in = "ensembl_gene_id", format_out = "hgnc_symbol")

Arguments

input

A matrix/dataframe. Samples as columns, genes as rows

format_in

Format/type of genomic identifiers of the input object

format_out

Format/type of genomic identifiers to be returned

Details

Provided with a matrix/dataframe of gene expression with genomic identifiers; and a biomaRt hsapiens_gene_ensembl specific set of filters and attributes (i.e. the id format of the input and output respectively); this function returns the original data object with corresponding mappings of the given replacement identifiers.

Multiple input ids mapping to a single unique output id are aggregated by mean expression.

The 'format_in' argument defaults to ensembl gene id, and the mapped 'format_out' argument defaults to hgnc symbol.

Common filters/attributes are "ensembl_gene_id", "hgnc_symbol", "entrezgene", "illumina_humanht_12_v4" and "affy_hg_u133a".

Requires biomaRt and internet access.

Value

A id-converted matrix otherwise identical to input

Examples

1
2
3
4
5
6
mtx <- matrix(rnorm(mean = 7, n = 9), ncol = 3) 
row.names(mtx) <- c("ESR1", "ERBB2", "AURKA")

idReplace(mtx,
          format_in = "hgnc_symbol",
          format_out = "entrezgene")

abc-igmm/transcripTools documentation built on May 20, 2019, 3:05 p.m.