data(matrices)
data(exData)
### run function with all samples
res.pca <- lapply(matrices, function(x) msc.pca(x, samples = exData$samples,
groups = exData$species, n=30, labels=FALSE, title=NULL))
res.pca$id95$eigenvalues
res.pca$id95$plot
### use clusters with highest contribution to visualize in a heatmap
msc.heatmap(matrices[["id95"]][res.pca$id95$clustnames,], samples = exData$samples,
groups = exData$species)
### run function with a subset of samples
### you will be asked to confirm
table(exData$species)
hybrid <- which(exData$species=="hybrid")
# pca.subset <- msc.pca(clustmatrix = matrices[["id97"]],
# samples = exData$samples[hybrid],
# groups = exData$species[hybrid], labels = TRUE,
# title = "PCA only with hybrids")
Run the code above in your browser using DataLab