suchestoncampbelllab / gwasurvivr

GWAS Survival Package in R
11 stars 12 forks source link

Error in if (nrow(genotypes) > 0) { : argument is of length zero #10

Closed kateishim closed 4 years ago

kateishim commented 4 years ago

Hello. Thank you very much for creating and maintaining this great tool!

I tried to use plinkCoxSurv but encountered several error messages. When I was trying with chr1, Error in snpgdsBED2GDS(bed.file, fam.file, bim.file, gdsfile, cvt.chr = "int", : Stream write error occurred, so I tried with chr22 as below, then now I am getting this error message at the same part.

Analyzing part 251/2585... Analyzing part 252/2585... Analyzing part 253/2585... Error in if (nrow(genotypes) > 0) { : argument is of length zero

plinkCoxSurv(bed.file="/data/chr22.bed", covariate.file=covariate.file, id.column="IID", sample.ids=sample.ids, time.to.event="age", event="event", covariates=c("SexFemale", "GenoArray", "pc1", "pc2", "pc3", "pc4", "pc5", "pc6", "pc7", "pc8", "pc9", "pc10"), inter.term=NULL, print.covs="only", out.file="chr22", chunk.size=50, maf.filter=0.05, flip.dosage=TRUE, verbose=TRUE, clusterObj=NULL)

I would like to ask you how to solve these two errors. Thank you for your help in advance!

aarizvi commented 4 years ago

Hi,

Fo the second error -- can you try a larger chunk size? Maybe something like chunk.size=1000.

For chr1 it's a bit unclear whats going on there. Perhaps you can give more details on the inputs.

kateishim commented 4 years ago

Hi,

For the first error, I resolved the error as moving R temporary directory to a directory with more storage space referring to https://github.com/suchestoncampbelllab/gwasurvivr/issues/5.

For the second error, trying a larger chuck size worked well.

Thank you for your help! :)