CONN Toolbox
The Functional Connectivity (CONN)) toolbox for MATLAB is available as an Lmod module on Klone compute nodes.
Use with Lmod
Like all Lmod modules, the conn module is available only on Klone compute nodes, and these commands will not work on the login node.
Checking available versions
Because the module for CONN is installed in the escience hierarchy, its name is prefixed with escience/.
You can check the installed versions as follows:
module spider escience/connThe output should look a bit like this:
---------------------------------------
escience/conn: escience/conn/v.22.a
---------------------------------------
This module can be loaded directly: module load escience/conn/v.22.a
Help:
conn-v.22.a
Running CONN
Load the default version with module load escience/conn or load a specific version with module load escience/conn/version.
After loading the module, start matlab and run conn in the MATLAB command window.
Installing different versions via Lmod
You can install different versions of CONN by following the instructions below.
Go to https://www.nitrc.org/frs/?group_id=279, choose the version of CONN you want to install, copy the download link to the file, and download the file by running the following command on a Klone login or compute node. We’ll use version 21a as an example:
mkdir -p "/gscratch/scrubbed/$USER/downloads" && cd "$_" curl -LO https://www.nitrc.org/frs/download.php/12426/conn21a.zip- 1
-
Create the target directory if it does not exist and navigate to it (
$_is a special variable that expands to the last argument of the previous command). - 2
-
curlis a program you can use to download files from the web. Replace the URL with the URL for the version of CONN you want to install. The-Loption tellscurlto follow redirects, and the-Ooption tells it to save the file to the current directory.
Extract the archive and copy the contents to
/sw/contrib/mylabname-src/conn/21a(replacingmylabnamewith the name of your lab):unzip conn21a.zip -d conn21a.zip # Make sure you include the parentheses around the commands below. Replace "mylabname" with your lab name! (umask 002 && mkdir -p /sw/contrib/mylabname-src/conn/21a && rsync -rlHP --chmod=a+rwX conn21a/conn/ $_) rm -rfv conn21a.zip conn21a- 1
-
Extract the CONN archive to a new directory called
conn21a. - 2
-
In bash, parentheses create a [subshell]((https://tldp.org/LDP/abs/html/subshells.html), which runs the enclosed commands in a new shell session. We want to use it here so that we can temporarily modify the default permissions for new files and directories with the
umaskcommand. Your current settings will remain intact when the commands in the subshell are completed. - 3
- We’re running a series of commands here in a [subshell]((https://tldp.org/LDP/abs/html/subshells.html). Let’s break it down:
- 4
- Remove the downloaded file and the extracted directory.
Use a text editor to create an Lmod
.luamodule file for the new release with a text editor, using21a.luaas the filename:/sw/contrib/modulefiles/mylabname/conn21a.lua
help(myModuleName()) local base = pathJoin( "/sw/contrib", string.gsub(myModuleName(), "/.*$", "-src"), string.gsub(myModuleName(), "^.*/", ""), myModuleVersion() ) whatis("Name: " .. string.gsub(myModuleName(), "^.*/", "")) whatis("Version: " .. myModuleVersion()) depends_on("matlab") depends_on("escience/spm") -- edit this line to match the name of your SPM module append_path("MATLABPATH", base)Check that the module is available and load it:
module -I spider mylabname/conn module load mylabname/conn/21a- 1
-
Lmod takes some time to cache available modules. You can use the
-Ioption to force Lmod to check for new modules.