From c365f18bc0d3d2dd072d02e182a6224f90e2b191 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Thu, 26 Mar 2026 11:30:49 -0400 Subject: [PATCH 1/6] add profile full_pipeline + another way to run stubrun --- .github/actions/nf-test/action.yml | 2 +- conf/modules.config | 1 - conf/reproducible.config | 3 +++ nextflow.config | 3 +++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/actions/nf-test/action.yml b/.github/actions/nf-test/action.yml index 3b9724c7..29fb0641 100644 --- a/.github/actions/nf-test/action.yml +++ b/.github/actions/nf-test/action.yml @@ -62,7 +62,7 @@ runs: NFT_WORKDIR: ${{ env.NFT_WORKDIR }} run: | nf-test test \ - --profile=+${{ inputs.profile }} \ + --profile=+${{ inputs.profile }}+stubRun \ $(if [ -n "${{ inputs.tags }}" ]; then echo "--tag ${{ inputs.tags }}"; fi) \ --ci \ --changed-since HEAD^ \ diff --git a/conf/modules.config b/conf/modules.config index 3e7c299e..65b557a4 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -27,4 +27,3 @@ includeConfig './modules/tractometry.config' includeConfig './modules/harmonization.config' includeConfig './modules/output_orig_space.config' includeConfig './modules/output_template_space.config' -includeConfig './modules/stubrun.config' diff --git a/conf/reproducible.config b/conf/reproducible.config index 8b7dd54a..2117a1a8 100644 --- a/conf/reproducible.config +++ b/conf/reproducible.config @@ -11,4 +11,7 @@ */ process { + withName: '.*' { + cpus = 1 + } } diff --git a/nextflow.config b/nextflow.config index c69d9782..9a9ce099 100644 --- a/nextflow.config +++ b/nextflow.config @@ -415,6 +415,9 @@ profiles { skip_preproc { includeConfig 'conf/skip_preproc.config' } + stubRun { + includeConfig 'conf/modules/stubrun.config' + } test { includeConfig 'conf/test.config' } test_full { includeConfig 'conf/test_full.config' } } From 6a5b5aacb3256ff1720b910a6ed87ea275d9214b Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Thu, 26 Mar 2026 11:38:08 -0400 Subject: [PATCH 2/6] fix profile for test --- .github/actions/nf-test/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/nf-test/action.yml b/.github/actions/nf-test/action.yml index 29fb0641..35bd0b3c 100644 --- a/.github/actions/nf-test/action.yml +++ b/.github/actions/nf-test/action.yml @@ -62,7 +62,7 @@ runs: NFT_WORKDIR: ${{ env.NFT_WORKDIR }} run: | nf-test test \ - --profile=+${{ inputs.profile }}+stubRun \ + --profile=+${{ inputs.profile }},stubRun \ $(if [ -n "${{ inputs.tags }}" ]; then echo "--tag ${{ inputs.tags }}"; fi) \ --ci \ --changed-since HEAD^ \ From e63d92d14ce5f16fdf277248b141d6feeb596551 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Thu, 26 Mar 2026 12:01:22 -0400 Subject: [PATCH 3/6] fix stubrun profile in test --- .github/actions/nf-test/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/nf-test/action.yml b/.github/actions/nf-test/action.yml index 35bd0b3c..53a93c3c 100644 --- a/.github/actions/nf-test/action.yml +++ b/.github/actions/nf-test/action.yml @@ -62,7 +62,7 @@ runs: NFT_WORKDIR: ${{ env.NFT_WORKDIR }} run: | nf-test test \ - --profile=+${{ inputs.profile }},stubRun \ + --profile=+${{ inputs.profile }}, stubRun \ $(if [ -n "${{ inputs.tags }}" ]; then echo "--tag ${{ inputs.tags }}"; fi) \ --ci \ --changed-since HEAD^ \ From c780ca3151b494b153d1c991a3e5f93967b574e2 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Thu, 26 Mar 2026 13:43:35 -0400 Subject: [PATCH 4/6] fix action --- .github/actions/nf-test/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/nf-test/action.yml b/.github/actions/nf-test/action.yml index 53a93c3c..e28de2f0 100644 --- a/.github/actions/nf-test/action.yml +++ b/.github/actions/nf-test/action.yml @@ -62,7 +62,8 @@ runs: NFT_WORKDIR: ${{ env.NFT_WORKDIR }} run: | nf-test test \ - --profile=+${{ inputs.profile }}, stubRun \ + --profile=+${{ inputs.profile }} \ + --profile=+stubRun \ $(if [ -n "${{ inputs.tags }}" ]; then echo "--tag ${{ inputs.tags }}"; fi) \ --ci \ --changed-since HEAD^ \ From ef8b0d8099939b03209088ddffa6c6eadf709973 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Thu, 26 Mar 2026 16:15:29 -0400 Subject: [PATCH 5/6] update stubrun + config bundleseg --- .github/actions/nf-test/action.yml | 1 - conf/modules/bundle_seg.config | 8 +++++++- nextflow.config | 2 +- nf-test.config | 2 +- tests/default.nf.test.snap | 4 ++-- workflows/sf-tractomics.nf | 2 +- 6 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/actions/nf-test/action.yml b/.github/actions/nf-test/action.yml index e28de2f0..3b9724c7 100644 --- a/.github/actions/nf-test/action.yml +++ b/.github/actions/nf-test/action.yml @@ -63,7 +63,6 @@ runs: run: | nf-test test \ --profile=+${{ inputs.profile }} \ - --profile=+stubRun \ $(if [ -n "${{ inputs.tags }}" ]; then echo "--tag ${{ inputs.tags }}"; fi) \ --ci \ --changed-since HEAD^ \ diff --git a/conf/modules/bundle_seg.config b/conf/modules/bundle_seg.config index 8e4b82b8..974946c3 100644 --- a/conf/modules/bundle_seg.config +++ b/conf/modules/bundle_seg.config @@ -16,7 +16,13 @@ process { } withName: ".*:BUNDLE_SEG:BUNDLE_RECOGNIZE" { - memory = { 3 * tractograms.inject( 0.Gb ){ total, trk -> total + (trk.size() as MemoryUnit) } + 500.Mb } + memory = { + def trk_list = (tractograms instanceof List) ? tractograms : [tractograms] + def total = trk_list.inject(0.Gb) { total, trk -> + total + ((trk?.exists()) ? (trk.size() as MemoryUnit) : 0.B) + } + 3 * total + 500.Mb + } ext.run_qc = true publishDir = [ path: { meta.session ? "${params.outdir}/${meta.id}/${meta.session}/dwi/bundles/" : "${params.outdir}/${meta.id}/dwi/bundles/" }, diff --git a/nextflow.config b/nextflow.config index 9a9ce099..1a5ce79b 100644 --- a/nextflow.config +++ b/nextflow.config @@ -522,7 +522,7 @@ manifest { mainScript = 'main.nf' defaultBranch = 'main' nextflowVersion = '!>=25.04.6' - version = '1.0dev' + version = '0.1.0' doi = '' } diff --git a/nf-test.config b/nf-test.config index 9dd47f9f..381ea6f2 100644 --- a/nf-test.config +++ b/nf-test.config @@ -18,7 +18,7 @@ config { ignore '.venv/**/*' // run all test with defined profile(s) from the main nextflow.config - profile "test,full_pipeline" + profile "test,full_pipeline,stubRun" // list of filenames or patterns that should be trigger a full test run triggers 'nextflow.config', 'nf-test.config', 'conf/test.config', 'tests/nextflow.config', 'tests/.nftignore' diff --git a/tests/default.nf.test.snap b/tests/default.nf.test.snap index 29028067..7d642342 100644 --- a/tests/default.nf.test.snap +++ b/tests/default.nf.test.snap @@ -107,7 +107,7 @@ "scilpy": "2.2.2" }, "Workflow": { - "scilus/sf-tractomics": "v1.0dev" + "scilus/sf-tractomics": "v0.1.0" } }, [ @@ -217,6 +217,6 @@ "nf-test": "0.9.3", "nextflow": "25.10.2" }, - "timestamp": "2026-03-13T12:58:09.876806632" + "timestamp": "2026-03-26T16:15:03.763505689" } } \ No newline at end of file diff --git a/workflows/sf-tractomics.nf b/workflows/sf-tractomics.nf index 7997f4d3..36dab741 100644 --- a/workflows/sf-tractomics.nf +++ b/workflows/sf-tractomics.nf @@ -169,7 +169,7 @@ workflow SF_TRACTOMICS { if ( params.run_bundle_seg ) { BUNDLE_SEG( TRACTOFLOW.out.dti_fa, - ch_input_tracking_qc.map{ meta, trk -> [meta, [trk]] }, + ch_input_tracking_qc.map { meta, trk -> [meta, (trk instanceof List ? trk : [trk])] }, channel.empty(), [ "run_easyreg": false, // BundleSeg does not support easyreg, so we set it to false to avoid confusion From d463ae872fc0d1887928ae6cb18e7899c614713c Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Fri, 27 Mar 2026 09:45:56 -0400 Subject: [PATCH 6/6] fix ascii and profiles --- .../utils_nfcore_sf-tractomics_pipeline/main.nf | 15 ++++++++++----- workflows/sf-tractomics.nf | 4 ++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/subworkflows/local/utils_nfcore_sf-tractomics_pipeline/main.nf b/subworkflows/local/utils_nfcore_sf-tractomics_pipeline/main.nf index 7c92c36b..544d744d 100644 --- a/subworkflows/local/utils_nfcore_sf-tractomics_pipeline/main.nf +++ b/subworkflows/local/utils_nfcore_sf-tractomics_pipeline/main.nf @@ -60,11 +60,16 @@ workflow PIPELINE_INITIALISATION { command = "nextflow run ${workflow.manifest.name} -profile --input samplesheet.csv --outdir " before_text = """ -\033[2m----------------------------------------------------------------------------------\033[0m- - \033[0;32m _.--'"'.\033[0m - \033[0;32m( ( ( )\033[0m - \033[0;33m(o)_ ) )\033[0m - \033[0;32m (o)_.'\033[0m - \033[0;32m )/\033[0m + \033[0;32m _---~~(~~-_.\033[0m + \033[0;32m _{ ) )\033[0m + \033[0;32m , ) -~~- ( ,-' )_\033[0m + \033[0;32m ( `-,_..`., )-- '_,)\033[0m + \033[0;32m( ` _) ( -~( -_ `, }\033[0m + \033[0;32m(_- _ ~_-~~~~`, ,' )\033[0m + \033[0;32m `~ -^( __;-,((()))\033[0m + \033[0;32m ~~~~ {_ -_(())\033[0m + \033[0;32m `\\ }\033[0m + \033[0;32m { }\033[0m \033[0;34m __ ___ ___ __ __ __ ___ __ __ __ __ \033[0m \033[0;34m (__ |__ ___ | |__) |__| | | | | |\\/| | / (__ \033[0m diff --git a/workflows/sf-tractomics.nf b/workflows/sf-tractomics.nf index 36dab741..0219609b 100644 --- a/workflows/sf-tractomics.nf +++ b/workflows/sf-tractomics.nf @@ -52,6 +52,10 @@ workflow SF_TRACTOMICS { ch_bet_probability = channel.empty() ch_synthstrip_weights = channel.empty() + if (workflow.profile.contains('reproducible') && workflow.profile.contains('gpu')) { + error "\033[0;31mERROR: Profiles 'reproducible' and 'gpu' are not compatible and cannot be used together. Please remove gpu if you want reproducible results.\033[0m" + } + /* Load topup config if provided */ if ( params.config_topup ) { if ( file(params.config_topup).exists()) {