Clean an expression matrix and collapse duplicated gene columns
Source:R/expression.R
clean_expression.RdPrepares a gene expression matrix for downstream analysis: drops unnamed
and empty columns, expands columns with " /// " multi-mappings, maps
gene identifiers when requested, and keeps the column with the largest
median absolute deviation when several columns map to the same gene.
Arguments
- expression
Numeric matrix or data frame with samples in rows and gene identifiers in columns.
- id_from
Optional identifier type of the column names, for example
"ENTREZID". When supplied, identifiers are translated toid_towith org.Hs.eg.db::org.Hs.eg.db, which must be installed.- id_to
Target identifier type used when
id_fromis supplied.