Skip to content

Subworkflow initialization

This tutorial series focusing on the contribution of a subworkflow to nf-neuro. In it, you will create a subworkflow from anatomical MRI preprocessing, using components already implemented in nf-neuro for denoising, brain extraction, intensity normalization and segmentation.

[Skip if working in the devcontainer] If not done already, clone the nf-neuro repository locally and navigate to it :

Terminal window
git clone https://github.com/scilus/nf-neuro.git
cd nf-neuro

Create a new branch for your subworkflow. To help you and maintainers track changes, use the convention subworkflow/<category>_<tool> for the branch name (we’ll use : subworkflow/preproc_anat) :

Terminal window
git checkout -b subworkflow/preproc_anat

Open a terminal (with access to the nf-core command). Use cd to move to the location of the nf-neuro repository and generate the subworkflow’s skeleton :

Terminal window
nf-core subworkflows create

Answer the prompts using the information below :

  1. Name of subworkflow : preproc_anat.
  2. Github author : your Github handle (prefixed with @), or @scilus if you prefer no accreditation.

Alternatively, you can use the following command to supply all information :

Terminal window
nf-core subworkflows create --author @scilus preproc_anat

The command will generate your new subworkflow template in the subworkflows/nf-neuro/preproc_anat/ directory. Navigate to it and familiarize yourself with the various files generated. After that, switch to the next section of the tutorial and proceed to edit the main.nf file.