Skip to content

Instantly share code, notes, and snippets.

@mikelove
Created October 24, 2017 01:18
Show Gist options
  • Save mikelove/0e271639300b77507d77ed9224369f74 to your computer and use it in GitHub Desktop.
Save mikelove/0e271639300b77507d77ed9224369f74 to your computer and use it in GitHub Desktop.
PCA on raw counts
# what dominates PC1: 100 features with 10x fold change or 1 feature with 2x fold change?
mat <- rbind(matrix(rpois(8*100,rep(c(10,100),each=4)),ncol=8,byrow=TRUE),
rpois(8,rep(c(1000,1000,2000,2000),2)))
plot(prcomp(t(mat))$x[,1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment