Commit 4f2e78ef authored by Holger Brandl's avatar Holger Brandl

added `as_int_matrix` and `expr_matrix_to_df` to diffex commons

parent b64a4f61
......@@ -42,6 +42,14 @@ filter_expressed_genes <- function(df, id_col="ensembl_gene_id", ...){
}
as_int_matrix = function(x) apply (x, c(1, 2), function (x) { (as.integer(x))})
expr_matrix_to_df = function(m, id="gene_id"){
m %>% as_df %>% tbl_df %>% rownames_to_column(id) %>% gather(replicate, expression, -one_of(id))
}
###
### Biomart Utils
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment