dockerfile used to analyse large dataset on psychosis
274
All data and analyses are on sherlock. In the main directory, there is a file config_sherlock.sh. Sourcing that file will set environment variables used throughout the scripts.
There is a database that collects information about analyses, sessions, problems,... in environment variable DATABASE. There is another database (environment var CLEANTABLE) which is a subset of DATABASE containing subjects ready for analysis.
In the first step, we get the data in BIDS format.
1. On OLIN NIDB, find current content:
$NIDBTABLE in config_sherlock.sh and rerun2. Clean the database and check for new subjects
Run $CODEDIR/00_server_to_local/clean_NIDB.py to clean the new database and to see which subjects should be downloaded and/or bidsified.
for missing subjects on sherlock:
Check the download link on the database
Run the following in an interactive session:
cd $DICOMDIR/import
wget http://olinnidb.org/download/NIDB-XXXX.zip
(replace with download link)
(I wrote a script earlier, but the download slowed down after a while and timed out, so it's better to do it in an interactive session)
Run 01*/00*/00_extract_and_organise.sh: this script will extract the zipfiles and put them in the dicomdir.
Check if all the available data are on sherlock
Run 00*/check_complete_subjects. This will notifiy if there is an incomplete overlap between sherlock and NIDB. I've ignored those warnings for DTI scans or localisers as we don't use these. The program also checks if there are subjects who don't have all of our protocols.
3. On REDCAP, find current content
$TABLEDIR/REDCAP_YearMo.csv$REDCAPTABLE in config_sherlock.sh4. Combine tables in database
Run 00*/database.py: This adds these tables to the database (or creates the database from scratch). This will check different things:
5. Check which analyses are missing
After running 00*/database.py, there are columns con, mriqc, prep and bids. These columns indicate whether these steps have been run. If they are not run, submit these jobs as below.
All analyses will happen based on the cleaned database. We can now run each analysis pipeline, for each subject in the database. The flow:
After checking which subjects should be analysed (see up), run the following command:
sbatch --output=$CODEDIR/01_bids/logs/bids_%a.out \
--error=$CODEDIR/01_bids/logs/bids_%a.err \
--export=ALL \
--job-name=PSY_BIDS \
--array=0-198 \
-N1 $CODEDIR/01_bids/BidsSLURM.sh
This will run the pipeline for subjects with indices 1-199. To run only a few specific subjects, change for example to --array=1,2 to run indices 1 and 2.
manual.pyAfter finishing bidsifying, you can run MRIQC
Takes about 40 minutes per subject
sbatch --output=$CODEDIR/02_mriqc/logs/MRIQC_%a.out \
--error=$CODEDIR/02_mriqc/logs/MRIQC_%a.err \
--export=ALL \
--job-name=PSY_QC \
--array=0-200 \
-N1 $CODEDIR/02_mriqc/MriQCSLURM.sh
Can be run in parallel with MRIQC (after bidsifying)
Takes about 20-25 hours per subject
Analysis of surface (fMRISurface) is commented out as we're not using that for now, same for DWI.
To submit, run:
sbatch --output=$CODEDIR/03_preprocessing/logs/PREP_%a.out \
--error=$CODEDIR/03_preprocessing/logs/PREP_%a.err \
--export=ALL \
--job-name=PSY_PREP \
--array=0-198 \
-N1 $CODEDIR/03_preprocessing/PreProcessingSLURM.sh
Note: in PREPDIR/S*/task-*, the preprocessing generates a HUGE amount of datafiles, which messes up our limits. For that reason, these folders have been tarred using 01*/misc/preproc_tar.sh. It would be probably a good idea to re-run this script after new data have been preprocessed.
Cleans timeseries and creates connectomes for each subject.
To submit, run:
sbatch --output=$CODEDIR/04_connectome/01_timeseries_cleaning/logs/CLEAN_%a.out \
--error=$CODEDIR/04_connectome/01_timeseries_cleaning/logs/CLEAN_%a.err \
--export=ALL \
--job-name=PSY_CLEAN \
--array=0-198 \
-N1 $CODEDIR/04_connectome/01_timeseries_cleaning/CleaningSLURM.sh
To do
Content type
Image
Digest
Size
2.2 GB
Last updated
almost 9 years ago
docker pull joke/psychosis