# #——回声= FALSE ------------------------------------------------------------------------------------------------------------------------------------ 库(knitr) opts_chunk美元集(= "发表评论,消息= FALSE,警告= FALSE, tidy.opts = (keep.blank列表。行= TRUE, width.cutoff = 150),选择(宽度= 150),eval = FALSE ) ## ---- eval = FALSE ------------------------------------------------------------------------------------------------------------------------------------ # 如果(!requireNamespace(“BiocManager”,静静地= TRUE) # install.packages (BiocManager) # BiocManager::安装(“RTCGA ") ## ---- eval = FALSE ------------------------------------------------------------------------------------------------------------------------------------ # BiocManager::安装(“RTCGA / RTCGA ") ## ---- eval = FALSE ------------------------------------------------------------------------------------------------------------------------------------ # browseVignettes(“RTCGA ") ## ----eval = FALSE ------------------------------------------------------------------------------------------------------------------------------------ # 库(RTCGA) # checkTCGA('日期 ') ## ---- eval = FALSE ------------------------------------------------------------------------------------------------------------------------------------ # ( 军团< - infoTCGA () % > % # rownames() % > % #子(“计数”、“x =.)) ## ---- eval = FALSE ------------------------------------------------------------------------------------------------------------------------------------ # # dir。创建(“data2”)# releaseDate < -“2015-11-01”#酸式焦磷酸钠(军团,#函数(元素){#试({# downloadTCGA (cancerTypes =元素,数据集# =“Merge_methylation__humanmethylation27”,# destDir =“data2”,# = releaseDate日期 ) # }) # }) ## ---- eval = FALSE ------------------------------------------------------------------------------------------------------------------------------------ # 列表。Files ("data2") %>% #文件。路径("data2", .) %>% #文件。重命名(= substr(= 1开始,停止= 50 )) ## ---- eval = FALSE ------------------------------------------------------------------------------------------------------------------------------------ # 列表。Files ("data2") %>% #文件。路径(“data2 ", .) %>% # 酸式焦磷酸钠(函数(x) {# if (x = = data2 / NA) # file.remove (x ) # }) ## --------------------------------------------------------------------------------------------------------------------------------------------------- # 列表。Files ("data2") %>% #文件。路径(“data2 ", .) %>% # 酸式焦磷酸钠(函数(x){#文件。路径(x, list.files (x)) % > % # grep (x = =“MANIFEST.txt”模式,价值= TRUE) % > % # file.remove () # }) ## --------------------------------------------------------------------------------------------------------------------------------------------------- # # list.files(“data2 ") % > % #文件。路径(“data2 ", .) %>% # 酸式焦磷酸钠(函数(y){#文件。path(y, list.files(y)) %>% # assign(value = ., # x = paste0(list.files(y) %>% # gsub(x = ., # pattern = "\\..*", # replacement = "") %>% # gsub(x=., # pattern="-", # replacement = "_"), # ".methylation.path"), # envir = .GlobalEnv) # }) ## ---- eval=FALSE------------------------------------------------------------------------------------------------------------------------------------ # ls() %>% # grep("methylation\\.path", x = ., value = TRUE) %>% # sapply(function(element){ # try({ # readTCGA(get(element, envir = .GlobalEnv), # dataType = "methylation") %>% # assign(value = ., # x = sub("\\.path", "", x = element), # envir = .GlobalEnv ) # }) # invisible(NULL) # }) ## ---- eval=FALSE------------------------------------------------------------------------------------------------------------------------------------ # OV.methylation[1:300,] -> OV.methylation1 # OV.methylation[301:612,] -> OV.methylation2 # rm(OV.methylation) # grep( "methylation", ls(), value = TRUE) %>% # grep("path", x=., value = TRUE, invert = TRUE) %>% # cat( sep="," ) #can one to id better? as from use_data documentation: # # ... Unquoted names of existing objects to save # devtools::use_data(BRCA.methylation,COAD.methylation, # COADREAD.methylation,GBMLGG.methylation, # GBM.methylation,KIPAN.methylation, # KIRC.methylation,KIRP.methylation, # LAML.methylation,LUAD.methylation, # LUSC.methylation,OV.methylation1,OV.methylation2, # READ.methylation,STAD.methylation, # STES.methylation,UCEC.methylation, # # overwrite = TRUE, # compress="xz")