转自 TCGA数据下载—TCGAbiolinks包参数详解
原创 hls 组学大讲堂 2019-10-22
Install tcgabiolink
if(!requireNamespace("BiocManager",quietly=TRUE)){
install.packages("BiocManager")
}
options(BioC_mirror="https://mirrors.tuna.tsinghua.edu.cn/bioconductor")
BiocManager::install("TCGAbiolinks")
TCGAbiolink-Download
1.GDCquery() #查询data
2.getResults() #下载data
3.GDCprepare() #整理data
##说明书http://www.bioconductor.org/packages/release/bioc/vignettes/TCGAbiolinks/inst/doc/query.html
GDCquery参数
1.Project
getGDCprojects()$project_id ,获取TCGA 中最新的不同癌的项目号
2.data.category
TCGAbiolinks:::getProjectSummary(project)查看project中有哪些数据类型,如查询"TCGA-ACC",
exsample:
TCGAbiolinks:::getProjectSummary('TCGA-ESCA')
TCGAbiolinks:::getProjectSummary('TCGA-ESCA')$file_count[1] 5657
$data_categories file_count case_count data_category1 919 184 Transcriptome Profiling2 1486 184 Simple Nucleotide Variation3 962 185 Biospecimen4 207 185 Clinical5 202 185 DNA Methylation6 1115 185 Copy Number Variation7 766 185 Sequencing Reads
$case_count[1] 185
$file_size[1] 8.198261e+12
3.data.type
参数受到熵一个参数的影响,不同的data.category,会有不同的data.type
4.Workflow.type
这个参数受到上两个参数的影响,不同的data.category和不同的data.type,会有不同的workflow.type,如下表所示:https://www.omicsclass.com/article/1059
legacy这个参数主要是设置TCGA数据有两不同入口可以下载,GDC Legacy Archive 和 GDC Data Portal,以下是官方的解释两种数据Legacy or Harmonized区别:大致意思为:Legacy 数据hg19和hg18为参考基因组(老数据)而且已经不再更新了,Harmonized数据以hg38为参考基因组的数据(新数据),现在一般选择Harmonized。可以设置为TRUE或者FALSE:
access
Filter by access type. Possible values: controlled, open,筛选数据是否开放,这个一般不用设置,不开放的数据也没必要了,所以都设置成:access=“open"
7.platform
涉及到数据来源的平台,如芯片数据,甲基化数据等等平台的筛选,一般不做设置,除非要筛选特定平台的数据:
8. file.type
如果是在GDC Legacy Archive(legacy=TRUE)下载数据的时候使用,可以参考官网说明:http://www.bioconductor.org/packages/release/bioc/vignettes/TCGAbiolinks/inst/doc/query.html
如果在GDC Data Portal,这个参数不用设置
9. barcode
A list of barcodes to filter the files to download,可以指定要下载的样品,例如:
barcode =c"TCGA-14-0736-02A-01R-2005-01""TCGA-06-0211-02A-02R-2005-01"
10. data.format
可以设置的选项为不同格式的文件:("VCF", "TXT", "BAM","SVS","BCR XML","BCR SSF XML", "TSV", "BCR Auxiliary XML", "BCR OMF XML", "BCR Biotab", "MAF", "BCR PPS XML", "XLSX"),通常情况下不用设置,默认就行;
11. experimental.strategy
用于过滤不同的实验方法得到的数据:
Harmonized: WXS, RNA-Seq, miRNA-Seq, Genotyping Array.
Legacy: WXS, RNA-Seq, miRNA-Seq, Genotyping Array, DNA-Seq, Methylation array, Protein expression array, WXS,CGH array, VALIDATION, Gene expression array,WGS, MSI-Mono-Dinucleotide Assay, miRNA expression array, Mixed strategies, AMPLICON, Exon array, Total RNA-Seq, Capillary sequencing, Bisulfite-Seq
12. sample.type
对样本的类型进行过滤,例如,原发癌组织,复发癌等等;
学习完成了所有的参数,这里也有举例使用:
query <- GDCquery(project = "TCGA-ACC",
data.category = "Copy Number Variation",
data.type = "Copy Number Segment")
## Not run:
query <- GDCquery(project = "TARGET-AML",
data.category = "Transcriptome Profiling",
data.type = "miRNA Expression Quantification",
workflow.type = "BCGSC miRNA Profiling",
barcode = c("TARGET-20-PARUDL-03A-01R","TARGET-20-PASRRB-03A-01R"))
query <- GDCquery(project = "TARGET-AML",
data.category = "Transcriptome Profiling",
data.type = "Gene Expression Quantification",
workflow.type = "HTSeq - Counts",
barcode = c("TARGET-20-PADZCG-04A-01R","TARGET-20-PARJCR-09A-01R"))
query <- GDCquery(project = "TCGA-ACC",
data.category = "Copy Number Variation",
data.type = "Masked Copy Number Segment",
sample.type = c("Primary solid Tumor"))
query.met <- GDCquery(project = c("TCGA-GBM","TCGA-LGG"),
legacy = TRUE,
data.category = "DNA methylation",
platform = "Illumina Human Methylation 450")
query <- GDCquery(project = "TCGA-ACC",
data.category = "Copy number variation",
legacy = TRUE,
file.type = "hg19.seg",
barcode = c("TCGA-OR-A5LR-01A-11D-A29H-01"))
下载数据 GDCdownload()
上面的GDCquery()命令完成之后我们就可以用GDCdownload()函数下载数据了,如果数据很多,如果中间中断可以重复运行GDCdownload()函数继续下载,直到所有的数据下载完成,使用举例如下:
query <-GDCquery(project = "TCGA-GBM",
data.category = "Gene expression",
data.type = "Gene expression quantification",
platform = "Illumina HiSeq",
file.type = "normalized_results",
experimental.strategy = "RNA-Seq",
barcode = c("TCGA-14-0736-02A-01R-2005-01", "TCGA-06-0211-02A-02R-2005-01"),
legacy = TRUE)
GDCdownload(query, method = "client", files.per.chunk = 10, directory="D:/data")
具体参数说明如下,主要设置的参数:query,为GDCquery查询的结果,files.per.chunk = 10,设置同时下载的数量,如果网速慢建议设置的小一些, directory="D:/data" 数据存储的路径;
整理数据 GDCprepare()
GDCprepare可以自动的帮我们获得基因表达数据:
data <- GDCprepare(query = query,
save = TRUE,
directory = "D:/data", #注意和GDCdownload设置的路径一致GDCprepare才可以找到下载的数据然后去处理。
save.filename = "GBM.RData") #存储一下,方便下载直接读取
获得了data数据之后,就可以往下进行数据挖掘了。