下載cBioPortal中的文章相關資料
之前一直以為cBioPortal是用於視覺化分析癌症基因組(TCGA, ICGC)等資料的網站,後來才發現其還收錄了不少研究論文的原始上傳資料
整合進cBioPortal的基因組資料型別包括體細胞突變,DNA copy-number alterations(CNAs),Mrna和microRNA(miRNA)表達,DNA甲基化,蛋白質富集,磷酸化蛋白富集。
ofollow,noindex" target="_blank">cBioportal中文教程最近因為有個需求希望能下載到BioPortal上某個研究的全部原始資料,嘗試了不少方法,最終找到可以在Github上下載BioPortal網站上所有文章的資料,步驟略微繁瑣,因此整理下
cBioPortal網站做了一個R包-cgdsr使使用者能通過一個基於R的API埠訪問其每個癌症資料集使用R語言的cgdsr包獲取TCGA資料
這個R包主要提供以下幾個函式進行查詢資料:
-
載入cgdsr包,建立一個物件來連線cbioportal server
library(cgdsr) # Create CGDS object mycgds = CGDS("http://www.cbioportal.org/")
-
查詢cbioportal包含的研究資料的study id
# Get list of cancer studies at server study_id <- getCancerStudies(mycgds)[,c(1,2)]
-
看看某個study id(如nsclc_pd1_msk_2018)的所包含的資料型別有哪些(如mutate data等)以及case型別
profiles <-getGeneticProfiles(mycgds, "nsclc_pd1_msk_2018") cases <- getCaseLists(mycgds, "nsclc_pd1_msk_2018")
-
最後看下特定一個基因的資料情況,如下是突變資料
res <- getProfileData(mycgds, c("CDK4","RARA"), "nsclc_pd1_msk_2018_mutations", "nsclc_pd1_msk_2018_all")
除了R的API埠外,BioPortal網站還提供了web的API埠,結果跟R的API大同小異
但是我最近在檢視一篇文獻的時候,發現其文章的全部資料是放在BioPortal上的,並且也在BioPortal上搜了其相關介面。但是BioPortal網站只提供了其資料的一些視覺化分析結果,而我需要其文章上傳的全部原始資料,而R和web的API埠也無法滿足這需求
這時在網上搜尋方法的時候看到有人提到BioPortal的Github上可以下載到全部資料,因此在Github上發現果然有相關方法:https://github.com/cBioPortal/datahub
The datahub is a repository for store data only. It contains staging files which are pre-validated and can be loaded directly into the cBioPortal
但是其是用git-lfs來管理這些檔案的
Git LFS 是 Github 開發的一個 Git 的擴充套件,用於實現 Git 對大檔案的支援
所以我們需要先安裝git lfs先(以ubuntu為例),依次輸入命令就行;其主要步驟是先將安裝Git,然後將git-lfs放到你的apt源裡,然後在用apt來安裝git-lfs,最後顯示Git LFS initialized.
即說明安裝成功
sudo apt-get install git curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash sudo apt-get install git-lfs git lfs install
接著用git將datahub倉庫克隆到伺服器上
git clone https://github.com/cBioPortal/datahub.git cd datahub git lfs install --local --skip-smudge
最後可以是通過git-lfs將study id的相關資料都拉下來(注:這個stduy id是要在datahub/public裡有的才行)
git lfs pull -I public/nsclc_pd1_msk_2018 cd public/nsclc_pd1_msk_2018/
最後可以看到資料都下載到nsclc_pd1_msk_2018
資料夾中了,包含了完整的資料,非常好用,有需求的可以試試哈
anlan@ubuntu:~/datahub/public/nsclc_pd1_msk_2018$ ls -lh 總用量 2.3M drwxrwxr-x 2 anlan anlan 4.0K9月 22 00:00 case_lists -rw-rw-r-- 1 anlan anlan18K9月 22 00:03 data_clinical_patient.txt -rw-rw-r-- 1 anlan anlan27K9月 22 00:03 data_clinical_sample.txt -rw-rw-r-- 1 anlan anlan 261K9月 22 00:03 data_CNA.txt -rw-rw-r-- 1 anlan anlan24K9月 22 00:03 data_fusions.txt -rw-rw-r-- 1 anlan anlan 6.6K9月 22 00:03 data_gene_matrix.txt -rw-rw-r-- 1 anlan anlan 2.2K9月 22 00:03 data_gene_panel_impact341.txt -rw-rw-r-- 1 anlan anlan 2.6K9月 22 00:03 data_gene_panel_impact410.txt -rw-rw-r-- 1 anlan anlan 2.9K9月 22 00:03 data_gene_panel_impact468.txt -rw-rw-r-- 1 anlan anlan 638K9月 22 00:03 data_mutations_extended_mskcc.txt -rw-rw-r-- 1 anlan anlan 637K9月 22 00:03 data_mutations_extended.txt -rw-rw-r-- 1 anlan anlan1479月 22 00:00 meta_clinical_patient.txt -rw-rw-r-- 1 anlan anlan1459月 22 00:00 meta_clinical_sample.txt -rw-rw-r-- 1 anlan anlan2739月 22 00:00 meta_CNA.txt -rw-rw-r-- 1 anlan anlan2299月 22 00:00 meta_fusions.txt -rwxrwxr-x 1 anlan anlan1529月 22 00:00 meta_gene_matrix.txt -rw-rw-r-- 1 anlan anlan2849月 22 00:00 meta_mutations_extended.txt -rw-rw-r-- 1 anlan anlan3759月 22 00:00 meta_study.txt -rw-rw-r-- 1 anlan anlan 618K9月 22 00:03 nsclc_pd1_msk_2018_data_cna_hg19.seg -rw-rw-r-- 1 anlan anlan2299月 22 00:00 nsclc_pd1_msk_2018_meta_cna_hg19_seg.txt
本文出自於http://www.bioinfo-scrounger.com 轉載請註明出處