Browse Source

Correct 'cuttofs'

master
marcelcosta 3 years ago
parent
commit
bac2a29200
1 changed files with 5 additions and 8 deletions
  1. +5
    -8
      invivos/app.R

+ 5
- 8
invivos/app.R

@ -244,8 +244,7 @@ server <- function(input, output) {
observeEvent(analysis$taula, {})
stattest<-"dunn"
oneside<-""
cutoff<-750
table<-analysis$taula
if ("ID.animal" %in% colnames(table)){table<-rename(table, "ID animal"=`ID.animal`)}
if ("ID" %in% colnames(table)){table<-rename(table, "ID animal"=ID)}
@ -339,7 +338,7 @@ server <- function(input, output) {
g<-list()
for (side in c("L","R")){
tableR<-filter(table, `ID tumor` == side) %>% filter(!is.na(Volume))
endtime<-dcast(tableR %>% filter(Volume < cutoff), Cage+`ID animal`+`ID tumor`+Group~., value.var = "Timepoint", fun.aggregate = function(x){max(as.numeric(as.character(x)))}) %>% rename("end"=".")
endtime<-dcast(tableR %>% filter(Volume < input$cutoff), Cage+`ID animal`+`ID tumor`+Group~., value.var = "Timepoint", fun.aggregate = function(x){max(as.numeric(as.character(x)))}) %>% rename("end"=".")
endtime["Dead"]<-dcast(tableR, Cage+`ID animal`+`ID tumor`+Group~., value.var = "Volume", fun.aggregate = function(x){max(as.numeric(as.character(x)))}) %>% pull(".") > input$cutoff
table_tumor<<-endtime
@ -363,7 +362,7 @@ server <- function(input, output) {
}else{
tableR<-table %>% filter(!is.na(Volume))
endtime<-dcast(tableR %>% filter(Volume < cutoff), `ID animal`+Group~., value.var = "Timepoint", fun.aggregate = function(x){max(as.numeric(as.character(x)))}) %>% rename("end"=".")
endtime<-dcast(tableR %>% filter(Volume < input$cutoff), `ID animal`+Group~., value.var = "Timepoint", fun.aggregate = function(x){max(as.numeric(as.character(x)))}) %>% rename("end"=".")
endtime["Dead"]<-dcast(tableR, `ID animal`+Group~., value.var = "Volume", fun.aggregate = function(x){max(as.numeric(as.character(x)))}) %>% pull(".") > input$cutoff
table_tumor<<-endtime
@ -381,7 +380,6 @@ server <- function(input, output) {
output$stats<-renderPrint({
stattest<-"dunn"
oneside<-""
cutoff<-750
if (!is.null(input$file_analy) & !is.null(analysis$taula_def)){
observeEvent(analysis$taula_def, {})
table<-analysis$taula_def
@ -403,7 +401,6 @@ server <- function(input, output) {
output$tab_stats<-renderTable({
stattest<-"dunn"
oneside<-""
cutoff<-750
if (!is.null(input$file_analy) & !is.null(analysis$taula_def)){
table<-analysis$taula_def
table_stats<-list()
@ -519,7 +516,7 @@ server <- function(input, output) {
count<-1
for (side in c("L","R")){
tableR<-filter(table, `ID tumor` == side) %>% filter(!is.na(Volume))
endtime<-dcast(tableR %>% filter(Volume < cutoff), Cage+`ID animal`+`ID tumor`+Group~., value.var = "Timepoint", fun.aggregate = function(x){max(as.numeric(as.character(x)))}) %>% rename("end"=".")
endtime<-dcast(tableR %>% filter(Volume < input$cutoff), Cage+`ID animal`+`ID tumor`+Group~., value.var = "Timepoint", fun.aggregate = function(x){max(as.numeric(as.character(x)))}) %>% rename("end"=".")
endtime["Dead"]<-dcast(tableR, Cage+`ID animal`+`ID tumor`+Group~., value.var = "Volume", fun.aggregate = function(x){max(as.numeric(as.character(x)))}) %>% pull(".") > input$cutoff
table_tumor<-endtime
if (input$colors != ""){
@ -540,7 +537,7 @@ server <- function(input, output) {
}else{
tableR<-table %>% filter(!is.na(Volume))
endtime<-dcast(tableR %>% filter(Volume < cutoff), `ID animal`+Group~., value.var = "Timepoint", fun.aggregate = function(x){max(as.numeric(as.character(x)))}) %>% rename("end"=".")
endtime<-dcast(tableR %>% filter(Volume < input$cutoff), `ID animal`+Group~., value.var = "Timepoint", fun.aggregate = function(x){max(as.numeric(as.character(x)))}) %>% rename("end"=".")
endtime["Dead"]<-dcast(tableR, `ID animal`+Group~., value.var = "Volume", fun.aggregate = function(x){max(as.numeric(as.character(x)))}) %>% pull(".") > input$cutoff
table_tumor<-endtime
if (input$colors != ""){

Loading…
Cancel
Save