Thank you so much this indeed solved my issue!
On Sat, Nov 23, 2019 at 3:05 PM Henrik Bengtsson
wrote:
>
> Looking at the https://github.com/eleporcu/TWMR/blob/master/README.txt,
> it looks like you should pass a single argument when you call the MR.R
> script and it should be the name of a
Looking at the https://github.com/eleporcu/TWMR/blob/master/README.txt,
it looks like you should pass a single argument when you call the MR.R
script and it should be the name of a gene, e.g. 'ENSG0154803'.
You are passing two arguments and they look like filenames.
Update the script, because
it is confusing because in documentation they say this is how you run
the script:
https://github.com/eleporcu/TWMR
I tried changing this on the script:
cmd_args=commandArgs(TRUE)
print(cmd_args)
gene<-cmd_args[3]
Ngwas<-239087
N_eQTLs<-32000
out<-c("gene","alpha","SE","P","Nsnps","Ngene")
Maybe it would help to add:
file<-paste(gene,"matrix",sep=".")
if (!file.exists(file)) stop("File not found: ", file)
filecluster<-read.table(file,header=T,sep=" ",dec=".")
/Henrik
On Sat, Nov 23, 2019 at 11:55 AM Duncan Murdoch
wrote:
>
> On 23/11/2019 1:21 p.m., Ana Marija wrote:
> > Hi
On 23/11/2019 1:21 p.m., Ana Marija wrote:
Hi Duncan,
thanks, I just did,
Rscript --no-save MR.R ENSG0154803.ld ENSG0154803.matrix
[1] "ENSG0154803.ld" "ENSG0154803.matrix"
Error in file(file, "rt") : cannot open the connection
Calls: read.table -> file
In addition:
Hi Duncan,
thanks, I just did,
Rscript --no-save MR.R ENSG0154803.ld ENSG0154803.matrix
[1] "ENSG0154803.ld" "ENSG0154803.matrix"
Error in file(file, "rt") : cannot open the connection
Calls: read.table -> file
In addition: Warning message:
In file(file, "rt") :
cannot open
On 23/11/2019 11:05 a.m., Ana Marija wrote:
Hi Ben,
I am not sure what you mean when you say to print, is it this?
cmd_args=commandArgs(TRUE)
print(cmd_args)
character(0)
cmd_args=commandArgs()
print(cmd_args)
[1] "/software/linux-el7-x86_64/compilers/r-3.6.1/lib64/R/bin/exec/R"
I changed
Hi Ben,
I am not sure what you mean when you say to print, is it this?
> cmd_args=commandArgs(TRUE)
> print(cmd_args)
character(0)
> cmd_args=commandArgs()
> print(cmd_args)
[1] "/software/linux-el7-x86_64/compilers/r-3.6.1/lib64/R/bin/exec/R"
I changed in the first line of this script:
On 23/11/2019 10:26 a.m., Ana Marija wrote:
HI Ben,
I tried it but it doesn't work:
Rscript --no-save MR.R ENSG0154803.ld ENSG0154803.matrix
Error in file(file, "rt") : cannot open the connection
Calls: read.table -> file
In addition: Warning message:
In file(file, "rt") :
cannot
HI Ben,
I tried it but it doesn't work:
Rscript --no-save MR.R ENSG0154803.ld ENSG0154803.matrix
Error in file(file, "rt") : cannot open the connection
Calls: read.table -> file
In addition: Warning message:
In file(file, "rt") :
cannot open file '--no-restore.matrix': No such file or
Hi,
I think you want this order...
Rscript [options for R] script_file.R argument_1 argument_2 ...
So, like this ...
Rscript --no-save MR.R ENSG0154803.ld ENSG0154803.matrix
Cheers,
Ben
On Fri, Nov 22, 2019 at 8:59 PM Ana Marija wrote:
>
> HI Ben,
>
> thank you so much , I did this:
HI Ben,
thank you so much , I did this:
Rscript --no-save ENSG0154803.ld ENSG0154803.matrix MR.R
Error: unexpected numeric constant in "1.000 0.089"
Execution halted
I made ENSG0154803.ld with:
library(MASS)
write.matrix(ENSG0154803.ld, file="ENSG0154803.ld")
and it looks
Hi,
You might check the order of your arguments. Options come before the
script filename. See the details here...
https://www.rdocumentation.org/packages/utils/versions/3.6.1/topics/Rscript
Ben
On Fri, Nov 22, 2019 at 8:17 PM Ana Marija wrote:
>
> Hello,
>
> I am trying to run this code:
>
Hello,
I am trying to run this code:
https://github.com/eleporcu/TWMR/blob/master/MR.R
with r-3.6.1
via:
Rscript MR.R --no-save ENSG0154803
in the current directory I have saved: ENSG0154803.ld and
ENSG0154803.matrix as the software requires
but I am getting this error:
Error in
14 matches
Mail list logo