Error while running survival analysis ?
0
0
Entering edit mode
14 months ago

I'm interested in plotting KM survival curve for genes based on median bifuraction of low and high expression groups. However, while running I;m getting an error stating that:

"Error in names(.cols) <- grp.levels : 
  'names' attribute [385] must be the same length as the vector [381]"

My Code is as follows:

library(survival)
library(survminer)
library(dplyr)
library(survMisc)
library(GGally)
library(survcomp)
library(RegParallel)



JMS <- read.delim(file = "SURVIVAL_47.txt")
JMS = JMS %>% mutate(group = case_when(AURKA > quantile(AURKA, 0.5) ~ 'AURKA(High)', AURKA < quantile(AURKA, 0.5) ~ 'AURKA(Low)', TRUE ~ NA_character_ ))

fit <- survfit(Surv(Time, Status) ~ AURKA, data = JMS)

ggsurvplot(fit, pval = TRUE, conf.int = TRUE, risk.table = TRUE, risk.table.y.text.col = TRUE)

My data (SURVIVAL_47.txt") is available at:

SURVIVAL_47.txt:

KM OS plot RNA-Seq • 577 views
ADD COMMENT
1
Entering edit mode

Which line specifically is giving you this error?

The error seems fairly self explanatory: one of these functions is trying to assign column names as grp.levels (likely an internal variable), but the two objects are different lengths. In my experience there's a good chance this error stems from something simple like empty rows/columns in your starting .txt file, ambiguous group names, passing extra sample name/condition/group info columns to a function which is intended to only take a matrix of values, etc.

ADD REPLY

Login before adding your answer.

Traffic: 2725 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6