2401_86449925 2024-07-23 12:44 采纳率: 40%
浏览 169
已结题

使用GDCquery函数时报错

query_exp <- GDCquery(project = "TCGA-STAD",

  •                   data.category = "transcriptome profiling",
    
  •                   data.type = "Gene Expression Quantification",
    
  •                   workflow.type = "STAR-Counts")
    

o GDCquery: Searching in GDC database

Genome of reference: hg38

file_countcase_countdata_category
7130443Simple Nucleotide Variation
4228443Sequencing Reads
2537443Biospecimen
906443Clinical
4940443Copy Number Variation
1878439Transcriptome Profiling
1410443DNA Methylation
357357Proteome Profiling
3216Somatic Structural Variation
1792415Structural Variation
错误于checkDataCategoriesInput(project, data.category):
Please set a valid data.category argument from the column data_category above. We could not validade the data.category for project TCGA-STAD
  • 写回答

12条回答 默认 最新

  • 叫兽-郭老师 新星创作者: Java技术领域 2024-07-23 12:44
    关注

    🕒下午好,题主!目前:🟢[在线]
    📢参考通义千问、由郭老师整理提供!
    📣今日诗号:七弦抚尽,何处觅知音,但向朗月空林。翰墨残迹,谁得千秋理,且听松涛竹意。

    报错信息表明,你在使用 GDCquery 函数时,提供的 data.category 参数 "transcriptome profiling" 在项目 "TCGA-STAD" 中无效。 解决方案是使用 GDCquery_available() 函数查看该项目可用的 data.category 值,并选择正确的类别。

    以下是完整的代码:

    # 加载 GDCquery 包
    library(TCGAbiolinks)
    
    # 查询可用的 data.category
    available_categories <- GDCquery_available(project = "TCGA-STAD", 
                                               data.category = TRUE)
    
    # 打印可用的 data.category
    print(available_categories$data.category)
    
    # 从输出中选择正确的 data.category,例如 "Transcriptome Profiling"
    correct_category <- "Transcriptome Profiling"
    
    # 使用正确的 data.category 重新运行 GDCquery
    query_exp <- GDCquery(project = "TCGA-STAD",
                       data.category = correct_category,
                       data.type = "Gene Expression Quantification",
                       workflow.type = "STAR-Counts") 
    
    # 继续执行后续代码...
    

    代码解释:

    1. GDCquery_available(project = "TCGA-STAD", data.category = TRUE):
      • project = "TCGA-STAD" 指定要查询的项目。
      • data.category = TRUE 表示要获取可用的 data.category 值。
    2. print(available_categories$data.category): 打印所有可用的 data.category 值。
    3. correct_category <- "Transcriptome Profiling": 根据打印结果选择正确的 data.category 值,并将其赋值给 correct_category 变量。
    4. GDCquery(...): 使用 correct_category 变量中的正确值重新运行 GDCquery 函数。

    通过以上步骤,你就可以解决 data.category 参数错误的问题,并成功使用 GDCquery 函数查询数据。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(11条)

报告相同问题?

问题事件

  • 系统已结题 7月31日
  • 已采纳回答 7月23日
  • 创建了问题 7月23日