Skip to content

Commit

Permalink
replace "silent" argument with "quiet"
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffkimbrel committed Dec 20, 2024
1 parent 5a9d589 commit d19ce8e
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 21 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: qSIP2
Title: qSIP Analysis
Version: 0.18.4
Version: 0.18.4.9000
Authors@R:
person("Jeff", "Kimbrel", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-7213-9392"))
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Object type checks more consistent
* Updated `plot_sample_curves()` to have better options
* Added `correct_gradient_pos_density()` to adjust WAD values of sample data based on the gradient position
* Replace the *silent* argument with `get_all_by_isotope()` with *quiet* to fit better with other functions

# qSIP2 0.17

Expand Down
14 changes: 11 additions & 3 deletions R/get_all_by_isotope.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,21 @@
#'
#' @param qsip_data_object (*qsip_data or qsip_source_data*) A qsip object with source data
#' @param isotopes (*string(s)*) Isotopes used to pull source_mat_ids. Can be a standard isotope name (e.g. `12C`) or special terms `labeled` or `unlabeled`
#' @param silent (*boolean*) If `TRUE`, suppresses messages about missing isotope hits and doesn't fail
#' @param quiet (*boolean*) If `TRUE`, suppresses messages about missing isotope hits and doesn't fail
#'
#' @returns A vector of source_mat_ids. It may also print some messages.
#'
#' @export

get_all_by_isotope <- function(qsip_data_object, isotopes, silent = FALSE) {
get_all_by_isotope <- function(qsip_data_object,
isotopes,
quiet = FALSE,
silent = lifecycle::deprecated()) {

if (lifecycle::is_present(silent)) {
lifecycle::deprecate_warn("0.18.4.9000", "get_all_by_isotope(silent)")
}

if (inherits(qsip_data_object, qsip_data)) {
source_data <- qsip_data_object@source_data@data
} else if (inherits(qsip_data_object, qsip_source_data)) {
Expand Down Expand Up @@ -36,7 +44,7 @@ get_all_by_isotope <- function(qsip_data_object, isotopes, silent = FALSE) {
dplyr::select(source_mat_id, isotope)

# error if no source_mat_ids are found that match the criteria
if (isFALSE(silent)) {
if (isFALSE(quiet)) {

if (nrow(source_mat_ids) == 0) {
i <- paste(isotopes, collapse = ", ")
Expand Down
14 changes: 7 additions & 7 deletions R/plot_resampling_convergence.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ plot_resampling_convergence = function(qsip_data_object) {
)

dplyr::bind_rows(k) |>
ggplot(aes(x = unlabeled_resamples, y = mean_resampled_EAF)) +
geom_point() +
facet_wrap(~feature_id, scales = "free_y") +
scale_x_log10() +
geom_smooth(color = "#037bcf",
ggplot2::ggplot(ggplot2::aes(x = unlabeled_resamples, y = mean_resampled_EAF)) +
ggplot2::geom_point() +
ggplot2::facet_wrap(~feature_id, scales = "free_y") +
ggplot2::scale_x_log10() +
ggplot2::geom_smooth(color = "#037bcf",
formula = 'y ~ x',
method = 'loess') +
#geom_errorbar(aes(ymin = lower, ymax = upper), width = 0.1) +
geom_hline(aes(yintercept = observed_EAF), color = "red") +
geom_boxplot(aes(group = unlabeled_resamples))
ggplot2::geom_hline(aes(yintercept = observed_EAF), color = "red") +
ggplot2::geom_boxplot(ggplot2::aes(group = unlabeled_resamples))
}
16 changes: 8 additions & 8 deletions R/run_comparison_groups.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ run_comparison_groups <- function(groups,
groups = groups |>
dplyr::mutate(unlabeled = dplyr::case_match(
unlabeled,
"unlabeled" ~ paste(get_all_by_isotope(qsip_data_object, "unlabeled", silent = TRUE), collapse = ","),
"12C" ~ paste(get_all_by_isotope(qsip_data_object, "12C", silent = TRUE), collapse = ","),
"14N" ~ paste(get_all_by_isotope(qsip_data_object, "14N", silent = TRUE), collapse = ","),
"16O" ~ paste(get_all_by_isotope(qsip_data_object, "16O", silent = TRUE), collapse = ","),
"unlabeled" ~ paste(get_all_by_isotope(qsip_data_object, "unlabeled", quiet = TRUE), collapse = ","),
"12C" ~ paste(get_all_by_isotope(qsip_data_object, "12C", quiet = TRUE), collapse = ","),
"14N" ~ paste(get_all_by_isotope(qsip_data_object, "14N", quiet = TRUE), collapse = ","),
"16O" ~ paste(get_all_by_isotope(qsip_data_object, "16O", quiet = TRUE), collapse = ","),
.default = unlabeled
)) |>
dplyr::mutate(labeled = dplyr::case_match(
labeled,
"labeled" ~ paste(get_all_by_isotope(qsip_data_object, "labeled", silent = TRUE), collapse = ","),
"13C" ~ paste(get_all_by_isotope(qsip_data_object, "13C", silent = TRUE), collapse = ","),
"15N" ~ paste(get_all_by_isotope(qsip_data_object, "15N", silent = TRUE), collapse = ","),
"18O" ~ paste(get_all_by_isotope(qsip_data_object, "18O", silent = TRUE), collapse = ","),
"labeled" ~ paste(get_all_by_isotope(qsip_data_object, "labeled", quiet = TRUE), collapse = ","),
"13C" ~ paste(get_all_by_isotope(qsip_data_object, "13C", quiet = TRUE), collapse = ","),
"15N" ~ paste(get_all_by_isotope(qsip_data_object, "15N", quiet = TRUE), collapse = ","),
"18O" ~ paste(get_all_by_isotope(qsip_data_object, "18O", quiet = TRUE), collapse = ","),
.default = labeled
))

Expand Down
9 changes: 7 additions & 2 deletions man/get_all_by_isotope.Rd

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

1 change: 1 addition & 0 deletions qSIP2.Rproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Version: 1.0
ProjectId: 84eb367f-bac8-4c00-a392-89c277624d1a

RestoreWorkspace: No
SaveWorkspace: No
Expand Down

0 comments on commit d19ce8e

Please sign in to comment.