Skip to content

Commit 07223ef

Browse files
committed
fixed error in removeOutlier function
1 parent 9577ce2 commit 07223ef

10 files changed

+38
-23
lines changed

Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ RUN install2.r --error --skipinstalled \
4343
ggpmisc \
4444
jose \
4545
R6 \
46-
patchwork
46+
patchwork \
47+
cowplot \
48+
quarto
4749

4850
USER shiny
4951
COPY ./app/ ./myapp

MTT/DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ Maintainer: <[email protected]>
88
Description: Import xml files from platereader. Calculation of LD50. Creating boxplots of raw data and the curves used for calculation of LD50.
99
License: GPL-2
1010
Imports: tidyr, ggplot2, drc, R6, quarto, openxlsx, cowplot, gridExtra
11-
RoxygenNote: 7.2.3
11+
RoxygenNote: 7.3.1
1212
Encoding: UTF-8

MTT/NAMESPACE

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
export(XML2DF)
44
export(ic50)
55
export(import)
6+
export(removeOutlier)
67
export(report_pdf)
78
export(save)
89
import(drc)

MTT/R/import.R

+7-4
Original file line numberDiff line numberDiff line change
@@ -137,16 +137,19 @@ import <- function(path, names = names_default(), conc = conc_default()) {
137137
#' @param l a list containing column indices which defines the different groups
138138
#' @param dep the column index which defines the dependent variable
139139
removeOutlier <- function(df, l, dep) {
140-
int <- sapply(seq_along(1:length(df)), function(x) {
141-
paste0(df[, l], collapse = "_")
142-
})
140+
ps <- function(a, b) {
141+
paste0(a, "_", b)
142+
}
143+
int <- Reduce(ps, as.list(df[, l]))
143144
intUnique <- unique(int)
145+
144146
dfor <- lapply(intUnique, function(x) {
145147
temp <- df[int == x, ]
146148
bs <- boxplot.stats(temp$abs)
147149
if (length(bs$out) == 0) return(temp)
148150
temp[temp$abs %in% bs$out, "abs"] <- NA
149151
return(temp)
150152
})
151-
do.call(rbind, dfor)
153+
df <- do.call(rbind, dfor)
154+
df[!is.na(df$abs), ]
152155
}

MTT/man/removeOutlier.Rd

+18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build_and_run.sh

100644100755
File mode changed.

installMTT.R

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
install.packages("/home/konrad/Documents/GitHub/RProjects/shinychem/MTT",
2+
type = "source", repos = NULL)

push2docker.sh

100644100755
+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
22

3-
docker build -t my-shiny-app .
4-
docker push konradkraemer/biostats:latest
3+
docker build -t konradkraemer/biostats:latest .
4+
docker push konradkraemer/biostats:latest
5+

run.sh

100644100755
+3-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
#/usr/bin/shiny-server
44
sudo -u shiny /usr/bin/shiny-server
55

6-
# rstudio switch to terminal alt, shift, m
7-
# rstudio run command from script in terminal: strg, alt, enter
6+
#cd /srv/shiny-server
7+
8+
#Rscript -e 'shiny::runApp(".", port = 3838)'

shinychem.Rproj

-13
This file was deleted.

0 commit comments

Comments
 (0)