前一段時間TCGA數(shù)據(jù)庫改了版,TCGAbiolinks包原來的代碼沒有辦法獲取相關(guān)的mRNA和lncRNA數(shù)據(jù),但是TCGAbiolinks包的作者很給力,很快就將TCGAbiolinks包進行了更新,所以需要重新安裝TCGAbiolinks:
if (!requireNamespace("BiocManager", quietly = TRUE))
? install.packages("BiocManager")
BiocManager::install("remotes")
BiocManager::install("BioinformaticsFMRP/TCGAbiolinksGUI.data")
BiocManager::install("BioinformaticsFMRP/TCGAbiolinks")
BiocManager::install("SummarizedExperiment")
安裝好這些包后,需要對代碼進行一些修改,例如workflow.type這里需要改為workflow.type="STAR - Counts",使用assay函數(shù)獲取表達矩陣的時候需要設(shè)計參數(shù)i,也就是選擇你要下載的數(shù)據(jù)格式:
geneexp <- assay(mydata,i = "unstranded")#tpm_unstrand fpkm_unstrand
例如你要下載Counts格式就需要i= "unstranded",下載tpm格就要i="tpm_unstrand",下載fpkm格式就要i=" fpkm_unstrand"。
TCGA改版后最大的好處就是不需要轉(zhuǎn)換id了,可以直接獲取具有基因名字的表達矩陣,同時可以直接提取出mRNA矩陣和lncRNA矩陣,可以節(jié)省不少時間和精力。
write.table(mRNA,"mRNA.txt",quote = F,sep = "\t",row.names = F)

write.table(lncRNA,"lncRNA.txt",quote = F,sep = "\t",row.names = F)

這樣就可以輕松一步到位獲取TCGA數(shù)據(jù)庫的mRNA矩陣和lncRNA矩陣,比使用perl方便多了,不需要安裝多余的軟件,全程使用R語言。