【问题标题】:Time variable is not numeric for survival analysing in maftools时间变量不是maftools中生存分析的数字
【发布时间】:2020-06-13 00:07:48
【问题描述】:

我正在尝试对肝癌中的“TTN”基因进行生存分析。我使用 TCGAbiolinks 包下载 LIHC 数据。为了执行生存分析,使用了这个命令:

mafSurvival(maf = laml, genes = 'TTN', time = 'days_to_last_followup', Status = 'Overall_Survival_Status', isTCGA = TRUE)

但它导致错误“时间变量不是数字”!

这是我的代码:

library(maftools)
library(TCGAbiolinks)
library(tidyverse)

maf <- GDCquery_Maf("LIHC", pipelines = "muse")


clin <- GDCquery_clinic("TCGA-LIHC","clinical")

my_data <- as_tibble(clin)

# get column names
col <- colnames(my_data)


# Rename column where names is "Sepal.Length"
names(my_data)[names(my_data) == "bcr_patient_barcode"] <- "Tumor_Sample_Barcode"
names(my_data)[names(my_data) == "submitter_id"] <- "Tumor_Sample_Barcode"
names(my_data)[names(my_data) == "vital_status"] <- "Overall_Survival_Status"

names(my_data)[names(my_data) == "Dead"] <- FALSE
names(my_data)[names(my_data) == "Alive"] <- TRUE


laml = read.maf(
  maf,
  clinicalData = my_data,
  removeDuplicatedVariants = TRUE,
  useAll = TRUE,
  gisticAllLesionsFile = NULL,
  gisticAmpGenesFile = NULL,
  gisticDelGenesFile = NULL,
  gisticScoresFile = NULL,
  cnLevel = "all",
  cnTable = NULL,
  isTCGA = FALSE,
  vc_nonSyn = NULL,
  verbose = TRUE
)

plotmafSummary(maf = laml, rmOutlier = TRUE, addStat = 'median', dashboard = TRUE, titvRaw = FALSE)

#oncoplot for top ten mutated genes.
oncoplot(maf = laml, top = 10)


#####################################Function_mafSurvival##################################


#Survival analysis based on grouping of Gene_name mutation status
mafSurvival(maf = laml, genes = 'TTN', time = 'days_to_last_followup', Status = 'Overall_Survival_Status', isTCGA = TRUE)

我将不胜感激任何帮助,使其适用于使用 maftools 和 TCGAbiolinks 软件包进行生存分析。 提前致谢。

【问题讨论】:

    标签: r survival-analysis


    【解决方案1】:

    您必须在对read.maf 的调用中设置isTCGA=TRUE(或在maf 中截断它(maf$Tumor_Sample_Barcode &lt;- substr(maf$Tumor_Sample_Barcode, 1, 12)))。

    以下代码有效:

    invisible(lapply(c("maftools", "TCGAbiolinks"), require, character.only=TRUE))  
    maf <- GDCquery_Maf("LIHC", pipelines = "muse")
    clin <- GDCquery_clinic("TCGA-LIHC","clinical")
    my_data <- data.frame(clin, stringsAsFactors = FALSE, check.names = FALSE)
    colnames(my_data)[colnames(my_data)=="submitter_id"] <-  "Tumor_Sample_Barcode"
    colnames(my_data)[colnames(my_data)=="vital_status"] <-  "Overall_Survival_Status"
    
    laml <- read.maf(maf, clinicalData = my_data, isTCGA = TRUE)
    #> -Validating
    #> -Silent variants: 18306 
    #> -Summarizing
    #> --Possible FLAGS among top ten genes:
    #>   TTN
    #>   MUC16
    #>   OBSCN
    #>   FLG
    #> -Processing clinical data
    #> -Finished in 3.409s elapsed (4.562s cpu)
    
    mafSurvival(maf = laml, genes = 'TTN', time = 'days_to_last_follow_up', Status = 'Overall_Survival_Status', isTCGA = TRUE)
    #> Looking for clinical data in annoatation slot of MAF..
    #> Number of mutated samples for given genes:
    #> TTN 
    #>  79
    #> Median survival..
    #>     Group medianTime   N
    #> 1: Mutant        495  79
    #> 2:     WT        602 283
    #> Removed 83 samples with NA's
    #> Warning in survival::Surv(time = Time, event = Status): Invalid status value,
    #> converted to NA
    
    #> Warning in survival::Surv(time = Time, event = Status): Invalid status value,
    #> converted to NA
    
    #> Warning in survival::Surv(time = Time, event = Status): Invalid status value,
    #> converted to NA
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-11-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多