Skip to content

Commit

Permalink
move checkup to workflow, update docs, and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gagnonanthony committed Jan 9, 2025
1 parent 7340fce commit 8b8e8ab
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased] - [2025-01-08]

### `Added`

- Required --dti_shells and --fodf_shells parameters.

### `Changed`

- Fastsurfer and freesurfer outputs are now in their own dedicated output folder.
Expand Down
4 changes: 2 additions & 2 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ An [example samplesheet](../assets/samplesheet.csv) has been provided with the p
The typical command for running the pipeline is as follows:

```bash
nextflow run scilus/nf-pediatric -r main --input ./samplesheet.csv --outdir ./results -profile docker
nextflow run scilus/nf-pediatric -r main --input ./samplesheet.csv --outdir ./results --dti_shells "0 1000" --fodf_shells "0 1000" -profile docker
```

This will launch the pipeline with the `docker` configuration profile. See below for more information about profiles.
This will launch the pipeline with the `docker` configuration profile. There is only 4 parameters that need to be supplied at runtime: `--input`: for the path to your samplesheet, `--oudir`: path to the output directory, `--dti_shells`: if the tracking profile is selected, you need to identify which shell to use for DTI fitting (0 and 1000 were selected in the previous example), and `--fodf_shells`: if the tracking profile is selected, specify your shells as for the DTI parameter. See below for more information about profiles.

Note that the pipeline will create the following files in your working directory:

