suchestoncampbelllab / gwasurvivr

GWAS Survival Package in R
11 stars 12 forks source link

Error in genotypes[!blankSNPs, cox.params$ids] : subscript out of bounds #19

Open yard2357 opened 3 years ago

yard2357 commented 3 years ago

Hi, I'm trying to running gwasurvivr to do survival analysis.

the code I'm using is as follows:

library(gwasurvivr)

bed.file <- "/home/ziyung/GWASurvivr/GWASI+II_hg38_db153_cleaned_0329.bed"

survival_449 <- (read_csv("GWASurvivr/449_sample.csv"))

sample.ids <- as.character(survival_449$Subject_ID)

plinkCoxSurv(bed.file=bed.file,
             covariate.file=survival_449,
             id.column="Subject_ID",
             sample.ids=sample.ids,
             time.to.event="time_day",
             event="Status_33y",
             covariates=c("age", "sex"),
             inter.term=NULL,
             print.covs="only",
             out.file=paste("out/Survuvr_result/454_sample/survival_449_0426"),
             chunk.size=50,
             maf.filter=0.005,
             flip.dosage=TRUE,
             verbose=TRUE,
             clusterObj=NULL)

I already verify my covariant file and bed file to make sure that my sample id is matched and use 'sample.ids <- as.character(survival_449$Subject_ID)' to assign sample id as class character

but it still shows Error in genotypes[!blankSNPs, cox.params$ids] : subscript out of bounds

do you have any ideas as to what may be causing this?``

tomdudding commented 10 months ago

I am having a similar problem, did anyone find a solution to this issue.

liz19970130 commented 8 months ago

Hi, I have also met this problem, have you solved this question?

aarizvi commented 8 months ago

Hey all - I'm currently not actively maintaining this package, but have you ensured that your sample IDs match whats in the genotype file? I have a PR where I adjusted this but haven't pushed it to main yet as it needs more testing. https://github.com/suchestoncampbelllab/gwasurvivr/pull/28

Let me know is that helps.

Tonnar commented 7 months ago

@aarizvi If the sample ID's are required to match what is in the genotype file how does this work with plink file sets where the unique id is two columns the FID and IID?