#simulate some data sets: matrices of log-abundance levels
nsam<-10 #number of individuals
nfeat<-40 #number of features (metabolites, genes,...)
diffs<-c(1:7) #features with differential log-abundance levels
lfc<-5 #differential quantity
# create data sets:
x <- matrix(runif(nfeat*nsam), nrow = nfeat, ncol = nsam) #case
y <- matrix(runif(nfeat*nsam), nrow = nfeat, ncol = nsam) #control
x[diffs,] <- x[diffs,] + lfc
# hard threshold estimator on fold change: ----------
z1 <- nhard.threshold.est(x=x,y=y,alpha=0.3,opt="fold.change")
z2 <- nfc.threshold.est(x=x,y=y,threshold=0.5)
# other options: -----
z4 <- nhard.threshold.est(x=x,y=y,pval.fun=t.test,opt="TWER")
z5 <- nhard.threshold.est(x=x,y=y,alpha=0.05,opt="FWER")
z6 <- nhard.threshold.est(x=x,y=y,pval.fun=wilcox.test,opt="LFDR")
Run the code above in your browser using DataLab