diff --git a/conf/modules.config b/conf/modules.config index 3e7c299..65b557a 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/modules/bundle_seg.config b/conf/modules/bundle_seg.config index 8e4b82b..974946c 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/conf/reproducible.config b/conf/reproducible.config index 8b7dd54..2117a1a 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 c69d978..1a5ce79 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' } } @@ -519,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 9dd47f9..381ea6f 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/subworkflows/local/utils_nfcore_sf-tractomics_pipeline/main.nf b/subworkflows/local/utils_nfcore_sf-tractomics_pipeline/main.nf index 7c92c36..544d744 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/tests/default.nf.test.snap b/tests/default.nf.test.snap index 2902806..7d64234 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 7997f4d..0219609 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()) { @@ -169,7 +173,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