Commit 5b5cddd2 authored by Holger Brandl's avatar Holger Brandl

added pca matrix and scree plot

parent 52ae08a9
......@@ -136,7 +136,21 @@ group_labels = data_frame(replicate = colnames(expMatrix)) %>%
names(group_labels) = colnames(expMatrix)
makePcaPlot(t(expMatrix), color_by = group_labels, title = "PCA of quantifiable proteins in all conditions")
#' Also do a scatter plot matrix of the PCs
mydata.pca = prcomp(t(expMatrix), retx = TRUE, center = TRUE, scale. = FALSE)
# screeplot(mydata.pca)
# devtools::install_github("vqv/ggbiplot")
# require(ggbiplot)
ggbiplot::ggscreeplot(mydata.pca) + geom_col()
# load_pack(GGally)
pcs = mydata.pca$x %>% as_df %>% rownames_to_column("sample")
pcs %>% GGally::ggpairs(columns=2:6, mapping=ggplot2::aes(color=sample), upper="blank", legend=c(3,3)) + theme(legend.position = "bottom")
#' Also analyze spearman correlation
correlation = cor(expMatrix, method = "spearman")
library(lattice)
levelplot(correlation, scales = list(x = list(rot = 90)), pretty = TRUE, main = "Spearman correlation between conditions after Normalization", xlab = "Conditions", ylab = "Conditions")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment