suchestoncampbelllab / gwasurvivr

GWAS Survival Package in R
11 stars 12 forks source link

Error in rnorm(nrow(cox.params$pheno.file)) : invalid arguments #6

Open Marie-McM opened 4 years ago

Marie-McM commented 4 years ago

Hello I am trying to use gwasurvivr to run a survival analysis on plink data files. However, when I try to run it, I get the following error message: Error in rnorm(nrow(cox.params$pheno.file)) : invalid arguments My variables ‘event’ and ‘time to event’ are both numeric variables. Could you help me with this? Thanks!

karaesmen commented 4 years ago

Hi, Can you make sure that you don't have any special characters in your column names? For example instead of time to event try time_to_event?

Marie-McM commented 4 years ago

Hello,

Thanks for your reply. my phenotype file is a .txt file; I do not have any special characters in my column names (ie, ‘failmt’ and ‘failmtsurvyr’).

On Jan 9, 2020, at 2:44 PM, Ezgi Karaesmen notifications@github.com wrote:

Hi, Can you make sure that you don't have any special characters in your column names? For example instead of time to event try "time_to_event? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

karaesmen commented 4 years ago

Do you have any other covariates? Are you including any columns other than event and time to event?

Marie-McM commented 4 years ago

as a test, I just tried to include these two columns, but yes I will have covariates, such as PCs, age, gender

On Jan 9, 2020, at 3:25 PM, Ezgi Karaesmen notifications@github.com wrote:

Do you have any other covariates? Are you including any columns other than event and time to event? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

karaesmen commented 4 years ago

Ok if you're trying without covariates are you assigning NULL to covariates argument? Can you please try that?

Marie-McM commented 4 years ago

Yes, I did here is my command line

plinkCoxSurv(bed.file=bed.file,  covariate.file=covariate.file,         id.column="PID",         time.to.event="failmtsurvyr",         event="failmt",         covariates=NULL,          inter.term=NULL,         print.covs="only",         out.file="/home/failmt_22",         chunk.size=10000,          maf.filter=0.005,          flip.dosage=TRUE,          verbose=TRUE, clusterObj=NULL)

Can it come from the ID column ? this column is coded as a character. I used 0/1 to code the event, and time to event is coded as a time (in years).

thanks

From: Ezgi Karaesmen [notifications@github.com] Sent: Thursday, January 09, 2020 2:44 PM To: suchestoncampbelllab/gwasurvivr Cc: Pigeyre, Marie (MED); Author Subject: Re: [suchestoncampbelllab/gwasurvivr] Error in rnorm(nrow(cox.params$pheno.file)) : invalid arguments (#6)

Hi, Can you make sure that you don't have any special characters in your column names? For example instead of time to event try "time_to_event? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

karaesmen commented 4 years ago

Hi again,

I am very sorry for the delay! If your years don't have any decimals, quite likely they're imported as integers. But these need to be submitted as "numeric" or "double" and not integer. (We certainly need to add a check for this..) Could you please make sure to providetime_to_event as numeric with `as.numeric' function and try again?

Chris-Wills commented 4 years ago

Hi,

Thank you for the excellent software however i am having the same error when attempting to set covariates to NULL for a univariate analysis, there are no special characters in the column names and everything runs fine when i add a single covariate in (binary sex variable). I tried adding a pretend variable of just zeros for every sample but that resulted in this error:

 Error in coxph.fit(X, Y, cox.params$STRATA, cox.params$OFFSET, cox.params$INIT,  : 
  NA/NaN/Inf in foreign function call (arg 6)
In addition: Warning message:
In coxph.fit(X, Y, cox.params$STRATA, cox.params$OFFSET, cox.params$INIT,  :
  Loglik converged before variable  1,2 ; coefficient may be infinite.

Which i presume means the models aren't fitting. Thank you in advance for the help

linnan911106 commented 2 years ago

Hi,

I faced the same issue "Error in rnorm(nrow(cox.params$pheno.file)) : invalid arguments", when running the package. I find that I have to assign at least one covariates, no covariates or covariates=NULL will lead to the error. I wonder if you can help me to run survival without any covariates?

Thank you!

chico836 commented 2 years ago

Hello: I am also unsuccessful in running univariate analysis with covariates set to NULL. I have performed all of the checks as recommended above. Is this package still being supported? Thank you in advance for a reply.

aarizvi commented 2 years ago

Hi @linnan911106 and @chico836 - unfortunately right now univariate analysis is not supported with gwasurvivr.

We do have plans to add this functionality but we are not actively maintaining this package; so its on a backlog with no clear date planned.

The source code is available, however, and you would need to edit the survFit.R function and figure out how to create a coxph(Surv(time, event) ~ 1L) type of model under the same framework we do it.

xulinlinpek commented 1 year ago

Hello, I faced the same issue "Error in rnorm(nrow(cox.params$pheno.file)) : invalid arguments", when running the package without covariates. When I added the covariates, the issue "Error in as.character.default(x) : no method for coercing this S4 class to a vector" would occur. I make sure all my covariates are of numeric. Is there any way to solve this problem? Thank you!