Skip to content

Commit

Permalink
Style code (GHA)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Oct 16, 2024
1 parent 722e98f commit d3d2b5c
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion R/generate_report.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#'
#' plate <- read_luminex_data(plate_file, layout_file)
#' tmp_dir <- tempdir(check = TRUE)
#' generate_plate_report(plate, output_dir=tmp_dir, counts_lower_threshold = 40, counts_higher_threshold = 50)
#' generate_plate_report(plate, output_dir = tmp_dir, counts_lower_threshold = 40, counts_higher_threshold = 50)
#' @export
generate_plate_report <- function(plate, use_model = TRUE, filename = NULL, output_dir = "reports", counts_lower_threshold = 50, counts_higher_threshold = 70) {
message("Generating report... This will take approximately 30 seconds.")
Expand Down
2 changes: 1 addition & 1 deletion R/helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ format_dilutions <- function(dilutions, dilution_values, sample_types) {
paste(sorted_formatted_dilutions, collapse = ", ")
}


#' Convert dilution to RAU
#'
#' @param predicted_dilution (`numeric()`) A numeric value representing the predicted dilution.
Expand Down
4 changes: 2 additions & 2 deletions R/plots-standard_curve.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ plot_standard_curve_analyte <- function(plate,
) +
ggplot2::guides(color = guide_legend(title = "Plot object"))

if(!plot_legend){
if (!plot_legend) {
p <- p + ggplot2::theme(legend.position = "none")
}

Expand Down Expand Up @@ -188,7 +188,7 @@ plot_standard_curve_analyte_with_model <- function(plate,
test_samples_mfi <- plate$get_data(analyte_name, "TEST", data_type = data_type)
test_sample_estimates <- predict(model, test_samples_mfi, ...)


if (plot_test_predictions) {
p <- p + ggplot2::geom_point(
ggplot2::aes(x = .data$RAU, y = .data$MFI, color = "Test sample predictions"),
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-generate_report.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ test_that("Test generate_levey_jennings_report function", {
expect_error(generate_levey_jennings_report())
expect_no_error(generate_levey_jennings_report(list(plate)))
expect_no_error(generate_levey_jennings_report(list(plate), filename = "test_report.html"))
})
})
5 changes: 0 additions & 5 deletions tests/testthat/test-helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ test_that("Test clamp function", {
})

test_that("Test format dilution function standard case", {

dilutions <- c("1/2", "1/3", "1/4")
dilution_values <- c(0.5, 0.33, 0.25)
sample_types <- c("STANDARD CURVE", "STANDARD CURVE", "STANDARD CURVE")
Expand All @@ -59,7 +58,6 @@ test_that("Test format dilution function standard case", {
})

test_that("Test format dilution function with sample types", {

dilutions <- c("1/2", "1/3", "1/4")
dilution_values <- c(0.5, 0.33, 0.25)
sample_types <- c("STANDARD CURVE", "STANDARD CURVE", "SAMPLE")
Expand All @@ -68,7 +66,6 @@ test_that("Test format dilution function with sample types", {
})

test_that("Test format dilution function with multiple duplicates", {

dilutions <- c("1/2", "1/3", "1/4", "1/4")
dilution_values <- c(0.5, 0.33, 0.25, 0.25)
sample_types <- c("STANDARD CURVE", "STANDARD CURVE", "STANDARD CURVE", "STANDARD CURVE")
Expand All @@ -77,7 +74,6 @@ test_that("Test format dilution function with multiple duplicates", {
})

test_that("Test format dilution function with shuffled dilutions", {

dilutions <- c("1/4", "1/2", "1/3")
dilution_values <- c(0.25, 0.5, 0.33)
sample_types <- c("STANDARD CURVE", "STANDARD CURVE", "STANDARD CURVE")
Expand All @@ -86,7 +82,6 @@ test_that("Test format dilution function with shuffled dilutions", {
})

test_that("Test format dilution function with dilutions equal null", {

dilutions <- NULL
dilution_values <- c(0.25, 0.5, 0.33)
sample_types <- c("STANDARD CURVE", "STANDARD CURVE", "SAMPLE")
Expand Down
5 changes: 3 additions & 2 deletions tests/testthat/test-integration.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ test_that("Fully Parse CovidOISExPONTENT_CO.csv plate data with layout", {
test_output_path <- file.path(tmp_dir, "output.csv")
expect_no_error(
capture.output(
process_plate(plate, output_path = test_output_path),
file = NULL)
process_plate(plate, output_path = test_output_path),
file = NULL
)
)
expect_true(file.exists(test_output_path))
expect_no_error(dilutions <- read.csv(test_output_path))
Expand Down

0 comments on commit d3d2b5c

Please sign in to comment.