NeuroDesk / neurocontainers

The containers can be used in combination with our transparent singularity or neurocommand tool, that wrap the executables inside a container to make them easily available for pipelines
https://www.neurodesk.org
MIT License
19 stars 49 forks source link

AFNI + cmdstanr #663

Open araikes opened 4 months ago

araikes commented 4 months ago

Is it possible to have an AFNI container than bundles cmdstanr? RBA can take advantage of multi-core setups but only if cmdstanr is installed and available.

There's a docker file example here but it's built on rocker/tidyverse rather than fedora 35

stebo85 commented 4 months ago

Dear @araikes,

Yes, that looks feasible. AFNI provides instructions for it: https://afni.nimh.nih.gov/pub/dist/doc/program_help/RBA.html

Installation requirements: ~1~
In addition to R installation, the R package "brms" is required for RBA. Make
sure that you have the most recent version of R. To install "brms", run the following
command at the terminal:

rPkgsInstall -pkgs "brms" -site http://cran.us.r-project.org"/

Alternatively, you may install them in R:

install.packages("brms")

*** To take full advantage of parallelization, install both 'cmdstan' and 
'cmdstanr' and use the option -WCP in MBA. However, extra stpes are required: 
both 'cmdstan' and 'cmdstanr' have to be installed. To install 'cmdstanir',
execute the following command in R:

install.packages('cmdstanr', repos = c('[https://mc-stan.org/r-packages/',](https://mc-stan.org/r-packages/) getOption('repos')))

Then install 'cmdstan' using the following command in R:

cmdstanr::install_cmdstan(cores = 2)
# Follow the instruction here for the installation of 'cmdstan': 
#    https://mc-stan.org/cmdstanr/articles/cmdstanr.html
# If 'cmdstan' is installed in a directory other than home, use option -StanPath 
# to specify the path (e.g., -StanPath '~/my/stan/path').

In addition, if you want to show the ridge plots of the posterior distributions
through option -ridgePlot, make sure that the following R packages are installed:

data.table
ggplot2
ggridges
dplyr
tidyr
scales

Would you like to add this to the AFNI recipe here? https://github.com/NeuroDesk/neurocontainers/blob/master/recipes/afni/build.sh

Thank you Steffen

araikes commented 4 months ago

@stebo85,

I will work on it.

stebo85 commented 4 months ago

great :) Let me know if you need help. It should be a straight forward change hopefully!

stebo85 commented 3 weeks ago

Dear @araikes - any updates on this?