philrInv: Inverse of PhILR Transform

View source: R/philr.R

philrInvR Documentation

Inverse of PhILR Transform

Description

Inverse of PhILR Transform

Usage

philrInv(
  x.ilrp,
  tree = NULL,
  sbp = NULL,
  V = NULL,
  part.weights = NULL,
  ilr.weights = NULL
)

Arguments

x.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(x). 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

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

jsilve24/philr documentation built on April 20, 2023, 12:43 p.m.