Hello, I am new to using Snakemake and I am running a test script calling an R script. I work on a restricted server and I have access to a docker R studio server to run everything. However, it seems I am not able to connect the Snakemake to the Rstudio docker. Is that possible? Or do I need to install R?
This is my R script:
args = commandArgs(trailingOnly = TRUE)
num_cells = args[[1]]
write.table("Cells: 1000", num_cells)
This is the Snakemake script (Snakemake_Test1_PS.txt):
rule test_file:
output:
num_cells="all_cells.txt"
shell:
"Rstudio --no_environ Scripts/testing_snakemake.R {output.num_cells}"
Output:
$ snakemake -s Snakemake_Test1_PS.txt
Building DAG of jobs...
Using shell: /usr/bin/bash
Provided cores: 88
Rules claiming more threads will be scaled down.
Job counts:
count jobs
1 read_file
1
[Tue Jul 18 12:38:20 2023]
rule read_file:
output: all_cells.txt
jobid: 0
/usr/bin/bash: Rstudio: command not found
[Tue Jul 18 12:38:20 2023]
Error in rule read_file:
jobid: 0
output: all_cells.txt
shell:
Rstudio --no_environ Scripts/testing_snakemake.R all_cells.txt
(one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)
Thank you!!
Why do you run
Rstudio
and not simplyR
?I would like to run it in the R studio server environment I have. But either way just R doesn't work either. I get the exact same error
So do you run the script inside the docker? Do you run this specific part in the docker?
No, it doesn't work inside the docker because Snakemake isnt recognized. I run the docker using:
but mostly I use the Rstudio webpage interface linked to the docker
sudo
, there is a way to run docker without asudo
, see here.snakemake
in which environment it should run the rule. See here , you should add adocker:
label to your rule.Unfortunately I cannot do that. Although I have sudo access I wasn't given the docker account password. I understand that doesn't really make sense.
Running this:
Gives me this error
What version of snakemake are you using?
It is version 5.9.1
container support was introduced in 4.8.0 so it should work, but your version is quite old. I recommend updating to the latest version and giving it another try.
How do you normally use R/Rsudio on the server? It would appear that it is not installed / available. On our server, R is not available by default and requires running
module load R
to make it available. If it is not available at all you will need to install R and Rstudio for these commands to run.I think thats my issue. I don't know how to have the console access the docker while still using the usual bash interface where Snakemake is. Or if that is even possible