## Create random sparse annotation matrix for 50 variable groups
## and 100 variables
annotations = matrix(rbinom(5000,1,.1), nrow=50, ncol=100)
## Number of initial annotations
sum(annotations)
## Create random gene expression matrix for 50 observations and 100 variables
data = matrix(rnorm(5000), nrow=50, ncol=100)
## Execute EMVC using k-means
EMVC.results = EMVC(data=data, annotations=annotations,
bootstrap.iter=30, k.range=2:10, clust.method="kmeans",
kmeans.nstart=3, kmeans.iter.max=10)
## Filter the results at .9 threshold
filtered.opt.annotations = filterAnnotations(EMVC.results, .9)
## Number of optimized annotations at .9 threshold, should be close to 0 since the
## variable groups and data are random (i.e., no random annotations avoid
## optimization-based filtering most of the time)
sum(filtered.opt.annotations)
## Filter the results at .1 threshold
filtered.opt.annotations = filterAnnotations(EMVC.results, .1)
## Number of optimized annotations at .1 threshold, should be close to
## the initial number of annotations since the variable groups and data are random
## (i.e., no random variables are consistently filtered by the EMVC algorithm)
sum(filtered.opt.annotations)
Run the code above in your browser using DataLab