check_gaussians {PrInCE} | R Documentation

## Check the format of a list of Gaussians

### 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

    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

    data(scott_gaussians)
    check_gaussians(scott_gaussians)

[Package PrInCE version 1.3.0 Index]