# #——回声= 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 ------------------------------------------------------------------------------------------------------------------------------------ # 如果(!需要(devtools)) {# install.packages (devtools) #需要(devtools) #} # install_github(“RTCGA / RTCGA ") ## ---- eval = FALSE ------------------------------------------------------------------------------------------------------------------------------------ #browseVignettes(“RTCGA ") ## ---- eval = FALSE ------------------------------------------------------------------------------------------------------------------------------------ # 库(RTCGA) # checkTCGA('日期 ') ## ---- eval = FALSE ------------------------------------------------------------------------------------------------------------------------------------ # ( 军团< - infoTCGA () % > % # rownames() % > % #子(“计数”、“x =.)) ## ---- eval = FALSE ------------------------------------------------------------------------------------------------------------------------------------ # # dir。create("data2") # releaseDate <- "2015-11-01" # sapply(cohorts, function(element){# tryCatch({# downloadTCGA(cancerTypes = element, # dataSet = "Merge_transcriptome__agilentg4502a_07_3__unc_edu__Level_3__unc_lowess_normalization_gene_level__data. data. "Level_3”,# destDir = " data2”,#日期= releaseDate)} #错误= function(电导率){#猫(“错误:也许没有突变数据”,元素,“癌症。\ n ") # } # ) # }) ## ---- 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){#文件。path(x, list.files(x)) %>% # grep(pattern = "MANIFEST.txt", x = ., value=TRUE) %>% # file.remove() # }) ## --------------------------------------------------------------------------------------------------------------------------------------------------- # # list.files("data2") %>% # file.path("data2", .) %>% # sapply(function(y){ # file.path(y, list.files(y)) %>% # assign( value = ., # x = paste0(list.files(y) %>% # gsub(x = ., # pattern = "\\..*", # replacement = "") %>% # gsub(x=., pattern="-", replacement = "_"), # ".mRNA.path"), # envir = .GlobalEnv) # }) ## ---- eval=FALSE------------------------------------------------------------------------------------------------------------------------------------ # ls() %>% # grep("mRNA\\.path", x = ., value = TRUE) %>% # sapply(function(element){ # tryCatch({ # readTCGA(get(element, envir = .GlobalEnv), # dataType = "mRNA") %>% # assign(value = ., # x = sub("\\.path", "", x = element), # envir = .GlobalEnv ) # }, error = function(cond){ # cat(element) # }) # invisible(NULL) # } # ) ## ---- eval=FALSE------------------------------------------------------------------------------------------------------------------------------------ # grep( "mRNA", 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.mRNA,COAD.mRNA,COADREAD.mRNA,GBMLGG.mRNA, # KIPAN.mRNA,KIRC.mRNA,KIRP.mRNA,LGG.mRNA,LUAD.mRNA, # LUSC.mRNA,OV.mRNA,READ.mRNA,UCEC.mRNA, # overwrite = TRUE, # compress="xz")