|
| 1 | +# xcpEngine on Argon |
| 2 | + |
| 3 | +This guide is based off of [xcpEngine's own tutorial](https://xcpengine.readthedocs.io/config/tutorial.html) |
| 4 | + |
| 5 | +This a guide for running [xcpEngine](https://xcpengine.readthedocs.io/index.html) on [Argon](https://wiki.uiowa.edu/display/hpcdocs/Argon+Cluster). |
| 6 | +xcpEngine is a tool that takes the output from [fmriprep](https://fmriprep.readthedocs.io/en/stable/) |
| 7 | +and completes a variety of analytical outputs (e.g. reho, alff, etc) as both niftis and tabular data (i.e. CSVs). |
| 8 | +The CSV data is data from a per-region/parcel basis from an atlas. |
| 9 | +xcpEngine supports several atlases, so you can get output from several atlas in one run. |
| 10 | + |
| 11 | +The first step will be to log into argon (through a terminal) |
| 12 | +``` |
| 13 | + |
| 14 | +ssh <hawkid>@argon.hpc.uiowa.edu |
| 15 | +``` |
| 16 | +and if you're off campus, you can use port 40 |
| 17 | +``` |
| 18 | +ssh <hawkid>@argon.hpc.uiowa.edu -p 40 |
| 19 | +``` |
| 20 | + |
| 21 | +While logged into Argon, we will be using the [singularity](https://www.sylabs.io/guides/2.6/user-guide/) |
| 22 | +image of xcpEngine so we can run it on Argon without having to worry about installing all the necessary software. |
| 23 | +Even though xcpEngine does not have an image on [singularityhub](https://singularity-hub.org/), |
| 24 | +we can build a singularity image from xcpEngine's docker image on [dockerhub](https://hub.docker.com/r/pennbbl/xcpengine). |
| 25 | + |
| 26 | +It's better to build from a tagged version of an image (e.g. `1.0`) instead of `lastest` because `latest` represents |
| 27 | +the most current version of the image and everytime they change the image, the `latest` tag will now point to a different image. |
| 28 | +If we want to be reproducible (it's all the rage these days), using the tag `1.0` should always point to the same |
| 29 | +image across eternity and should always give us the same result. |
| 30 | + |
| 31 | +``` |
| 32 | +# make a place to keep our singularity images |
| 33 | +mkdir -p ${HOME}/simgs |
| 34 | +# make our singularity image |
| 35 | +singularity build ~/simgs/xcpEngine_v1.0.simg docker://pennbbl/xcpengine:1.0 |
| 36 | +``` |
| 37 | + |
| 38 | +To run xcpEngine, we need data, specifically data that has been processed by fmriprep. |
| 39 | +Thankfully, the developers of xcpEngine have provided an example dataset. |
| 40 | +``` |
| 41 | +# url of the data |
| 42 | +curl -o fmriprep.tar.gz -SL https://ndownloader.figshare.com/files/13598186 |
| 43 | +# untar (extract) the data |
| 44 | +tar xvf fmriprep.tar.gz |
| 45 | +``` |
| 46 | + |
| 47 | +Next, we need two files: 1) a design file that defines what steps we want to run on our data |
| 48 | +and 2) a cohort file that specifies which participants to run. |
| 49 | + |
| 50 | +``` |
| 51 | +# download the design file (if necessary) |
| 52 | +curl -O https://raw.githubusercontent.com/PennBBL/xcpEngine/master/designs/fc-36p.dsn |
| 53 | +``` |
| 54 | + |
| 55 | +Here are the internals of the cohort file: |
| 56 | +``` |
| 57 | +id0,img |
| 58 | +sub-1,fmriprep/sub-1/func/sub-1_task-rest_space-T1w_desc-preproc_bold.nii.gz |
| 59 | +``` |
| 60 | + |
| 61 | +All we need now is a directory to place the outputs, then we can run xcpEngine. |
| 62 | +``` |
| 63 | +mkdir -p ./xcp_output |
| 64 | +``` |
| 65 | + |
| 66 | +Now we are ready to run xcpEngine! |
| 67 | +I made a little script to help make a "job" file we can submit to the cluster. |
| 68 | +It requires our email address as input: |
| 69 | +``` |
| 70 | + |
| 71 | +``` |
| 72 | + |
| 73 | +`create_job.sh` should create a "job" file named `sample_xcpengine.job` that looks like this: |
| 74 | +``` |
| 75 | +#!/bin/bash |
| 76 | +
|
| 77 | +#$ -pe smp 6 |
| 78 | +#$ -q UI |
| 79 | +#$ -m bea |
| 80 | + |
| 81 | +#$ -e /Users/jdkent/xcpEngine/fc.err |
| 82 | +#$ -o /Users/jdkent/xcpEngine/fc.out |
| 83 | +
|
| 84 | +singularity run -H /Users/jdkent/singularity_home \ |
| 85 | +/Users/jdkent/simgs/xcpEngine_v1.0.simg \ |
| 86 | +-d /Users/jdkent/xcpEngine/fc-36p.dsn \ |
| 87 | +-c /Users/jdkent/xcpEngine/func_cohort.csv \ |
| 88 | +-o /Users/jdkent/xcpEngine/xcp_output \ |
| 89 | +-t 1 -r /Users/jdkent/xcpEngine |
| 90 | +``` |
| 91 | + |
| 92 | +and we can submit `sample_xcpengine.job` to the cluster using: |
| 93 | +``` |
| 94 | +qsub sample_xcpengine.job |
| 95 | +``` |
| 96 | + |
| 97 | +We will get an email when the job starts and finishes. |
| 98 | + |
| 99 | +And you're done running it! |
| 100 | + |
| 101 | +TODO: analyze the outputs |
| 102 | + |
0 commit comments