Created
May 25, 2016 16:47
-
-
Save dfjenkins3/f38a7d297badc4a27891c724e09caa5e to your computer and use it in GitHub Desktop.
example PCA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#run PCA | |
pca.results <- prcomp(t(expression)) | |
#vector of colors | |
cols <- as.character(indata$Annotation) | |
cols[cols=="K"] <- 'red' | |
cols[cols=="LG"] <- 'lightgreen' | |
cols[cols=="G"] <- 'darkgreen' | |
#plot it | |
plot(pca.results$x[,1], pca.results$x[,2], col=cols) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment