From 2880405a518bbbca8b3b9220b14af0f6d26c8d0b Mon Sep 17 00:00:00 2001 From: Julie Laffy Date: Tue, 26 Sep 2023 16:16:30 +0300 Subject: [PATCH] unlogtpm and GGsave --- R/GGsave.R | 12 ++++++++++-- R/unlogtpm.R | 4 ++-- man/grouped_rowcenter.Rd | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/R/GGsave.R b/R/GGsave.R index 8b801d2..6622203 100644 --- a/R/GGsave.R +++ b/R/GGsave.R @@ -1,5 +1,13 @@ -GGsave = function(filename, plot = last_plot()) { +GGsave = function(filename, + plot=last_plot(), + width=dev.size()[1], + height=dev.size()[2]) { + device = 'png' if (str_detect(filename, "pdf")) device = 'pdf' - ggsave(filename = filename, plot = plot, width = dev.size()[1], height = dev.size()[2], device = device) + ggsave(filename=filename, + plot=plot, + width=width, + height=height, + device=device) } diff --git a/R/unlogtpm.R b/R/unlogtpm.R index 1c50e34..4bfc519 100644 --- a/R/unlogtpm.R +++ b/R/unlogtpm.R @@ -12,7 +12,7 @@ unlogtpm = function(m, bulk = F) { if (has_dim(m)) m = as.matrix(m) if (bulk) x = 1 else x = 10 - (2^m) * x - 1 - #x * (2^(m) - 1) + #(2^m) * x - 1 + (2^(m) - 1) * x } diff --git a/man/grouped_rowcenter.Rd b/man/grouped_rowcenter.Rd index 288bcbb..23a0736 100644 --- a/man/grouped_rowcenter.Rd +++ b/man/grouped_rowcenter.Rd @@ -17,5 +17,5 @@ grouped_rowcenter(m, groups = split_by_sample_names(colnames(m)), by = "mean") A row-centered matrix, centered within groups and with the order of cells within groups retained. The matrix has the same number of rows as and as many columns as there are cell ids in groups. } \description{ -Center matrix rows by subsets of columns + }