Clone wiki

qunex / UsageDocs / Turnkey

QuNex 'turnkey' workflow and 'batch' engine

The QuNex Suite enables 'Turnkey' processing across the supported functions. This feature enables full automation across selected QuNex steps. This is accomplished via the run_turnkey QuNex command that enables one step processing of sessions.

It is less flexible than running individual qunex commands; however, it offers the ability to run the entire QuNex Suite workflow in a single command, either locally or via XNAT.

The QuNex turnkey workflow can be invoked in two ways, which can be specified via the following flag:


The two turnkey workflow options are local or xnat, which will differ in their parameter specification.

  • Note: The command examples below do not provide the exhaustive list of all run_turnkey parameters. To get a full parameter listing invoke help via qunex run_turnkey.

QuNex run_turnkey on a cluster or local workstation

Data assumptions

The raw data folder should be:

        ├── hcp_mapping.txt
        └── parameters.txt

The folder needs to contain the individual session data (dicom, bids, compressed format). If the data is compressed, it is expected to hold a single session and be named using the following specification:

<subject id>_<session id>.zip.

For example, in the case below this would be

In addition, the folder needs to contain the two QuNex settings files:

The run_turnkey command specification

The processing from data ingestion to creation of processing results is then completed by running the following example command, which specifies how to run the turnkey workflow for a local workstation:

# - Folder name to generate

# - Master Working Directory

# - Location for Raw Data

# - Name of session to process

# - Input files

# - Type of QuNex Turnkey run

# - QuNex Turnkey steps

# - Command call
qunex run_turnkey \
  --rawdatainput="${RAW_DATA}" \
  --dataformat="DICOM" \
  --batchfile="${INPUT_BATCH_FILE}" \
  --mappingfile="${INPUT_MAPPING_FILE}" \
  --workingdir="${WORK_DIR}" \
  --projectname="${STUDY_NAME}" \
  --path="${WORK_DIR}/${STUDY_NAME}" \
  --sessions="${SESSIONS_LIST}" \
  --sessionids=${SESSIONS_LIST} \
  --turnkeytype="${RUNTURNKEY_TYPE}" \
  --bolds="all" \
  --runparcellations=all \
  --turnkeysteps="${RUNTURNKEY_STEPS}" \

The breakdown of the parameters is as follows (for full in-line help run qunex run_turnkey at the terminal):

  • turnkeysteps – specifies QuNex commands that are supported as a turnkey step, see the following section for a complete list of turnkey steps

  • rawdatainput – specifies where the input data is to be found

  • dataformat – specifies the type of raw data [DICOM, BIDS, HCPLS]

  • batchfile – specifies the name of the batch parameter file to be used in this study

  • mappingfile – specifies the name of the file that describes the mapping of images to HCP compliant names

  • workingdir – specifies the working directory that will hold the study

  • projectname – the name of the study

  • path – the path to the study (it should be <workingdir>/<projectname>)

  • local_batchfile – the name of the generated batch file with session details (it should be <workingdir>/<projectname>/processing/batch.txt)

  • sessions – the session names to be included in processing

  • sessionids – the session names to be included in processing

  • turnkeytype – 'local' when run on a local machine (i.e. not XNAT)

  • bolds – which bold files to use when generating BOLD QC and functional connectivity results

  • runparcellations – which parcellation files to run

The command will generate QUNEX_UseCase study folder where all the results should be present at the end.

Progress can be tracked by keeping track of the standard out and by log files generated in:



List of Turnkey Steps

Most turnkey steps have exact matching qunex commands with several exceptions that fall into two categories:

  • map_raw_data step is only relevant to run_turnkey, which maps files on a local filesystem or in XNAT to the study folder.
  • run_qc* and compute_bold_fc* are two groups of turnkey steps that have qunex commands as their prefixes. The suffixes of these commands are options of the corresponding qunex command.

A complete list of turnkey commands can be found in List of commands.