Expand Down
2 changes: 0 additions & 2 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@
"fa_icon": "fas fa-brain",
"description": "Options for DTI processing.",
"help_text": "These options are used to configure the DTI processing steps in the pipeline. You can use these options to customise the behaviour of the DTI processing steps.",
"required": ["dti_shells"],
"properties": {
"dti_shell_tolerance": {
"type": "integer",
Expand Down Expand Up @@ -537,7 +536,6 @@
"fa_icon": "fas fa-brain",
"description": "Options for FODF processing.",
"help_text": "These options are used to configure the FODF processing steps in the pipeline. You can use these options to customise the behaviour of the FODF processing steps.",
"required": ["fodf_shells"],
"properties": {
"fodf_shell_tolerance": {
"type": "integer",
Expand Down
12 changes: 12 additions & 0 deletions tests/chained.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ nextflow_pipeline {
params.connectomics = true
params.tracking = true

params.dti_shells = "0 1000"
params.fodf_shells = "0 1000"

}
}

Expand Down Expand Up @@ -85,6 +88,9 @@ nextflow_pipeline {
params.tracking = true
params.freesurfer = true

params.dti_shells = "0 1000"
params.fodf_shells = "0 1000"

params.use_fastsurfer = true
params.fs_license = "https://www.dropbox.com/scl/fi/0s8lp6lydyd0rxawxb4jm/license.txt?rlkey=hz54oc0d4sor69avqphtrjvgn&st=9e0yij97&dl=0"
}
Expand Down Expand Up @@ -122,6 +128,9 @@ nextflow_pipeline {
params.connectomics = true
params.tracking = true

params.dti_shells = "0 1000"
params.fodf_shells = "0 1000"

}
}

Expand Down Expand Up @@ -164,6 +173,9 @@ nextflow_pipeline {
params.local_min_len = 15
params.local_fa_seeding_mask_threshold = 0.10

params.dti_shells = "0 1000"
params.fodf_shells = "0 1000"

}
}

Expand Down
6 changes: 6 additions & 0 deletions tests/multisubjects.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ nextflow_pipeline {
params.outdir = "$outputDir"
params.use_fastsurfer = true

params.dti_shells = "0 1000"
params.fodf_shells = "0 1000"

params.connectomics = true
params.tracking = true
params.freesurfer = true
Expand Down Expand Up @@ -55,6 +58,9 @@ nextflow_pipeline {
params.tracking = true
params.infant = true

params.dti_shells = "0 1000"
params.fodf_shells = "0 1000"

// ** Infant specific parameters ** //
params.dwi_run_synthstrip = true
params.dwi_normalize_fa_mask_threshold = 0.10
Expand Down
66 changes: 66 additions & 0 deletions tests/tracking.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ nextflow_pipeline {
params.input = "$projectDir/tests/data/samplesheet_testtracking.csv"
params.outdir = "$outputDir"

params.dti_shells = "0 1000"
params.fodf_shells = "0 1000"

params.tracking = true

}
Expand Down Expand Up @@ -43,6 +46,9 @@ nextflow_pipeline {
params.input = "$projectDir/tests/data/samplesheet_testtracking.csv"
params.outdir = "$outputDir"

params.dti_shells = "0 1000"
params.fodf_shells = "0 1000"

params.tracking = true
params.skip_dwi_preprocessing = true

Expand Down Expand Up @@ -76,6 +82,9 @@ nextflow_pipeline {

params.tracking = true

params.dti_shells = "0 1000"
params.fodf_shells = "0 1000"

}
}

Expand All @@ -85,6 +94,48 @@ nextflow_pipeline {
}
}

test("Tracking profile no dti shells - should fail") {

when {
params {

params.input = "$projectDir/tests/data/samplesheet_testtracking_norev.csv"
params.outdir = "$outputDir"

params.tracking = true

params.fodf_shells = "0 1000"

}
}

then {
assert workflow.failed
assert workflow.stdout.contains("Please provide the DTI shells using --dti_shells parameter")
}
}

test("Tracking profile no fodf shells - should fail") {

when {
params {

params.input = "$projectDir/tests/data/samplesheet_testtracking_norev.csv"
params.outdir = "$outputDir"

params.tracking = true

params.dti_shells = "0 1000"

}
}

then {
assert workflow.failed
assert workflow.stdout.contains("Please provide the FODF shells using --fodf_shells parameter")
}
}

test("Tracking profile no dwi - should fail") {

when {
Expand All @@ -93,6 +144,9 @@ nextflow_pipeline {
params.input = "$projectDir/tests/data/samplesheet_testtracking_nodwi.csv"
params.outdir = "$outputDir"

params.dti_shells = "0 1000"
params.fodf_shells = "0 1000"

params.tracking = true

}
Expand Down Expand Up @@ -126,6 +180,9 @@ nextflow_pipeline {
params.local_fa_seeding_mask_threshold = 0.10
params.run_local_tracking = true

params.dti_shells = "0 1000"
params.fodf_shells = "0 1000"

}
}

Expand Down Expand Up @@ -167,6 +224,9 @@ nextflow_pipeline {
params.local_min_len = 15
params.local_fa_seeding_mask_threshold = 0.10

params.dti_shells = "0 1000"
params.fodf_shells = "0 1000"

}
}

Expand All @@ -187,6 +247,9 @@ nextflow_pipeline {
params.tracking = true
params.infant = true

params.dti_shells = "0 1000"
params.fodf_shells = "0 1000"

// ** Infant specific parameters ** //
params.dwi_run_synthstrip = true
params.dwi_normalize_fa_mask_threshold = 0.10
Expand Down Expand Up @@ -217,6 +280,9 @@ nextflow_pipeline {
params.tracking = true
params.infant = true

params.dti_shells = "0 1000"
params.fodf_shells = "0 1000"

// ** Infant specific parameters ** //
params.dwi_run_synthstrip = true
params.dwi_normalize_fa_mask_threshold = 0.10
Expand Down
3 changes: 3 additions & 0 deletions workflows/pediatric.nf
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ workflow PEDIATRIC {
//
if ( params.tracking ) {

if ( !params.dti_shells ) { error "Please provide the DTI shells using --dti_shells parameter" }
if ( !params.fodf_shells ) { error "Please provide the FODF shells using --fodf_shells parameter" }

/* Load topup config if provided */
if ( params.dwi_susceptibility_config_file ) {
if ( file(params.dwi_susceptibility_config_file).exists() ) {
Expand Down

0 comments on commit 8b8e8ab

Please sign in to comment.