From d8fdaa0208be84f0412b21f09d57e1d5e5082b04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=9F=E4=BF=A1=E5=88=86=E6=9E=90?= Date: Wed, 11 Dec 2024 02:49:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20RNA-arry.R?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RNA-arry.R | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) 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