Skip to content

Commit

Permalink
added remove outlier fct
Browse files Browse the repository at this point in the history
  • Loading branch information
Konrad1991 committed Apr 9, 2024
1 parent f904f61 commit 9577ce2
Show file tree
Hide file tree
Showing 29 changed files with 33 additions and 2 deletions.
Empty file modified .gitignore
100755 → 100644
Empty file.
Empty file modified BiostatsGithubPage/check_ast.R
100755 → 100644
Empty file.
Empty file modified Biostats_Standalone/check_ast.R
100755 → 100644
Empty file.
Empty file modified Biostats_Standalone/run.sh
100755 → 100644
Empty file.
Empty file modified Biostats_Standalone/server.R
100755 → 100644
Empty file.
Empty file modified Biostats_Standalone/ui.R
100755 → 100644
Empty file.
Empty file modified Dockerfile
100755 → 100644
Empty file.
Empty file modified MTT/DESCRIPTION
100755 → 100644
Empty file.
Empty file modified MTT/R/Screening Report.docx
100755 → 100644
Empty file.
Empty file modified MTT/R/create_excel.R
100755 → 100644
Empty file.
Empty file modified MTT/R/create_pdf.R
100755 → 100644
Empty file.
29 changes: 28 additions & 1 deletion MTT/R/import.R
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
#'
#' @export
#' @param string is a xml file as string
#' @param names is a data.frame which defines the names of the wells. This argument is optional. The default value can be checked using names_default()
#' @param conc is a data.frame which defines the concentrations within the wells. This argument is optional. The default value can be checked using conc_default()
#' @return data.frame containg the imported data with the corresponding names and conc.
XML2DF <- function(string) {
XML2DF <- function(string, names, conc) {
pg <- xml2::as_xml_document(string)
test <- xml2::xml_child(pg, search = 4)
test <- xml2::as_list(test)
Expand All @@ -25,6 +27,11 @@ XML2DF <- function(string) {
)
row.names(df) <- NULL
df <- df[, -1]
names <- stack(names)
conc <- stack(conc)
df <- stack(df)
df <- data.frame(abs = df$values, names = names$values, conc = conc$values)
df <- df[!is.na(df[, 2]), ]
df
}

Expand Down Expand Up @@ -123,3 +130,23 @@ import <- function(path, names = names_default(), conc = conc_default()) {



#' remove outliers
#'
#' @export
#' @param df a data.frame from which the outliers should be removed
#' @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 = "_")
})
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)
}
Empty file modified MTT/data/.~reening Report.docx
100755 → 100644
Empty file.
Empty file modified MTT/data/Screening Report.docx
100755 → 100644
Empty file.
Empty file modified MTT/data/test.xlsx
100755 → 100644
Empty file.
Empty file modified MTT/data/testing/data.rds
100755 → 100644
Empty file.
Empty file modified MTT/inst/examples/references.bib
100755 → 100644
Empty file.
6 changes: 5 additions & 1 deletion MTT/man/XML2DF.Rd

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

Empty file modified app/check_ast.R
100755 → 100644
Empty file.
Empty file modified app/server.R
100755 → 100644
Empty file.
Empty file modified app/ui.R
100755 → 100644
Empty file.
Empty file modified build_and_run.sh
100755 → 100644
Empty file.
Empty file modified docu.pdf
100755 → 100644
Empty file.
Empty file modified docu.qmd
100755 → 100644
Empty file.
Empty file modified integrate_app_in_ror.docx
100755 → 100644
Empty file.
Empty file modified push2docker.sh
100755 → 100644
Empty file.
Empty file modified run.sh
100755 → 100644
Empty file.
Empty file modified test.csv
100755 → 100644
Empty file.
Empty file modified testfile.csv
100755 → 100644
Empty file.

0 comments on commit 9577ce2

Please sign in to comment.