Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createSparseGRM error #434

Open
BIjoy92 opened this issue Jul 25, 2023 · 0 comments
Open

createSparseGRM error #434

BIjoy92 opened this issue Jul 25, 2023 · 0 comments

Comments

@BIjoy92
Copy link

BIjoy92 commented Jul 25, 2023

I would like to analyze rare variants for WGS data using SAIGE-GENE.
Then I ran createSparseGRM.R to perform the "Step 0: Creating a sparse GRM" process, and the code is as below.

`#!/usr/bin/env Rscript

options(stringsAsFactors=F)

load R libraries

#library(SAIGE, lib.loc="/home/wei/install_dir/0.36.5.1")
library(SAIGE)
require(optparse) #install.packages("optparse")

print(sessionInfo())

set list of cmd line arguments

option_list <- list(
make_option("--plinkFile", type="character",default="",
help="path to plink file for creating the genetic relationship matrix (GRM)"),
make_option("--nThreads", type="integer", default=16,
help="Number of threads (CPUs) to use"),
make_option("--memoryChunk", type="numeric", default=2,
help="The size (Gb) for each memory chunk. By default, 2"),
make_option("--outputPrefix", type="character", default="/",
help="path and prefix to the output files [default='
/']"),
make_option("--numRandomMarkerforSparseKin", type="integer", default=2000,
help="number of randomly selected markers to be used to identify related samples for sparse GRM [default=2000]"),
make_option("--relatednessCutoff", type="numeric", default=0.125,
help="The threshold to treat two samples as unrelated if IsSparseKin is TRUE [default=0.125]"),
make_option("--isDiagofKinSetAsOne", type="logical", default=FALSE,
help="Whether to set the diagnal elements in GRM to be 1 [default='FALSE']."),
make_option("--minMAFforGRM", type="numeric", default=0.01,
help="minimum MAF of markers used for GRM")
)

list of options

parser <- OptionParser(usage="%prog [options]", option_list=option_list)
args <- parse_args(parser, positional_arguments = 0)
opt <- args$options
print(opt)

set.seed(1)

createSparseGRM(plinkFile = opt$plinkFile,
outputPrefix=opt$outputPrefix,
numRandomMarkerforSparseKin = opt$numRandomMarkerforSparseKin,
relatednessCutoff = opt$relatednessCutoff,
memoryChunk = opt$memoryChunk,
isDiagofKinSetAsOne = opt$isDiagofKinSetAsOne,
nThreads = opt$nThreads,
minMAFforGRM = opt$minMAFforGRM)`

Rscript createSparseGRM.R \ --plinkFile=/input_path/WGS_plink_file \ --nThreads=4 \ --outputPrefix=./output/sparseGRM \ --numRandomMarkerforSparseKin=2000 \ --relatednessCutoff=0.125

But I got an error code
Error in createSparseGRM(plinkFile = opt$plinkFile, outputPrefix = opt$outputPrefix, :
unused argument (plinkFile = opt$plinkFile)
Execution halted

How can I solve this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant