check_gaussians: Check the format of a list of Gaussians

Description Usage Arguments Details Value Examples

View source: R/check_gaussians.R

Description

Test whether an input list of Gaussians conforms to the format expected by PrInCE: that is, a named list with five fields for each entry, i.e., the number of Gaussians in the mixture model, the r^2 value, the number of iterations used by nls, the coefficients of each model, and the fitted curve.

Usage

1
2
3
4
5
6
7
check_gaussians(
  gaussians,
  proteins = NULL,
  replicate_idx = NULL,
  n_error = 3,
  pct_warning = 0.1
)

Arguments

gaussians

the list of Gaussians

proteins

the complete set of input proteins

replicate_idx

the replicate being analyzed, if input proteins are provided; used to throw more informative error messages

n_error

minimum number of proteins that can have fitted Gaussians without throwing an error

pct_warning

minimum fraction of proteins that can have fitted Gaussians without giving a warning

Details

Optionally, some extra checks will be done on the fraction of proteins in the complete dataset for which a Gaussian mixture model could be fit, if provided. In particular, the function will throw an error if fewer than n_error proteins have a fitted Gaussian, and emit a warning if fewer than pct_warning do.

Value

TRUE if all conditions are met, but throws an error if any is not

Examples

1
2

fosterlab/PrInCE documentation built on Dec. 13, 2020, 5:50 a.m.