TCGAbiolinks包报错:'GDCquery_Maf'非导出对象求解决方案
问题
已安装sesame和TCGAbiolinks包,但运行代码时触发以下错误:
Error: 'GDCquery_Maf' is not an exported object from 'namespace:TCGAbiolinks'
相关代码:
options(stringsAsFactors = F) library(TCGAbiolinks) library(SummarizedExperiment) library(limma) library(biomaRt) library(TCGAbiolinks) library(sesame) mty_assay <- as.data.frame(assay(data_mty)) # DNA甲基化矩阵 mty_colData <- as.data.frame(colData(data_mty)) # 患者注释信息(475例患者) filename <- paste0("./data/tcga_data/", cancer_type, "_mty_colData.RData") saveRDS(mty_colData, filename) mty_rowRanges <- as.data.frame(rowRanges(data_mty)) # cg探针注释信息 #### 收集基因突变数据 # maf <- GDCquery_Maf("SKCM", pipelines = "muse") # 突变注释信息 maf <- TCGAbiolinks::GDCquery_Maf(cancer_type, pipelines = "muse") # 此处触发错误
解决建议
更新TCGAbiolinks到最新版本
这个错误大多是因为包版本过旧,GDCquery_Maf是较新版本才加入的函数。先查看当前版本:packageVersion("TCGAbiolinks")如果版本低于2.20.0,用BiocManager更新:
if (!require("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install("TCGAbiolinks", update = TRUE)更新后重启R会话再尝试。
用替代方法获取MAF数据
如果更新后还是找不到该函数,可能是函数被重命名或移除了。可以用基础的GDCquery+GDCprepare流程替代:# 构建查询 query <- GDCquery( project = paste0("TCGA-", cancer_type), data.category = "Simple Nucleotide Variation", data.type = "Masked Somatic Mutation", workflow.type = "MuSE Variant Aggregation and Masking" # 对应muse流程 ) # 下载数据 GDCdownload(query) # 整理成MAF格式 maf <- GDCprepare(query)重新安装TCGAbiolinks
如果更新无效,可能是安装不完整。先卸载再重装:remove.packages("TCGAbiolinks") BiocManager::install("TCGAbiolinks", dependencies = TRUE)安装完成后一定要重启R,再加载包测试。
内容的提问来源于stack exchange,提问作者Lance Zhang
相关产品推荐
相关产品推荐

