肝癌案例之使用TCGAbiolinks 包查询并下载数据_01

#install package
if (!requireNamespace("BiocManager", quietly = TRUE))
  install.packages("BiocManager")
if (!requireNamespace("BiocManager", quietly = TRUE))
  install.packages("TCGAbiolinks")
library(TCGAbiolinks)
library(SummarizedExperiment)
library(dplyr)
library(DT)

#01、查询
query <- GDCquery(project = "TCGA-LIHC",
                 data.category = "Transcriptome Profiling",
             data.type = "Gene Expression Quantification", 
                  workflow.type = "HTSeq - Counts"
                  )
samplesDownone <- getResults(query,cols=c("cases")) 

#02、从samplesDown筛选TP与NT的barcode
dataSmTP <- TCGAquery_SampleTypes(barcode = samplesDownone,
                                  typesample = "TP")

dataSmNT <- TCGAquery_SampleTypes(barcode = samplesDownone,
                                  typesample = "NT")

#03、设置barcodes参数,筛选符合要求的371个肿瘤样本数据和50正常组织数据

queryDown <- GDCquery(project = "TCGA-LIHC", 
                 data.category = "Transcriptome Profiling",
              data.type = "Gene Expression Quantification", 
                      workflow.type = "HTSeq - Counts", 
                      barcode = c(dataSmTP, dataSmNT))
getResults(queryDown,cols=c("cases")) 

#04、下载查询到的内容
GDCdownload(queryDown,method = "api", 
            directory ="F:/GDCdata",
            files.per.chunk = 10) 

[1]R语言|TCGAbiolinks 包系列(1)——检索并获取数据https://www.jianshu.com/p/e405073f1642
[2]R语言|TCGAbiolinks 包系列(2)——肝癌案例之数据预处理
https://www.jianshu.com/p/6f05de6684c9

你可能感兴趣的:(R与生信)