iRafNet_permutation {iRafNet} | R Documentation |
Derive importance scores for one permuted data.
Description
This function computes importance score for one permuted data set. Sample labels of target genes are randomly permuted and iRafNet is implemented. Resulting importance scores can be used to derive an estimate of FDR.
Usage
iRafNet_permutation(X, W, ntree, mtry,genes.name,perm)
Arguments
X |
|
W |
|
ntree |
Numeric value: number of trees. |
mtry |
Numeric value: number of predictors to be sampled at each node. |
genes.name |
Vector containing genes name. The order needs to match the rows of |
perm |
Integer: seed for permutation. |
Value
A vector containing importance score for permuted data.
References
Petralia, F., Wang, P., Yang, J., Tu, Z. (2015) Integrative random forest for gene regulatory network inference, Bioinformatics, 31, i197-i205.
Petralia, F., Song, W.M., Tu, Z. and Wang, P. (2016). New method for joint network analysis reveals common and different coexpression patterns among genes and proteins in breast cancer. Journal of proteome research, 15(3), pp.743-754.
A. Liaw and M. Wiener (2002). Classification and Regression by randomForest. R News 2, 18–22.
Examples
# --- Generate data sets
n<-20 # sample size
p<-5 # number of genes
genes.name<-paste("G",seq(1,p),sep="") # genes name
data<-matrix(rnorm(p*n),n,p) # generate expression matrix
W<-abs(matrix(rnorm(p*p),p,p)) # generate weights for regulatory relationships
# --- Standardize variables to mean 0 and variance 1
data <- (apply(data, 2, function(x) { (x - mean(x)) / sd(x) } ))
# --- Run iRafNet and obtain importance score of regulatory relationships
out.iRafNet<-iRafNet(data,W,mtry=round(sqrt(p-1)),ntree=1000,genes.name)
# --- Run iRafNet for one permuted data set and obtain importance scores
out.perm<-iRafNet_permutation(data,W,mtry=round(sqrt(p-1)),ntree=1000,genes.name,perm=1)