Running on NMRBox - EBI-Metabolights/SAFERnmr GitHub Wiki
Running on NMRBox
We have had good success running SAFER on NMRBox, and recommend trying it as it's pretty fast.
We maintain a Docker Image from which a Singularity Image is built on your workspace (it will remain there, so only need to run the first time, or when updating):
singularity pull docker://mtbls/safer-nmr
Next, open an R session in the terminal:
singularity exec safer-nmr_latest.sif R
Load the R package in the R session. This makes all the SAFER functions available:
library(SAFERnmr)
Note:
If you want to use the most current version of the repository on any branch (instead of using the Docker version), you can do so by calling
devtools::document('path/to/local/safer/repo')
instead oflibrary(SAFERnmr)
Finally, run the pipeline command (assuming your parameter file is set up and saved!):
pipeline(params_loc = '…/param_template.yaml')
And visualize your results on the NMRbox browser or download the results directory, unzip, start the R session, rebuild the package, and run locally.):
browse_evidence('path_data_directory')
The dockerfile for SAFERnmr is as follows:
RUN Rscript -e "install.packages('apcluster')"
RUN Rscript -e "install.packages('DEoptimR')"
RUN Rscript -e "install.packages('sass')"
RUN Rscript -e "install.packages('openssl')"
RUN Rscript -e "install.packages('remotes')"
RUN Rscript -e "devtools::install_github('EBI-Metabolights/SAFERnmr')"
CMD ["R"]
Create a file called Dockerfile (making sure there are no other Dockerfiles in the same directory) and run docker build -t your_tag/safer_your_version .
This will create a local image of SAFERnmr. You do not then need to push the image to dockerhub - modifying an earlier command, you can run something like singularity pull docker-daemon://your_tag/safer_your_version:latest
and this will create a singularity container that you can use.
If you are getting stuck running SAFER on NMRBox then feel free to raise an issue here on github, open a discussion here on github or email me directly at [email protected]