saigegit / SAIGE

Development for SAIGE and SAIGE-GENE(+)
GNU General Public License v3.0
68 stars 29 forks source link

createSparseGRM script (step0) doesn’t work #113

Open omrak opened 1 year ago

omrak commented 1 year ago

While trying to run a rare variant burden test for WES data using SAIGE-GENE an error was received while running 'Step 0: Generate sparse GRM'. The run was done in versions 1.1.8 and 1.1.9.

Following the instructions in your guide I ran the 'createSparseGRM.R' script as follows:

Rscript ./extdata/createSparseGRM.R \ --plinkFile=./pkd_project/wes/unsolved_cases/input/PKD_Controls_Exomes_All_Variants_PASS_anno_PKD_Controls_cov \ --nThreads=4 \ --outputPrefix=./pkd_project/wes/unsolved_cases/output/sparseGRM \ --numRandomMarkerforSparseKin=2000 \ --relatednessCutoff=0.125

I got the following output: Loading required package: optparse R version 4.2.3 (2023-03-15) Platform: x86_64-conda-linux-gnu (64-bit) Running under: Ubuntu 20.04.6 LTS

Matrix products: default BLAS/LAPACK: /home/omriteltsh/miniconda3/envs/saige/lib/libopenblasp-r0.3.21.so

locale: [1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8 [4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8 [7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C [10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] optparse_1.7.3 SAIGE_0.45

loaded via a namespace (and not attached): [1] compiler_4.2.3 Matrix_1.5-4 Rcpp_1.0.10 getopt_1.20.3 [5] grid_4.2.3 RcppParallel_5.1.6 lattice_0.21-8

$plinkFile [1] "./pkd_project/wes/unsolved_cases/input/PKD_Controls_Exomes_All_Variants_PASS_anno_PKD_Controls_cov" $bedFile [1] "" $bimFile [1] "" $famFile [1] "" $nThreads [1] 4 $memoryChunk [1] 2 $outputPrefix [1] "./pkd_project/wes/unsolved_cases/output/sparseGRM" $numRandomMarkerforSparseKin [1] 2000 $relatednessCutoff [1] 0.125 $isDiagofKinSetAsOne [1] FALSE $minMAFforGRM [1] 0.01 $maxMissingRateforGRM [1] 0.15 $help [1] FALSE

Error in createSparseGRM(bedFile = bedFile, bimFile = bimFile, famFile = famFile, : unused arguments (bedFile = bedFile, bimFile = bimFile, famFile = famFile, maxMissingRateforGRM = opt$maxMissingRateforGRM) Execution halted

Additionally I tried running this step with the demo data you provided here using exact commands shown in the tutorial and got the same error message. I also tried running this script specifying the path and names of the bim, fam and bed files using the ‘bimFile’, ‘famFile’ and ‘bedFile’ arguments (instead of the ‘plinkFile’ argument) as well as running this script from within R itself line by line but I got the same error message.

Do you think I should run this script in a different way or is there a bug in the code? Since I was not able to generate the exact sparse GRM with the other methods you suggest in the tutorial would greatly appreciate it if you could help me solve this problem so that I can complete the analysis.

Many thanks!

weizhou0 commented 1 year ago

Hi @omrak,

The "unused arguments" error is usually caused by the mismatched version of the wrapper script (./extdata/createSparseGRM.R) and the SAIGE version.  In this example, the bimFile, bedFile, and famFile arguments were implemented in the version > 0.93 on May 3, 2022. If you are using an old SAIGE version but a new createSparseGRM.R with those arguments, you will see these errors.

Could you please give it a try?

Thanks, Wei

vivekruhela commented 1 week ago

Hi,

I am facing the same error. As per your suggestion, I downloaded the recent version from github for both SAIGE and it's wrapper script (i.e. both files are downloaded from the same pull command). Still the same error is coming. I checked with your example data as well.

In my server I am using Saige/1.1.8 singularity image and wrapper script from the latest version in Github. I tried searching for 1.1.8 version to download, but I didn't find it anywhere.

Can you please suggest how to fix this? Thanks