Commit 9fca979d authored by Midoux Cedric's avatar Midoux Cedric

sqrtprop

parent 0ef99d1c
......@@ -279,6 +279,7 @@ transformSample <- function() {
choices = c("None" = "none",
"Proportional Transformation" = "prop",
"Square Root Transformation" = "sqrt",
"Square Root Proportional Transformation" = "sqrtprop",
"Centered Log-Ratio (CLR) Transformation" = "clr")
),
......@@ -299,6 +300,9 @@ output$transformFun <- renderText({
"data_prop <- transform_sample_counts(data, count_to_prop)",
sep = "\n"),
"sqrt" = "data_sqrt <- transform_sample_counts(data, sqrt)",
"sqrtprop" = paste("count_to_sqrtprop <- function(x) {return(sqrt(x / sum(x)))}",
"data_sqrtprop <- transform_sample_counts(data, count_to_sqrtprop)",
sep = "\n"),
"clr" = paste("gm_mean <- function(x, na.rm=TRUE) {",
" return(exp(mean(log(x), na.rm=na.rm)))",
"}",
......@@ -327,6 +331,10 @@ observeEvent(input$transformData, {
"sqrt" = {
physeq(transform_sample_counts(physeq(), sqrt))
},
"sqrtprop" = {
count_to_sqrtprop <- function(x) {return(sqrt(x / sum(x)))}
physeq(transform_sample_counts(physeq(), count_to_sqrtprop))
},
"clr" = {
gm_mean <- function(x, na.rm=TRUE) {
return(exp(mean(log(x), na.rm=na.rm)))
......
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