文章预览
学习笔记总结于『生信技能树』马拉松课程 GEO数据挖掘系列,第20篇学习笔记:WGCNA代码实操之准备阶段 0.数据预整理 本例用GEO数据库下载的数据,GSE199335 rm(list = ls()) library(tinyarray) gse = "GSE199335" geo = geo_download(gse,destdir= "." ,colon_remove = T) geo $gpl 做WGCNA必须有15及以上的样本,否则不符合要求,没有做的意义 图0 #View(geo$pd) library(stringr) Group = paste(geo $pd $genotype ,geo $pd $age ,sep= "_" ) %>% str_remove( " months of age| weeks of age" ) %>% str_remove( " type" ) %>% str_replace( "/" , "." ) table(Group) Group = factor(Group,levels = c( "wild_6" , "wild_9" , "R6.1_6" , "R6.2_9" )) ids $gpl,destdir = tempdir(), type = "soft" ) ids = na.omit(ids) #将NA行去除 exp = trans_array(geo $exp ,ids,from = "ID" ) #把探针表达矩阵转为基因表达矩阵 pd = geo $pd Group save(exp,Group,pd,file = "Dat.Rdata" ) 以上
………………………………