suchestoncampbelllab / gwasurvivr

GWAS Survival Package in R
11 stars 12 forks source link

Error in snpgdsBED2GDS(bed.file, fam.file, bim.file, gdsfile, cvt.chr = "int", #5

Closed hamishinnes closed 4 years ago

hamishinnes commented 5 years ago

Hi, when using gwasurvivr, i am encountering the following error message, which i cant figure out how to get around.

Error in snpgdsBED2GDS(bed.file, fam.file, bim.file, gdsfile, cvt.chr = "int",

of note, when i run the analysis on plink files containing only a small number of variants, the program works perfectly and i dont get this error message. But the problem arises when i try and scale this up to larger files.

I have copied and pasted the output below. here im trying to run an analysis of all chromosome 1 variants available in my genetic dataset.

plinkCoxSurv(bed.file="/users/ptb17163/lustre/EgaDemoClient_2.2.2/plink/gwasready_chr1.bed", covariate.file=df, covariates=c("age", "gender"), id.column="eid_string", time.to.event="X_t", event="fail", out.file="fib4_agesex",inter.termCovariates included in the models are: gender, ageverbose = TRUE, clusterObj = NULL ) 4211 samples are included in the analysis Start snpgdsBED2GDS ... BED file: "/users/ptb17163/lustre/EgaDemoClient_2.2.2/plink/gwasready_chr1.bed" in the SNP-major mode (Sample X SNP) FAM file: "/users/ptb17163/lustre/EgaDemoClient_2.2.2/plink/gwasready_chr1.fam", DONE. BIM file: "/users/ptb17163/lustre/EgaDemoClient_2.2.2/plink/gwasready_chr1.bim", DONE. Wed Sep 11 14:28:23 2019 store sample id, snp id, position, and chromosome. start writing: 487409 samples, 477109 SNPs ... Wed Sep 11 14:28:23 2019 0% Wed Sep 11 14:28:56 2019 4% Wed Sep 11 14:29:33 2019 8% Wed Sep 11 14:30:10 2019 12% Wed Sep 11 14:30:41 2019 16% Wed Sep 11 14:31:17 2019 21% Wed Sep 11 14:31:54 2019 25% Wed Sep 11 14:32:30 2019 29% Wed Sep 11 14:33:06 2019 33% Wed Sep 11 14:33:42 2019 38% Wed Sep 11 14:34:19 2019 42% Wed Sep 11 14:34:55 2019 46% Wed Sep 11 14:35:31 2019 50% Wed Sep 11 14:36:07 2019 55% Wed Sep 11 14:36:43 2019 59% Wed Sep 11 14:37:20 2019 63% Wed Sep 11 14:37:51 2019 67% Error in snpgdsBED2GDS(bed.file, fam.file, bim.file, gdsfile, cvt.chr = "int", : Stream write error Timing stopped at: 390 113.8 598.2

aarizvi commented 5 years ago

@hamishinnes -- are you able to convert the plink files (.bed, .bim, .bam) to GDS using SNPRelate? SNPRelate::snpgdsBED2GDS()?

Also, the copy and paste of the gwasurvivr command you ran seems to be a bit messed up, can you verify that it's not as shown above.

Let me know if that works and if so I'll debug this with you a bit more.

hamishinnes commented 4 years ago

Hi thank you so much for your help so far I have partly managed to solve this issue by changing my temporary directory in R to a new temporary directory with a larger storage space.

However, after doing this, i'm now encountering a different error message with PlinkCoxSurv as follows: "Error in cleanup.gds(out.gdsfn, verbose = verbose) : Stream write error".

ive tried to break down by chromosome, and it works for chromosome 1-9, but then fails on chromosome #10

Ive pasted output below from (albeit this is not exactly what appears on the screen as it is run, because im running this interactively)

* Compression time ** User:372.02 System: 175.226 Elapsed: 1111.89


Analyzing part 1/32... Analyzing part 2/32... Analyzing part 3/32... Analyzing part 4/32... Analyzing part 5/32... Analyzing part 6/32... Analyzing part 7/32... Analyzing part 8/32... Analyzing part 9/32... Analyzing part 10/32... Analyzing part 11/32... Analyzing part 12/32... Analyzing part 13/32... Analyzing part 14/32... Analyzing part 15/32... Analyzing part 16/32... Analyzing part 17/32... Analyzing part 18/32... Analyzing part 19/32... Analyzing part 20/32... Analyzing part 21/32... Analyzing part 22/32... Analyzing part 23/32... Analyzing part 24/32... Analyzing part 25/32... Analyzing part 26/32... Analyzing part 27/32... Analyzing part 28/32... Analyzing part 29/32... Analyzing part 30/32... Analyzing part 31/32... Analyzing part 32/32... 0 SNPs were removed from the analysis for not meeting the given threshold criteria or for having MAF = 0 List of removed SNPs are saved to fib4_agesex_chr10.snps_removed In total 315584 SNPs were included in the analysis The Cox model results output was saved to fib4_agesex_chr10.coxph Analysis completed on 2019-09-21 at 14:13:11 Covariates included in the models are: gender, age 4211 samples are included in the analysis Error in cleanup.gds(out.gdsfn, verbose = verbose) : Stream write error Calls: plinkCoxSurv -> system.time -> snpgdsBED2GDS -> cleanup.gds Timing stopped at: 371.1 155.3 953 Execution halted