# HG changeset patch # User ufz # Date 1728391267 0 # Node ID 8a1b524ed9d80c985def845b51fcbe587b49c0b1 # Parent 082e9d22c38d77037d81e7e01fa4c5bab8ccbdde planemo upload for repository https://github.com/bernt-matthias/mb-galaxy-tools/tools/tox_tools/baseline_calculator commit dca5f947ae4c9697ac0cfce0b313170b541124e5 diff -r 082e9d22c38d -r 8a1b524ed9d8 dose_response.R --- a/dose_response.R Mon Jun 10 11:57:52 2024 +0000 +++ b/dose_response.R Tue Oct 08 12:41:07 2024 +0000 @@ -45,10 +45,14 @@ plot.background = element_rect(fill = "white", color = NA) ) - ggsave(filename = plot_file, plot = p, device = "jpg") + jpeg(filename = plot_file) + print(p) + dev.off() } dose_response_analysis <- function(data, concentration_col, response_col, plot_file, ec_file) { + concentration_col <- colnames(data)[as.integer(concentration_col)] + response_col <- colnames(data)[as.integer(response_col)] models <- fit_models(data, concentration_col, response_col) best_model_info <- select_best_model(models) ec_values <- calculate_ec_values(best_model_info$model) @@ -59,7 +63,7 @@ EC25 = ec_values$EC25[1], EC50 = ec_values$EC50[1] ) - write.csv(ec_data, ec_file, row.names = FALSE) + write.table(ec_data, ec_file, sep = "\t", row.names = FALSE, col.names = TRUE, quote = FALSE) return(list(best_model = best_model_info$name, ec_values = ec_values)) } @@ -72,5 +76,5 @@ plot_file <- args[4] ec_file <- args[5] -data <- read.csv(data_file, header = TRUE) +data <- read.csv(data_file, header = TRUE, sep = "\t") dose_response_analysis(data, concentration_col, response_col, plot_file, ec_file) diff -r 082e9d22c38d -r 8a1b524ed9d8 dose_response.xml --- a/dose_response.xml Mon Jun 10 11:57:52 2024 +0000 +++ b/dose_response.xml Tue Oct 08 12:41:07 2024 +0000 @@ -1,8 +1,8 @@ - Toxicity prediction tool - Dose response Curve + for Toxicological Risk Assessment - 3.0_1 - 0 + 3.0.1 + 1 - + @@ -34,22 +34,27 @@ - - - - - + + + + + + + + + + 10.1371/journal.pone.0146021 diff -r 082e9d22c38d -r 8a1b524ed9d8 test-data/drc_EC_output.tsv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/drc_EC_output.tsv Tue Oct 08 12:41:07 2024 +0000 @@ -0,0 +1,2 @@ +EC10 EC25 EC50 +5.08340659604631 10.6579575265526 22.3456566952853 diff -r 082e9d22c38d -r 8a1b524ed9d8 test-data/drc_input.tsv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/drc_input.tsv Tue Oct 08 12:41:07 2024 +0000 @@ -0,0 +1,8 @@ +conc resp +0 0 +5 0.1 +10 0.3 +25 0.5 +50 0.6 +75 0.9 +100 1 diff -r 082e9d22c38d -r 8a1b524ed9d8 test-data/test_summary.csv --- a/test-data/test_summary.csv Mon Jun 10 11:57:52 2024 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -lethal,concentration -0,0 -0.1,10 -0.25,25 -0.5,50 -0.75,75 -1,100 diff -r 082e9d22c38d -r 8a1b524ed9d8 test-data/test_summary.tsv --- a/test-data/test_summary.tsv Mon Jun 10 11:57:52 2024 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -concentration lethal -0 0 -10 0.1 -25 0.2 -50 0.5 -75 0.7 -100 1