diff --git a/RNA-arry.R b/RNA-arry.R index 5ae2a15..3d99ac8 100644 --- a/RNA-arry.R +++ b/RNA-arry.R @@ -1,5 +1,5 @@ ## Written By LiShang -## Notice:适用于基因芯片平台 +## Notice: 适用于基因芯片平台 #加载依赖包 library(GEOquery) @@ -19,11 +19,11 @@ exp <- exprs(gse) grp <- pData(gse) ###表达矩阵数据前处理 -#将表达矩阵的行名(探针ID)转换为Gene Symbol -#方法一:直接从GEO拿数据,好处是方便快捷,通用性高 +#将表达矩阵的行名(探针ID)转换为Gene Symbol +#方法一: 直接从GEO拿数据, 好处是方便快捷, 通用性高 gene_symbols <- fData(gse)[,c("ID","Gene Symbol")] gene_symbols <- setNames(gene_symbols$`Gene Symbol`,gene_symbols$ID)[rownames(exp)] -#方法二:通过芯片提供的R包拿数据,数据不如GEO的全,好处是基因名短 +#方法二: 通过芯片提供的R包拿数据, 数据不如GEO的全, 好处是基因名短 #install.packages("hgu133a.db") library(hgu133a.db) gene_symbols <- toTable(hgu133aSYMBOL)[,c("probe_id","symbol")] @@ -35,7 +35,7 @@ rownames(exp) <- exp$Group.1 exp <- exp[, -1] ###样本分组数据前处理 -#将样本按pData$title分为normal组和cancer组,并转换为factor +#将样本按pData$title分为normal组和cancer组, 并转换为factor grp <- grp[colnames(exp),] grp <- ifelse(str_detect(grp$title,"Normal"),"normal","cancer") %>% factor(c("normal","cancer")) @@ -67,4 +67,4 @@ pca_plot1 + theme(legend.position = "none") + pca_plot2 fit <- lmFit(exp, model.matrix(~grp)) fit <- eBayes(fit) -deg <- topTable(fit, coef="grpcancer", adjust.method="fdr", number=Inf) \ No newline at end of file +deg <- topTable(fit, coef="grpcancer", adjust.method="fdr", number=Inf)