calibrate: Calibrate a relative-abundance matrix by a bias vector

Description Usage Arguments Details See Also

View source: R/calibrate.R

Description

Calibration via the simple deterministic procedure described in McLaren, Willis, and Callahan (2019), simply involved dividing the observed vector of relative abundances by the estimated bias vector and (optionally) normalizing the result to sum to 1 or some other chosen value.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
calibrate(observed, bias, ...)

## S3 method for class 'matrix'
calibrate(observed, bias, margin, norm = "close")

## S3 method for class 'otu_table'
calibrate(observed, bias, norm = "close")

## S3 method for class 'phyloseq'
calibrate(observed, bias, norm = "close", mean_name = ".mean_efficiency")

Arguments

observed

An abundance matrix or phyloseq object containing one

bias

A numeric vector of relative efficiencies or an object of class 'mc_bias_fit' (from which efficiencies will be extracted)

margin

Matrix margin that corresponds to observations (samples); 1 for rows, 2 for columns

norm

String specifying how to normalize the calibrated observations; see Details.

mean_name

Character vector or NULL. Name of the column in the sample data in which to store the mean efficiency, or NULL to skip.

Details

Normalization options specified by norm:

If bias is named, then the names must agree with the taxa names in observed and will be used to reorder bias to match the taxa order in observed.

See Also

perturb() estimate_bias()


mikemc/metacal documentation built on Feb. 20, 2022, 1:46 a.m.