Skip to content

Commit

Permalink
fixed error in removeOutlier function
Browse files Browse the repository at this point in the history
  • Loading branch information
Konrad1991 committed Apr 22, 2024
1 parent 9577ce2 commit 07223ef
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 23 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ RUN install2.r --error --skipinstalled \
ggpmisc \
jose \
R6 \
patchwork
patchwork \
cowplot \
quarto

USER shiny
COPY ./app/ ./myapp
Expand Down
2 changes: 1 addition & 1 deletion MTT/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ Maintainer: <[email protected]>
Description: Import xml files from platereader. Calculation of LD50. Creating boxplots of raw data and the curves used for calculation of LD50.
License: GPL-2
Imports: tidyr, ggplot2, drc, R6, quarto, openxlsx, cowplot, gridExtra
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
Encoding: UTF-8
1 change: 1 addition & 0 deletions MTT/NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
export(XML2DF)
export(ic50)
export(import)
export(removeOutlier)
export(report_pdf)
export(save)
import(drc)
Expand Down
11 changes: 7 additions & 4 deletions MTT/R/import.R
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,19 @@ import <- function(path, names = names_default(), conc = conc_default()) {
#' @param l a list containing column indices which defines the different groups
#' @param dep the column index which defines the dependent variable
removeOutlier <- function(df, l, dep) {
int <- sapply(seq_along(1:length(df)), function(x) {
paste0(df[, l], collapse = "_")
})
ps <- function(a, b) {
paste0(a, "_", b)
}
int <- Reduce(ps, as.list(df[, l]))
intUnique <- unique(int)

dfor <- lapply(intUnique, function(x) {
temp <- df[int == x, ]
bs <- boxplot.stats(temp$abs)
if (length(bs$out) == 0) return(temp)
temp[temp$abs %in% bs$out, "abs"] <- NA
return(temp)
})
do.call(rbind, dfor)
df <- do.call(rbind, dfor)
df[!is.na(df$abs), ]
}
18 changes: 18 additions & 0 deletions MTT/man/removeOutlier.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file modified build_and_run.sh
100644 → 100755
Empty file.
2 changes: 2 additions & 0 deletions installMTT.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
install.packages("/home/konrad/Documents/GitHub/RProjects/shinychem/MTT",
type = "source", repos = NULL)
5 changes: 3 additions & 2 deletions push2docker.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash

docker build -t my-shiny-app .
docker push konradkraemer/biostats:latest
docker build -t konradkraemer/biostats:latest .
docker push konradkraemer/biostats:latest

5 changes: 3 additions & 2 deletions run.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
#/usr/bin/shiny-server
sudo -u shiny /usr/bin/shiny-server

# rstudio switch to terminal alt, shift, m
# rstudio run command from script in terminal: strg, alt, enter
#cd /srv/shiny-server

#Rscript -e 'shiny::runApp(".", port = 3838)'
13 changes: 0 additions & 13 deletions shinychem.Rproj

This file was deleted.

0 comments on commit 07223ef

Please sign in to comment.