網(wǎng)站首頁 編程語言 正文
TCGA數(shù)據(jù)源
眾所周知,TCGA數(shù)據(jù)庫是目前最綜合全面的癌癥病人相關(guān)組學(xué)數(shù)據(jù)庫,包括的測(cè)序數(shù)據(jù)有:
DNA Sequencing
miRNA Sequencing
Protein Expression
mRNA Sequencing
Total RNA Sequencing
Array-based Expression
DNA Methylation
Copy Number
TCGA數(shù)據(jù)庫探索工具
知名的腫瘤研究機(jī)構(gòu)都有著自己的TCGA數(shù)據(jù)庫探索工具,比如:
Broad Institute FireBrowse portal, The Broad Institute
cBioPortal for Cancer Genomics, Memorial Sloan-Kettering Cancer Center
TCGA Batch Effects, MD Anderson Cancer Center
Regulome Explorer, Institute for Systems Biology
Next-Generation Clustered Heat Maps, MD Anderson Cancer Center
其中cBioPortal更是被包裝到R包里面
這里介紹如何使用R語言的cgdsr包來獲取任意TCGA數(shù)據(jù)。
cgdsr包:R語言工具包,可以下載TCGA數(shù)據(jù)。
DT包:data.table包,簡(jiǎn)稱DT包,是R語言中的數(shù)據(jù)可視化工具包。DT包可以將Javascript中的方法運(yùn)用到R中,也能將矩陣或者數(shù)據(jù)表在網(wǎng)頁中可視化為表格,以及其它的一些功能。
> setwd("C:/Users/YLAB/Documents/R/win-library/4.1/") > install.packages("R.methodsS3_1.8.1.zip",repos=NULL)#安裝 > install.packages("R.oo_1.24.0.zip",repos=NULL)#安裝 > install.packages("data.table") > BiocManager::install("cgdsr", force = TRUE)#安裝 > library(cgdsr) > library(DT) #創(chuàng)建一個(gè)cgdsr對(duì)象 > mycgds <- CGDS("http://www.cbioportal.org/") #檢查下載是否成功,如果是FAILED就是沒成功。 > test(mycgds) getCancerStudies... OK getCaseLists (1/2) ... OK getCaseLists (2/2) ... OK getGeneticProfiles (1/2) ... OK getGeneticProfiles (2/2) ... OK getClinicalData (1/1) ... OK getProfileData (1/6) ... OK getProfileData (2/6) ... OK getProfileData (3/6) ... OK getProfileData (4/6) ... OK getProfileData (5/6) ... OK getProfileData (6/6) ... OK all_TCGA_studies <- getCancerStudies(mycgds) > DT::datatable(all_TCGA_studies)
查看任意數(shù)據(jù)集的樣本列表方式
上表的cancer_study_id其實(shí)就是數(shù)據(jù)集的名字,我們?nèi)我膺x擇一個(gè)數(shù)據(jù)集,比如stad_tcga_pub ,可以查看它里面有多少種樣本列表方式。
stad2014 <- "stad_tcga_pub" ## 獲取在stad2014數(shù)據(jù)集中有哪些表格(每個(gè)表格都是一個(gè)樣本列表) all_tables <- getCaseLists(mycgds, stad2014) dim(all_tables) ## 共6種樣本列表方式 [1] 6 5 DT::datatable(all_tables[,1:3])
查看任意數(shù)據(jù)集的數(shù)據(jù)形式
## 而后獲取可以下載哪幾種數(shù)據(jù),一般是mutation,CNV和表達(dá)量數(shù)據(jù) all_dataset <- getGeneticProfiles(mycgds, stad2014) DT::datatable(all_dataset, extensions = 'FixedColumns', options = list( #dom = 't', scrollX = TRUE, fixedColumns = TRUE ))
一般來說,TCGA的一個(gè)項(xiàng)目數(shù)據(jù)就幾種,如下:
選定數(shù)據(jù)形式及樣本列表后獲取感興趣基因的信息,下載mRNA數(shù)據(jù)
my_dataset <- 'stad_tcga_pub_rna_seq_v2_mrna' my_table <- "stad_tcga_pub_rna_seq_v2_mrna" BRCA1 <- getProfileData(mycgds, "BRCA1", my_dataset, my_table) dim(BRCA1) [1] 265 1
樣本個(gè)數(shù)差異很大,不同癌癥熱度不一樣。
選定樣本列表獲取臨床信息
## 如果我們需要繪制survival curve,那么需要獲取clinical數(shù)據(jù) clinicaldata <- getClinicalData(mycgds, my_table) DT::datatable(clinicaldata, extensions = 'FixedColumns', options = list( #dom = 't', scrollX = TRUE, fixedColumns = TRUE ))
綜合性獲取
只需要根據(jù)癌癥列表選擇自己感興趣的研究數(shù)據(jù)集即可,然后選擇好感興趣的數(shù)據(jù)形式及對(duì)應(yīng)的樣本量。就可以獲取對(duì)應(yīng)的信息:
library(cgdsr) library(DT) mycgds <- CGDS("http://www.cbioportal.org") ##mycancerstudy = getCancerStudies(mycgds)[25,1] mycancerstudy = 'brca_tcga' getCaseLists(mycgds,mycancerstudy)[,1] ## [1] "brca_tcga_3way_complete" "brca_tcga_all" ## [3] "brca_tcga_protein_quantification" "brca_tcga_sequenced" ## [5] "brca_tcga_cna" "brca_tcga_methylation_hm27" ## [7] "brca_tcga_methylation_hm450" "brca_tcga_mrna" ## [9] "brca_tcga_rna_seq_v2_mrna" "brca_tcga_rppa" ## [11] "brca_tcga_cnaseq"
getGeneticProfiles(mycgds,mycancerstudy)[,1] ## [1] "brca_tcga_rppa" ## [2] "brca_tcga_rppa_Zscores" ## [3] "brca_tcga_protein_quantification" ## [4] "brca_tcga_protein_quantification_zscores" ## [5] "brca_tcga_gistic" ## [6] "brca_tcga_mrna" ## [7] "brca_tcga_mrna_median_Zscores" ## [8] "brca_tcga_rna_seq_v2_mrna" ## [9] "brca_tcga_rna_seq_v2_mrna_median_Zscores" ## [10] "brca_tcga_linear_CNA" ## [11] "brca_tcga_methylation_hm450" ## [12] "brca_tcga_mutations"
下載mRNA數(shù)據(jù)
mycaselist ='brca_tcga_rna_seq_v2_mrna' mygeneticprofile = 'brca_tcga_rna_seq_v2_mrna' # Get data slices for a specified list of genes, genetic profile and case list expr=getProfileData(mycgds,c('BRCA1','BRCA2'),mygeneticprofile,mycaselist) DT::datatable(expr)
很簡(jiǎn)單就得到了指定基因在指定癌癥的表達(dá)量
獲取病例列表的臨床數(shù)據(jù)
myclinicaldata = getClinicalData(mycgds,mycaselist) DT::datatable(myclinicaldata, extensions = 'FixedColumns', options = list( #dom = 't', scrollX = TRUE, fixedColumns = TRUE )) ## Warning in instance$preRenderHook(instance): It seems your data is too ## big for client-side DataTables. You may consider server-side processing: ## http://rstudio.github.io/DT/server.html
從cBioPortal下載點(diǎn)突變信息
#突變基因名稱集合 mutGene=c("EGFR", "PTEN", "TP53", "ATRX") #檢索基因和遺傳圖譜的基因組圖譜數(shù)據(jù) mut_df <- getProfileData(mycgds, caseList ="gbm_tcga_sequenced", geneticProfile = "gbm_tcga_mutations", genes = mutGene ) mut_df <- apply(mut_df,2,as.factor) mut_df[mut_df == "NaN"] = "" mut_df[is.na(mut_df)] = "" mut_df[mut_df != ''] = "MUT" DT::datatable(mut_df)
從cBioPortal下載拷貝數(shù)變異數(shù)據(jù)
mutGene=c("TP53","UGT2B7","CYP3A4") cna<-getProfileData(mycgds,mutGene,"gbm_tcga_gistic","gbm_tcga_sequenced") cna<-apply(cna,2,function(x) as.character(factor(x,levels = c(-2:2),labels = c("HOMDEL","HETLOSS","DIPLOID","GAIN","AMP")))) cna[is.na(cna)]="" cna[cna=="DIPLOID"]="" DT::datatable(cna)
把拷貝數(shù)及點(diǎn)突變信息結(jié)合畫熱圖
下面的函數(shù),主要是配色比較復(fù)雜,其實(shí)原理很簡(jiǎn)單,就是一個(gè)熱圖。
library(ComplexHeatmap) library(grid) conb <- data.frame(matrix(paste(as.matrix(cna),as.matrix(mut_df),sep = ";"), nrow=nrow(cna),ncol=ncol(cna), dimnames=list(row.names(mut_df),colnames(cna)))) mat <- as.matrix(t(conb)) DT::datatable((mat)) alt <- apply(mat,1,function(x)strsplit(x,";")) alt <- unique(unlist(alt)) alt <- alt[which(alt !="")] alt <-c("background",alt) alter_fun = list( background = function(x,y,w,h){ grid.rect(x,y,w-unit(0.5,"mm"),h-unit(0.5,"mm"), gp=gpar(fill="#CCCCCC",col=NA)) }, HOMDEL = function(x,y,w,h){ grid.rect(x,y,w-unit(0.5,"mm"),h-unit(0.5,"mm"), gp=gpar(fill="blue3",col=NA)) }, HETLOSS = function(x,y,w,h){ grid.rect(x,y,w-unit(0.5,"mm"),h-unit(0.5,"mm"), gp=gpar(fill="cadetblue1",col=NA)) }, GAIN = function(x,y,w,h){ grid.rect(x,y,w-unit(0.5,"mm"),h-unit(0.5,"mm"), gp=gpar(fill="pink",col=NA)) }, AMP = function(x,y,w,h){ grid.rect(x,y,w-unit(0.5,"mm"),h-unit(0.5,"mm"), gp=gpar(fill="red",col=NA)) }, MUT = function(x,y,w,h){ grid.rect(x,y,w-unit(0.5,"mm"),h-unit(0.5,"mm"), gp=gpar(fill="#008000",col=NA)) }) col <- c("MUT"="#008000","AMP"="red","HOMDEL"="blue3", "HETLOSS"="cadetblue1","GAIN"="pink") alt = intersect(names(alter_fun),alt) alt_fun_list <- alter_fun[alt] col <- col[alt] oncoPrint(mat=mat,alter_fun = alt_fun_list, get_type = function(x) strsplit(x,";")[[1]], col = col)
原文鏈接:https://www.jianshu.com/p/26490a96d884
相關(guān)推薦
- 2023-09-12 SpringBoot整合MQTT(MqttClient)
- 2022-11-17 Kotlin?StateFlow單數(shù)據(jù)更新熱流設(shè)計(jì)與使用介紹_Android
- 2023-05-12 Oracle中實(shí)現(xiàn)刪除重復(fù)數(shù)據(jù)只保留一條_oracle
- 2022-10-29 正則表達(dá)式預(yù)查的詳細(xì)解釋與應(yīng)用實(shí)例_正則表達(dá)式
- 2023-04-03 Golang?filepath包常用函數(shù)詳解_Golang
- 2022-08-14 Gradle?Build?Cache引發(fā)的Task緩存編譯問題_Android
- 2022-12-24 darknet框架中YOLOv3對(duì)數(shù)據(jù)集進(jìn)行訓(xùn)練和預(yù)測(cè)詳解_python
- 2022-09-30 Python?添加命令行參數(shù)步驟_python
- 最近更新
-
- window11 系統(tǒng)安裝 yarn
- 超詳細(xì)win安裝深度學(xué)習(xí)環(huán)境2025年最新版(
- Linux 中運(yùn)行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲(chǔ)小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎(chǔ)操作-- 運(yùn)算符,流程控制 Flo
- 1. Int 和Integer 的區(qū)別,Jav
- spring @retryable不生效的一種
- Spring Security之認(rèn)證信息的處理
- Spring Security之認(rèn)證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權(quán)
- redisson分布式鎖中waittime的設(shè)
- maven:解決release錯(cuò)誤:Artif
- restTemplate使用總結(jié)
- Spring Security之安全異常處理
- MybatisPlus優(yōu)雅實(shí)現(xiàn)加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務(wù)發(fā)現(xiàn)-Nac
- Spring Security之基于HttpR
- Redis 底層數(shù)據(jù)結(jié)構(gòu)-簡(jiǎn)單動(dòng)態(tài)字符串(SD
- arthas操作spring被代理目標(biāo)對(duì)象命令
- Spring中的單例模式應(yīng)用詳解
- 聊聊消息隊(duì)列,發(fā)送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠(yuǎn)程分支