Skip to content

Commit

Permalink
Changed S7::@ to S7::prop.
Browse files Browse the repository at this point in the history
  • Loading branch information
u061745 committed Apr 17, 2024
1 parent a70cb44 commit 7f57d8b
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 12 deletions.
2 changes: 1 addition & 1 deletion R/get_analytes.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
#' @examples
#' 1+1
get_analytes <- function(.intelliframe) {
S7::`@`(.intelliframe, "analytes")
S7::prop(.intelliframe, "analytes")
}
2 changes: 1 addition & 1 deletion R/get_curve_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
#' @examples
#' 1+1
get_curve_data <- function(.intelliframe) {
S7::`@`(.intelliframe, "curve_data")
S7::prop(.intelliframe, "curve_data")
}

2 changes: 1 addition & 1 deletion R/get_expected.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
#' @examples
#' 1+1
get_expected <- function(.intelliframe) {
S7::`@`(.intelliframe, "expected")
S7::prop(.intelliframe, "expected")
}
2 changes: 1 addition & 1 deletion R/get_metadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
#' @examples
#' 1+1
get_metadata <- function(.intelliframe) {
S7::`@`(.intelliframe, "metadata")
S7::prop(.intelliframe, "metadata")
}
2 changes: 1 addition & 1 deletion R/get_recovery.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
#' @examples
#' 1+1
get_recovery <- function(.intelliframe) {
S7::`@`(.intelliframe, "recovery")
S7::prop(.intelliframe, "recovery")
}
2 changes: 1 addition & 1 deletion R/get_recovery_avg.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
#' @examples
#' 1+1
get_recovery_avg <- function(.intelliframe) {
S7::`@`(.intelliframe, "recovery_avg")
S7::prop(.intelliframe, "recovery_avg")
}

2 changes: 1 addition & 1 deletion R/get_summary_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
#' @examples
#' 1+1
get_summary_data <- function(.intelliframe) {
S7::`@`(.intelliframe, "summary_data")
S7::prop(.intelliframe, "summary_data")
}
2 changes: 1 addition & 1 deletion R/get_well_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
#' @examples
#' 1+1
get_well_data <- function(.intelliframe) {
S7::`@`(.intelliframe, "well_data")
S7::prop(.intelliframe, "well_data")
}
6 changes: 3 additions & 3 deletions R/plot_curves.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ plot_curves <- function(.intelliframe, analytes = NULL, type = "individual", int
stopifnot("data argument must be an intelliframe object" = S7::S7_inherits(.intelliframe, intelliframe))

if(type == "individual") {
dat <- S7::`@`(.intelliframe, "well_data")
dat <- S7::prop(.intelliframe, "well_data")
} else if(type == "summary") {
dat <- S7::`@`(.intelliframe, "summary_data") |>
dat <- S7::prop(.intelliframe, "summary_data") |>
dplyr::rename("MFI" = "MFI_Avg", "Result" = "Result_Avg")
} else stop(paste0('Argument type should be "individual" or "summary", not "', type, '".'))

Expand All @@ -42,7 +42,7 @@ plot_curves <- function(.intelliframe, analytes = NULL, type = "individual", int
experimental_data <- dplyr::filter(dat, .data[["Type"]] != "Standard") |>
dplyr::arrange(dplyr::desc(.data[["Type"]]))

curve_data <- S7::`@`(.intelliframe, "curve_data")
curve_data <- S7::prop(.intelliframe, "curve_data")

if(!is.null(analytes)) {
curve_data <- dplyr::filter(curve_data, .data[["Analyte"]] %in% analytes)
Expand Down
1 change: 1 addition & 0 deletions R/update_curve_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ new_curve_data <- lapply(names(.fits), function(x) {
}) |> dplyr::bind_rows()

if(!.silent) {
message()
warning(
"LLoQ, MDD, and LoD may be calculated differently than in Belysa. See ?refit_curves for details.",
call. = FALSE
Expand Down
2 changes: 1 addition & 1 deletion man/update_curve_data.Rd

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

28 changes: 28 additions & 0 deletions scratch/workflow example.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# load package
# library(luminary)

# load example dataset
data(u5plex)

# display object
u5plex

# extract elements
get_well_data(u5plex) |> View()
get_summary_data(u5plex) |> View()
get_analytes(u5plex) |> View()
get_metadata(u5plex) |> View()
get_curve_data(u5plex) |> View()

# plot curves
plot_curves(u5plex)
plot_curves(u5plex, facet_scales = "free")
plot_curves(
u5plex,
interactive = TRUE,
rug = FALSE,
analytes = c("AFM", "EPCR")
)

# refit curves
refit_u5plex <- refit_curves(u5plex)

0 comments on commit 7f57d8b

Please sign in to comment.