Translates the rownames of the input matrix into the desired ids using a translator data frame. When input ids maps to several target ids, uses the summarise function to resolve conflicts.
translateMatrix(mat, df, sourceKey, targetKey, summariseFun)
mat | Input matrix. Should have rownames. |
---|---|
df | A 2-columns translator data frame with source to target ids. |
sourceKey | Character indicating the column of the df where the source ids are stored. |
targetKey | Character indicating the column of the df where the source ids are stored. |
summariseFun | Function used to resolve multi-mapping situations. |
A matrix with translated and summarised ids.