Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Midoux Cedric
easy16S
Commits
9fca979d
Commit
9fca979d
authored
May 28, 2020
by
Midoux Cedric
Browse files
sqrtprop
parent
0ef99d1c
Changes
1
Hide whitespace changes
Inline
Side-by-side
panels/dataInput.R
View file @
9fca979d
...
...
@@ -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
)))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment