Skip to content

Commit

Permalink
documentation and is_qsip_filtered function
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffkimbrel committed Sep 19, 2024
1 parent 048a3bd commit fad2300
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export(get_source_mat_ids)
export(infer_source_data)
export(is_qsip_data)
export(is_qsip_data_list)
export(is_qsip_filtered)
export(multi_qsip_wrapper)
export(multi_qsip_wrapper_launcher)
export(n_resamples)
Expand Down
27 changes: 27 additions & 0 deletions R/is_qsip.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ is_qsip_data = function(object, error = FALSE) {
#' Validate a multi-qsip list object
#'
#' @param qsip_list A list of qsip_data objects
#' @param error If TRUE it stops with an error message. If FALSE it doesn't error, but returns FALSE
#'
#' @export

Expand All @@ -54,3 +55,29 @@ is_qsip_data_list <- function(object, error = FALSE) {
}
}
}




#' Validate a qsip object has been filtered
#'
#' @param object The object to check if it is a filtered qsip_data object
#' @param error If TRUE it stops with an error message. If FALSE it doesn't error, but returns FALSE
#'
#' @export

is_qsip_filtered <- function(object, error = FALSE) {
if (!is_qsip_data(object)) {
stop("qsip_data_object should be class <qsip_data>", call. = FALSE)
}

if (length(object@filtered_wad_data) == 0) {
if (isFALSE(error)) {
return(FALSE)
} else {
stop(glue::glue("qsip_data_object is a non-filtered <qsip_data> object"), call. = FALSE)
}
} else {
return(TRUE)
}
}
1 change: 1 addition & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ reference:
- show_unshared_ids
- is_qsip_data
- is_qsip_data_list
- is_qsip_filtered

- title: Plots and Visualizations
contents:
Expand Down
2 changes: 2 additions & 0 deletions man/is_qsip_data_list.Rd

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

16 changes: 16 additions & 0 deletions man/is_qsip_filtered.Rd

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

0 comments on commit fad2300

Please sign in to comment.