Running MIRACL on Compute Canada

This tutorial highlights the registration workflow but a similar approach applies to other commands.

When using Compute Canada, MIRACL can be used as a Apptainer/Singularity container.

Copy your data to Compute Canada

For example, to copy a folder called input_clar containing tiff files you want to register to the Allen Atlas use:

$ scp -r input_clar niagara.computecanada.edu:/scratch/<username>/.

or

$ rsync -avPhz input_clar <username>@niagara.computecanada.edu:/scratch/<username>/.

Alternatively, for large datasets, or if you desire a GUI, you can setup a Globus transfer server by following instructions on the Digital Research Alliance of Canada wiki.

Log in to Compute Canada server

Log in to the Compute Canada server you copied your data to:

$ ssh -XY <username>@niagara.computecanada.edu

Setting up and using MIRACL

Load the specific Apptainer/Singularity module you would like to use (e.g. Apptainer 1.2.4):

$ module load apptainer/1.2.4

Note

Not specifying the version will load the latest version available on your node

Since MIRACL will take up a significant amount of space, it is recommended to download and work with the MIRACL Apptainer/Singularity container in the scratch directory. First, navigate there:

$ cd $SCRATCH

Then pull (download) the Apptainer/Singularity container:

$ apptainer pull miracl_latest.sif library://aiconslab/miracl/miracl:latest

Attention

If you encouter the following error with the pull command:

FATAL:   Unable to get library client configuration: remote has no library client (see https://apptainer.org/docs/user/latest/endpoint.html#no-default-remote)

This error can be resolved by adding the default Apptainer end point from which the container is downloaded. Use:

apptainer remote add --no-login SylabsCloud cloud.sylabs.io

then:

apptainer remote use SylabsCloud

Now you should be able to pull the container using the commands described earlier.

Attention

singularity pull requires Singularity version 3.0.0 or higher. Please refer to our Troubleshooting section (“Q: Can I build a Singularity container from the latest MIRACL image on Docker Hub”) if you are using an older version of Singularity.

Note

If you have a particular Singularity container of MIRACL that you want to use on Compute Canada, just copy it to the servers directly using e.g. scp or rsync instead of pulling (downloading) the latest version of MIRACL from the Singularity registry

Start the MIRACL Apptainer/Singularity container with the default folders mounted:

$ apptainer shell miracl_latest.sif bash

Singularity will automatically mount your scratch folder to your container. If you need to mount a specific directory into a specific location, use the following:

$ singularity shell -B <location_outside_container>/<source_mount>:<location_in_container>/<target_mount> miracl_latest.sif bash

Once you are logged in to the container, load the GUI from the shell:

$ miraclGUI

Note

Please consult our Troubleshooting section on Singularity if you experience problems with opening MIRACL's GUI on Compute Canada

Or use MIRACL from the command line. For example, run MIRACL's CLARITY registration workflow on the folder that you copied over previously:

$ miracl flow reg_clar -f input_clar -n "-d 5 -ch autofluo" -r "-o ARS -m combined -v 25"

Note

If you have a particular Singularity container of MIRACL that you want to use on Compute Canada, just copy it to the servers directly using e.g. scp or rsync instead of pulling (downloading) the latest version of MIRACL from the Singularity registry

Jupyter notebook

An accompanying Jupyter notebook for this tutorial can be found here.