PERFect_perm_reorder: Permutation PERFect filtering for microbiome data

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

View source: R/PERFect_perm_reorder.R

Description

This function filters the provided OTU table X at a test level alpha given a fitted object perfect_perm obtained by running PERFect_perm() function. PERFect_perm_reorder() reavaluates taxa significance p-values for a different taxa ordering.

Usage

1
2
3
PERFect_perm_reorder(X, Order = "NP", Order.user = NULL, res_perm, normalize = "counts",
    center = FALSE, alpha = 0.1, distr = "sn", rollmean = TRUE, direction = "left",
    pvals_sim = NULL)

Arguments

X

OTU table, where taxa are columns and samples are rows of the table. It should be a in data frame format with columns corresponding to taxa names.

Order

Taxa ordering. The default ordering is the number of occurrences (NP) of the taxa in all samples. Other types of order are p-value ordering, number of connected taxa and weighted number of connected taxa, denoted as "pvals", "NC", "NCw" respectively. More details about taxa ordering are described in Smirnova et al. User can also specify their preference order with Order.user.

Order.user

User's taxa ordering. This argument takes a character vector of ordered taxa names.

res_perm

Output of PERFect_perm() function.

normalize

Normalizing taxa count. The default option does not normalize taxa count, but user can convert the OTU table into a proportion table using the option "prop" or convert it into a presence/absence table using "pres".

center

Centering OTU table. The default option does not center the OTU table.

alpha

Test level alpha, set to 0.1 by default.

distr

The type of distribution used in PERFect_perm() function to obtain res_perm object.

"sn"

Skew-Normal distribution with 3 parameters: location xi, scale omega^2 and shape alpha

"norm"

Normal distribution with 2 parameters: mean and standard deviation sd

"t"

Student t-distribution with 2 parameters: n degrees of freedom and noncentrality ncp

"cauchy"

Cauchy distribution with 2 parameters: location and scale

rollmean

Binary TRUE/FALSE value. If TRUE, rolling average (moving mean) of p-values will be calculated, with the lag window set to 3 by default.

direction

Character specifying whether the index of the result should be left- or right-aligned or centered compared to the rolling window of observations, set to "left" by default.

pvals_sim

Object resulting from simultaneous PERFect with taxa abundance ordering, allowing user to perform Simultaneous PERFect with p-values ordering. Be aware that the choice of distribution for both methods must be the same.

Details

This function is designed to save computational time needed to obtain and fit the sampling distribution for each taxon if taxa ordering different from the one used in PERFect_perm() is used. Note, the distribution and OTU table X should match the distribution used in PERFect_perm().

Value

res_perm

The perfect_perm object updated according to the alternative taxa ordering. All elements in this list are same as in perfect_perm object given by PERFect() function.

Author(s)

Ekaterina Smirnova

References

Azzalini, A. (2005). The skew-normal distribution and related multivariate families. Scandinavian Journal of Statistics, 32(2), 159-188.

Smirnova, E., Huzurbazar, H., Jafari, F. “PERFect: permutationfiltration of microbiome data", to be submitted.

See Also

PERFect_perm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
data(mock2)

# Proportion data matrix
Prop <- mock2$Prop

# Counts data matrix
Counts <- mock2$Counts

#### Uncomment to run algorithm with parallel processing with more than 2 cores
# #obtain permutation PERFEct results using NP taxa ordering
# system.time(res_perm <- PERFect_perm(X=Prop, k = 1000, algorithm = "fast))

# #run PERFEct_sim() function and obtain p-values ordering
# res_sim <- PERFect_sim(X=Prop)

# #order according to p-values
# pvals_sim <- pvals_Order(Counts, res_sim)

# #update perfect_perm object according to p-values ordering
# res_reorder <- PERFect_perm_reorder(X=Prop,  Order.user = pvals_sim,  res_perm = res_perm)

# #permutation perfect colored by FLu values
# pvals_Plots(PERFect = res_perm, X = Counts, quantiles = c(0.25, 0.5, 0.8, 0.9), alpha=0.05)

katiasmirn/PERFect documentation built on Sept. 17, 2019, 11:54 a.m.