philrInv: Inverse of PhILR Transform

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/philr.R

Description

Inverse of PhILR Transform

Usage

1
2
philrInv(df.ilrp, tree = NULL, sbp = NULL, V = NULL,
  part.weights = NULL, ilr.weights = NULL)

Arguments

df.ilrp

transformed data to which the inverse transform will be applied

tree

(optional) to be used to build sbp and contrast matrix (see details)

sbp

(optional) the sbp (sequential binary partition) used to build a contrast matrix (see details)

V

(optional) the contrast matrix (see details)

part.weights

weightings for parts, can be a named vector with names corresponding to colnames(df). Defaults to 'uniform' (part.weights = 1,...,1)

ilr.weights

weightings for the ILR coordiantes can be a named vector with names corresponding to names of internal nodes of tree. Defaults to 'uniform' (ilr.weights = 1,...,1)

Details

This is a utility function for calculating the inverse of the philr transform. Note that at least one of the following parameters must be specified (tree, sbp, or V).

Value

a matrix of compositions (rows are samples, columns are parts), function removes the effects of ilr weights, part weights, and unshifts the composition.

Author(s)

Justin Silverman

See Also

philr

Examples

1
2
3
4
5
6
7
8
 tr <- named_rtree(5)
 df <- t(rmultinom(10,100,c(.1,.6,.2,.3,.2))) + 0.65   # add a small pseudocount
 colnames(df) <- tr$tip.label
 d <- philr(df, tr, part.weights='enorm.x.gm.counts',
                ilr.weights='blw.sqrt', return.all=TRUE)
 d.inverted <- philrInv(d$df.ilrp, V=d$V, part.weights = d$p,
                        ilr.weights = d$ilr.weights)
 all.equal(miniclo(df), d.inverted)

Example output

Building Sequential Binary Partition from Tree...
Building Contrast Matrix...
Transforming the Data...
Calculating ILR Weights...
[1] TRUE

philr documentation built on Nov. 8, 2020, 5:38 p.m.