Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/PERFect_perm_reorder.R
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.
| 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)
 | 
| 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  | 
| Order.user | User's taxa ordering. This argument takes a character vector of ordered taxa names. | 
| res_perm | Output of  | 
| 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  | 
| 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  
 | 
| 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. | 
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().
| 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  | 
Ekaterina Smirnova
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.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | data(mock2)
# Proportion data matrix
Prop <- mock2$Prop
# Counts data matrix
Counts <- mock2$Counts
## Not run: 
# 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)
## End(Not run)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.