aIc.perturb {aIc}R Documentation

aIc.perturb calculates the perturbation invariance of distance for samples with a given correction. This compares the distances of samples of the full dataset and a the perturbed dataset. This is expected to be true if the transform is behaving rationally in compositional datasets.

Description

aIc.perturb calculates the perturbation invariance of distance for samples with a given correction. This compares the distances of samples of the full dataset and a the perturbed dataset. This is expected to be true if the transform is behaving rationally in compositional datasets.

Usage

aIc.perturb(
  data,
  norm.method = "prop",
  zero.remove = 0.95,
  zero.method = "prior",
  distance = "euclidian",
  log = FALSE,
  group = NULL
)

Arguments

data

can be any dataframe or matrix with samples by column

norm.method

can be prop, clr, RLE, TMM, TMMwsp

zero.remove

is a value. Filter data to remove features that are 0 across at least that proportion of samples: default 0.95

zero.method

can be any of NULL, prior, GBM or CZM. NULL will not impute or change 0 values, GBM (preferred) and CZM are from the zCompositions R package, and prior will simply add 0.5 to all counts.

distance

can be euclidian, bray, or jaccard. euclidian on log-ratio transformed data is the same as the Aitchison distance. default=euclidian

log

is a logical. log transform the RLE or TMM outputs, default=FALSE

group

is a vector containing group information. Required for clr, RLE, TMM, lvha, and iqlr based normalizations.

Value

Returns a list with the maximum proportional perturbation in ol (expect 0, but values up to 1 is.perturb, the table of distances for the whole and perturbaton in dist.all and dist.perturb, the histogram of the perturbations in plot, and the plot and axis labels in main xlab and ylab. .

Author(s)

Greg Gloor

Examples

data(selex)
group = c(rep('N', 7), rep('S', 7))
x <- aIc.perturb(selex, group=group, norm.method='clr', distance='euclidian', zero.method='prior')
plot(x$plot, main=x$main, ylab=x$ylab, xlab=x$xlab)

[Package aIc version 1.0 Index]