Skip to content
Prev 381802 / 398502 Next

cannot open file '--no-restore.matrix'

On 23/11/2019 10:26 a.m., Ana Marija wrote:
You should print the cmd_args variable that is set on the first line of 
that script.  When I run a script that prints it using your command 
line, this is what it looks like:

$ Rscript --no-save MR.R ENSG00000154803.ld ENSG00000154803.matrix
[1] "/Library/Frameworks/R.framework/Resources/bin/exec/R"
[2] "--slave"
[3] "--no-restore"
[4] "--no-save"
[5] "--file=MR.R"
[6] "--args"
[7] "ENSG00000154803.ld"
[8] "ENSG00000154803.matrix"

The next line

gene <- cmd_args[3]

is obviously wrong for my system, because it would set gene to 
"--no-restore".  Your results will probably be somewhat different, but 
it might be clear what you should use instead of the third element.

By the way, changing the first line

cmd_args=commandArgs()

to

cmd_args <- commandArgs(TRUE)

makes a lot of sense in most cases.  I haven't read your whole script so 
I don't know it it makes sense for you.

Duncan Murdoch