diff --git a/RNA-arry.R b/RNA-arry.R index 5e3adcd..5ae2a15 100644 --- a/RNA-arry.R +++ b/RNA-arry.R @@ -38,28 +38,28 @@ exp <- exp[, -1] #将样本按pData$title分为normal组和cancer组,并转换为factor grp <- grp[colnames(exp),] grp <- ifelse(str_detect(grp$title,"Normal"),"normal","cancer") %>% -  factor(c("normal","cancer")) + factor(c("normal","cancer")) ############################样本质量控制与标准化################################ pca_plot1 <- as.data.frame(prcomp(t(exp))$x) %>% -  ggplot(aes(x = PC1, y = PC2, colour = grp)) + -  geom_point() + -  stat_ellipse(level = 0.95, show.legend = F) + -  theme_bw() + -  theme(panel.grid.major=element_blank(), panel.grid.minor=element_blank()) + -  ggtitle("Before Normalize") + ggplot(aes(x = PC1, y = PC2, colour = grp)) + + geom_point() + + stat_ellipse(level = 0.95, show.legend = F) + + theme_bw() + + theme(panel.grid.major=element_blank(), panel.grid.minor=element_blank()) + + ggtitle("Before Normalize") exp <- normalizeBetweenArrays(exp, method="quantile") if(max(exp)>50) exp <- log2(exp + 1) pca_plot2 <- as.data.frame(prcomp(t(exp))$x) %>% -  ggplot(aes(x = PC1, y = PC2, colour = grp)) + -  geom_point() + -  stat_ellipse(level = 0.95, show.legend = F) + -  theme_bw() + -  theme(panel.grid.major=element_blank(), panel.grid.minor=element_blank()) + -  ggtitle("After Normalize") + ggplot(aes(x = PC1, y = PC2, colour = grp)) + + geom_point() + + stat_ellipse(level = 0.95, show.legend = F) + + theme_bw() + + theme(panel.grid.major=element_blank(), panel.grid.minor=element_blank()) + + ggtitle("After Normalize") pca_plot1 + theme(legend.position = "none") + pca_plot2