lambda_to_iqlr.Rd
Takes idea from Wu et al. (citation below) and calculates IQLR for
Lambda, potentially useful if you believe there is an invariant group of
categories (e.g., taxa / genes) that are not changing (in absolute abundance)
between samples. IQLR is defined as
$$IQLR_x = log(x_i/g(IQVF))$$
for i in 1,...,D.
IQVF are the CLR coordinates whose variance is within the inter-quantile range
(defined by probs
argument to this function).
A different IQVF is fit for each posteior sample as the IQVFs are calculted
based on posterior estimates for Lambda. The variance of a CLR coordinate
is defined as the norm of each row of Lambda[,focus.cov] (i.e.,
the covariation in Eta, explained by those covariates). This definition of
variance allows uses to exclude variation from technical / trivial sources
in calculation of IQVF/IQLR.
lambda_to_iqlr(m, focus.cov = NULL, probs = c(0.25, 0.75))
m | object of class pibblefit (e.g., output of |
---|---|
focus.cov | vector of integers or characters specifying columns (covariates) of Lambda to include in calculating IQLR (if NULL, default, then uses all covariates) |
probs | bounds for categories (i.e., features / genes / taxa) to include in calculation of iqlr (smaller bounds means more stringent inclusion criteria) |
array of dimension (D, Q, iter) where D is number of taxa, Q is number of covariates, and iter is number of posterior samples.
Primarily intended for doing differential expression analysis under assumption that only small group of categories (e.g., taxa / genes) are changing
Jia R. Wu, Jean M. Macklaim, Briana L. Genge, Gregory B. Gloor (2017) Finding the center: corrections for asymmetry in high-throughput sequencing datasets. arxiv:1704.01841v1
sim <- pibble_sim() fit <- pibble(sim$Y, sim$X) # Use first two covariates to define iqlr, just show first 5 samples lambda_to_iqlr(fit, 1:2)[,,1:5]#> , , 1 #> #> [,1] [,2] #> [1,] -0.2526887 0.84941052 #> [2,] 0.1570506 0.10193949 #> [3,] -1.3225847 -0.33077657 #> [4,] 1.3135026 0.19422006 #> [5,] -0.5293598 -3.81722177 #> [6,] 0.8657115 -2.12506239 #> [7,] 4.1831440 -2.32160396 #> [8,] 0.7095619 1.60642844 #> [9,] 4.3464215 -0.05735936 #> [10,] 0.7521329 0.47710897 #> #> , , 2 #> #> [,1] [,2] #> [1,] -0.5000054 1.00349797 #> [2,] 0.2389852 0.04772608 #> [3,] -1.4078139 -0.36376323 #> [4,] 1.0251298 0.38489201 #> [5,] -0.4478589 -3.65131617 #> [6,] 1.2380459 -2.64434333 #> [7,] 3.6272734 -2.31129903 #> [8,] 0.6697734 2.00460859 #> [9,] 3.4097164 -0.18219492 #> [10,] 0.4886820 0.54518310 #> #> , , 3 #> #> [,1] [,2] #> [1,] -1.59322254 1.2179391 #> [2,] -1.03674904 -0.7499800 #> [3,] -3.40508042 -0.1777187 #> [4,] 0.03126697 0.4362373 #> [5,] -1.98667669 -3.3456400 #> [6,] -0.09101151 -2.6954376 #> [7,] 2.32382958 -2.6800450 #> [8,] -0.43170344 1.8492513 #> [9,] 2.11593749 -0.3717528 #> [10,] -0.41981484 0.4842555 #> #> , , 4 #> #> [,1] [,2] #> [1,] -0.5744831 1.1374964 #> [2,] 0.2507041 0.1768505 #> [3,] -1.8809453 -0.4790111 #> [4,] 0.9608933 0.4004779 #> [5,] -0.3855418 -3.8521214 #> [6,] 1.9280636 -2.4630285 #> [7,] 4.0903699 -3.5096548 #> [8,] 0.5273648 1.8045431 #> [9,] 4.4543177 -0.4928108 #> [10,] 0.6348771 0.5033782 #> #> , , 5 #> #> [,1] [,2] #> [1,] -0.4632286 1.0055531 #> [2,] -0.0858738 -0.1675544 #> [3,] -1.7240460 -0.6227919 #> [4,] 0.8415315 0.5287829 #> [5,] 0.1167117 -3.8940895 #> [6,] 1.6638791 -1.6645270 #> [7,] 3.2183105 -2.4073352 #> [8,] 0.5233956 1.2817658 #> [9,] 3.8430561 -0.2137107 #> [10,] 0.7013047 0.1757229 #>