View source: R/data_formatting.R
format_ids | R Documentation |
This function converts the gene IDs from given input and aggregates IDs if necessary for unique ID output (e.g multiple transcripts to a gene).
format_ids(X, IDs, from = 1, to = 2, aggr.fun = mean, verbose = TRUE)
X |
the sample gene expression matrix with genes as rows and individuals as columns |
IDs |
A dataframe holding current IDs for |
from, to |
defaults to 1 and 2 ; columns of |
aggr.fun |
the function used for |
verbose |
if TRUE (default), prints number of genes kept and aggregated |
a gene expression matrix, with new IDs as rownames
# make dummy data
ids <- data.frame(id.a = paste0('a', 1:10), id.b = paste0('b', 1:10), stringsAsFactors = FALSE)
X <- matrix(rnorm(50), ncol = 5)
rownames(X) <- ids$id.a
# format ids
format_ids(X, ids, from = "id.a", to = "id.b")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.