tcga数据下载_R语言简单学(TCGA数据下载)
提起R語言,貌似很艱難
圖文一結合,傻瓜都能填
一、打開R程序
> chooseCRANmirror()
> BiocManager::install("TCGAbiolinks")
更新
> library(TCGAbiolinks)
library(dplyr)
library(DT)
library(SummarizedExperiment)
以宮頸癌CESC為舉例:不同的癌癥類型只需要替換名稱
downlod clinical step:
> cancer_type="TCGA-CESC"
> clinical
> View(clinical)
> save(clinical,file="CESC_clinical.Rdata")
> write.csv(clinical, file="TCGAbiolinks-CESC-clinical.csv")
download RNA-seq step:
> TCGAbiolinks:::getProjectSummary("TCGA-CESC")
> query
? ? ? ? ? ? ? ? ?legacy = FALSE,?
? ? ? ? ? ? ? ? ?experimental.strategy = "RNA-Seq",?
? ? ? ? ? ? ? ? ?data.category = "Transcriptome Profiling",?
? ? ? ? ? ? ? ? ?data.type = "Gene Expression Quantification",?
? ? ? ? ? ? ? ? ?workflow.type = "HTSeq - Counts")
> GDCdownload(query, method = "api", files.per.chunk = 100)
> expdat
> count_matrix=assay(expdat)
> View(count_matrix)
> write.csv(count_matrix,file = "TCGAbiolinks_CESC_counts.csv")
download RNA-seq FPKM step:
> Expr_df
? ? ? ? ? ? ? ? ? ? ?data.category = "Transcriptome Profiling",
? ? ? ? ? ? ? ? ? ? ?data.type = "Gene Expression Quantification",
? ? ? ? ? ? ? ? ? ? ?workflow.type = "HTSeq - FPKM")
> GDCdownload(Expr_df, method = "api", files.per.chunk = 100)
> expdat_2
> Expr_matrix=assay(expdat_2)
> View(Expr_matrix)
> write.csv(Expr_matrix,file = "TCGAbiolinks_CESC_FPKM.csv")
#下載miRNA數據
? query
? ? ? ? ? ? ? ? ? ? data.category = "Transcriptome Profiling",?
? ? ? ? ? ? ? ? ? ? data.type = "miRNA Expression Quantification",?
? ? ? ? ? ? ? ? ? ? workflow.type = "BCGSC miRNA Profiling")
? GDCdownload(query, method = "api", files.per.chunk = 100)
? expdat
? count_matrix=assay(expdat)
? write.csv(count_matrix,file = paste(cancer_type,"miRNA.csv",sep = "-"))
query.mirna
? ? ? ? ? ? ? ? ? ? ? ? experimental.strategy = "miRNA-Seq",
? ? ? ? ? ? ? ? ? ? ? ? data.category = "Transcriptome Profiling",?
? ? ? ? ? ? ? ? ? ? ? ? data.type = "miRNA Expression Quantification")
GDCdownload(query.mirna)
mirna
? ? ? ? ? ? ? ? ? ? ?save = TRUE,?
? ? ? ? ? ? ? ? ? ? ?save.filename = "mirna.rda")
test
write.csv(mirna,"D:\\R語言工作數據\\TCGA\\mirna.csv")
#下載Copy Number Variation數據
? query
? ? ? ? ? ? ? ? ? ? data.category = "Copy Number Variation",?
? ? ? ? ? ? ? ? ? ? data.type = "Copy Number Segment")
? GDCdownload(query, method = "api", files.per.chunk = 50)
? expdat
? count_matrix=assay(expdat)
? write.csv(count_matrix,file = paste(cancer_type,"Copy-Number-Variation.csv",sep = "-"))
#下載甲基化數據
? query.met
? ? ? ? ? ? ? ? ? ? ? ? legacy = TRUE,
? ? ? ? ? ? ? ? ? ? ? ? data.category = "DNA methylation")
? GDCdownload(query.met, method = "api", files.per.chunk = 300)
? expdat
? count_matrix=assay(expdat)
? write.csv(count_matrix,file = paste(cancer_type,"methylation.csv",sep = "-"))
您若喜歡,別忘記點贊、轉發哦!
長按下方二維碼可關注!
總結
以上是生活随笔為你收集整理的tcga数据下载_R语言简单学(TCGA数据下载)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 随机数字生成器(RNG)和Hash函数组
- 下一篇: 常用的四种CSS样式表格