Learn R Programming

OmicsMarkeR (version 1.4.2)

perm.features: Feature Selection via Monte Carlo Permutation

Description

Applies Monte Carlo permutations to user specified models. The user can either use the results from fs.stability or provide specified model parameters.

Usage

perm.features(fs.model = NULL, X, Y, method, sig.level = 0.05, nperm = 10, allowParallel = FALSE, verbose = TRUE, ...)

Arguments

fs.model
Object containing results from fs.stability
X
A scaled matrix or dataframe containing numeric values of each feature
Y
A factor vector containing group membership of samples
method
A vector listing models to be fit. Available options are "plsda" (Partial Least Squares Discriminant Analysis), "rf" (Random Forest), "gbm" (Gradient Boosting Machine), "svm" (Support Vector Machines), "glmnet" (Elastic-net Generalized Linear Model), and "pam" (Prediction Analysis of Microarrays)
sig.level
Desired significance level for features, default sig.level = .05
nperm
Number of permutations, default nperm = 10
allowParallel
Logical argument dictating if parallel processing is allowed via foreach package. Default allowParallel = FALSE
verbose
Logical argument whether output printed automatically in 'pretty' format.
...
Extra arguments that the user would like to apply to the models

Value

sig.level
User-specified significance level
num.sig.features
Number of significant features
sig.features
Dataframe of significant features

References

Wongravee K., et. al. (2009) Monte-Carlo methods for determining optimal number of significant variables. Application to mouse urinary profiles. Metabolomics 5:387-406.

Examples

Run this code
dat.discr <- create.discr.matrix(
    create.corr.matrix(
        create.random.matrix(nvar = 50, 
                             nsamp = 100, 
                             st.dev = 1, 
                             perturb = 0.2)),
    D = 10
)

vars <- dat.discr$discr.mat
groups <- dat.discr$classes

fits <- fs.stability(vars, 
                     groups, 
                     method = c("plsda", "rf"), 
                     f = 10, 
                     k = 3, 
                     k.folds = 10, 
                     verbose = 'none')

# permute variables/features
perm.features(fits, vars, groups, "rf",
              sig.level = .05, nperm = 10)

Run the code above in your browser using DataLab