From f785b87fa9cf06e1e3e0f8871e296a1ef9c3ea3f Mon Sep 17 00:00:00 2001 From: Jeff Kimbrel Date: Fri, 29 Sep 2023 10:53:40 -0700 Subject: [PATCH] more pkgdown updates --- NAMESPACE | 4 +++ R/{internal => }/abundance_validation.R | 1 - .../gradient_pos_density_validation.R | 1 - .../gradient_position_validation.R | 1 - R/{internal => }/isotope_validation.R | 2 -- _pkgdown.yml | 5 +++- man/abundance_validation.Rd | 29 +++++++++++++++++++ man/gradient_pos_density_validation.Rd | 21 ++++++++++++++ man/gradient_position_validation.Rd | 19 ++++++++++++ man/isotope_validation.Rd | 25 ++++++++++++++++ 10 files changed, 102 insertions(+), 6 deletions(-) rename R/{internal => }/abundance_validation.R (98%) rename R/{internal => }/gradient_pos_density_validation.R (97%) rename R/{internal => }/gradient_position_validation.R (97%) rename R/{internal => }/isotope_validation.R (96%) create mode 100644 man/abundance_validation.Rd create mode 100644 man/gradient_pos_density_validation.Rd create mode 100644 man/gradient_position_validation.Rd create mode 100644 man/isotope_validation.Rd diff --git a/NAMESPACE b/NAMESPACE index 3452316c..f5e75ae4 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,9 +1,13 @@ # Generated by roxygen2: do not edit by hand +export(abundance_validation) export(add_gradient_pos_rel_amt) export(add_isotopolog_label) export(add_taxonomy) export(get_sample_counts) +export(gradient_pos_density_validation) +export(gradient_position_validation) +export(isotope_validation) export(plot_sample_curves) export(qsip_feature_data) export(qsip_sample_data) diff --git a/R/internal/abundance_validation.R b/R/abundance_validation.R similarity index 98% rename from R/internal/abundance_validation.R rename to R/abundance_validation.R index a5c67061..f9139732 100644 --- a/R/internal/abundance_validation.R +++ b/R/abundance_validation.R @@ -17,7 +17,6 @@ #' @return Returns `NULL` if the values are valid, or a printed error #' #' @export -#' @keywords internal abundance_validation = function(data, id) { diff --git a/R/internal/gradient_pos_density_validation.R b/R/gradient_pos_density_validation.R similarity index 97% rename from R/internal/gradient_pos_density_validation.R rename to R/gradient_pos_density_validation.R index 9d85af09..8c8bc87d 100644 --- a/R/internal/gradient_pos_density_validation.R +++ b/R/gradient_pos_density_validation.R @@ -7,7 +7,6 @@ #' @return Returns `NULL` if the density values are valid, or a printed error #' #' @export -#' @keywords internal gradient_pos_density_validation = function(gradient_pos_density, low = 1.55, high = 1.8) { diff --git a/R/internal/gradient_position_validation.R b/R/gradient_position_validation.R similarity index 97% rename from R/internal/gradient_position_validation.R rename to R/gradient_position_validation.R index 126a0e99..563bee8b 100644 --- a/R/internal/gradient_position_validation.R +++ b/R/gradient_position_validation.R @@ -10,7 +10,6 @@ #' #' @export #' -#' @keywords internal gradient_position_validation = function(gradient_position) { if (is.numeric(gradient_position)) { diff --git a/R/internal/isotope_validation.R b/R/isotope_validation.R similarity index 96% rename from R/internal/isotope_validation.R rename to R/isotope_validation.R index 41bf5ebf..c861b702 100644 --- a/R/internal/isotope_validation.R +++ b/R/isotope_validation.R @@ -5,8 +5,6 @@ #' #' @return Returns `NULL` if the isotope strings are valid, or a printed error #' -#' @keywords internal -#' #' @export #' #' @note The isotope_list may change if isotopolog_label stays a thing. Only the "heavy" isotopes will be allowed. diff --git a/_pkgdown.yml b/_pkgdown.yml index dff911fc..db0332fb 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -20,7 +20,10 @@ reference: - has_keyword("data") - title: internal contents: - - has_keyword("internal") + - abundance_validation + - gradient_pos_density_validation + - gradient_position_validation + - isotope_validation articles: - title: Learn qSIP diff --git a/man/abundance_validation.Rd b/man/abundance_validation.Rd new file mode 100644 index 00000000..26356b40 --- /dev/null +++ b/man/abundance_validation.Rd @@ -0,0 +1,29 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/abundance_validation.R +\name{abundance_validation} +\alias{abundance_validation} +\title{Check the validity of an abundance table} +\usage{ +abundance_validation(data, id) +} +\arguments{ +\item{data}{ASV/OTU table (dataframe)} + +\item{id}{Column name with taxa IDs (string)} +} +\value{ +Returns \code{NULL} if the values are valid, or a printed error +} +\description{ +This validation function will check the validity of an abundance table. It +can run standalone, but was written to be run when creating a qSIP2 abundance +table object. Therefore, a valid run of this function will return NULL rather +than a value. +} +\details{ +Rows should contain the unique taxa ids with a column designated with the id +argument. Each other column name should be a unique sample name. + +Validity checking includes making sure all data is numeric (except for the +taxa IDs), all numbers are integers, and no numbers are negative. +} diff --git a/man/gradient_pos_density_validation.Rd b/man/gradient_pos_density_validation.Rd new file mode 100644 index 00000000..26fa50a9 --- /dev/null +++ b/man/gradient_pos_density_validation.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/gradient_pos_density_validation.R +\name{gradient_pos_density_validation} +\alias{gradient_pos_density_validation} +\title{Check the validity of density values} +\usage{ +gradient_pos_density_validation(gradient_pos_density, low = 1.55, high = 1.8) +} +\arguments{ +\item{gradient_pos_density}{Density value or values (string(s))} + +\item{low}{A low limit for valid density values (numeric, default: 1.55)} + +\item{high}{A high limit for valid density values (numeric, default: 1.8)} +} +\value{ +Returns \code{NULL} if the density values are valid, or a printed error +} +\description{ +Check the validity of density values +} diff --git a/man/gradient_position_validation.Rd b/man/gradient_position_validation.Rd new file mode 100644 index 00000000..c1476499 --- /dev/null +++ b/man/gradient_position_validation.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/gradient_position_validation.R +\name{gradient_position_validation} +\alias{gradient_position_validation} +\title{Check the validity of gradient position values} +\usage{ +gradient_position_validation(gradient_position) +} +\arguments{ +\item{gradient_position}{Gradient position value or values (string(s))} +} +\value{ +Returns \code{NULL} if the gradient position values are valid, or a +printed error +} +\description{ +Valid gradient positions are integers. The value can be \code{-1} to represent +"bulk" or non-qSIP samples. +} diff --git a/man/isotope_validation.Rd b/man/isotope_validation.Rd new file mode 100644 index 00000000..9c72f367 --- /dev/null +++ b/man/isotope_validation.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/isotope_validation.R +\name{isotope_validation} +\alias{isotope_validation} +\title{Check the validity of an isotope string} +\usage{ +isotope_validation( + isotope, + isotope_list = c("12C", "13C", "14N", "15N", "16O", "18O") +) +} +\arguments{ +\item{isotope}{Isotope value or values (string(s))} + +\item{isotope_list}{Isotopes to check against (strings, default: c("12C", "13C", "14N", "15N", "16O", "18O"))} +} +\value{ +Returns \code{NULL} if the isotope strings are valid, or a printed error +} +\description{ +Check the validity of an isotope string +} +\note{ +The isotope_list may change if isotopolog_label stays a thing. Only the "heavy" isotopes will be allowed. +}