From 69ee2efe21d591e7c17f59544c3b9613d1cc48ed Mon Sep 17 00:00:00 2001 From: Artem Sokolov Date: Sun, 10 Mar 2024 17:36:42 -0400 Subject: [PATCH] Dynamic samplename in fileseries/filepattern expressions (#542) * Dynamic samplename in fileseries/filepattern * Documented change --- CHANGES.md | 36 ++++++++++++++++++++++++++++-------- modules/registration.nf | 1 + 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 67416de4..9745086e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,23 @@ +### 2024-03-10 + +* Allow for dynamic sample name specification in the fileseries/filepattern expressions. + +For example, if the filenames are structured like this: +``` +myproject/ + markers.csv + params.yml + raw/ + image1/ + image1_ch1.tif + image1_ch2.tif + image2/ + image2_ch1.tif + image2_ch2.tif +``` + +The corresponding expression can now be specified as `fileseries|.|pattern={samplename}_ch{channel}.tif`. + ### 2024-02-25 * Added support for multiple samples in `raw/` subdirectory. If multiple images share the same markers and should be processed with the same set of parameters, they can be placed as subdirectories of `raw/`. In other words, instead of structuring the data as multiple projects: @@ -7,15 +27,15 @@ image1/ markers.csv params.yml raw/ - tile1.rcpnl - tile2.rcpnl + cycle1.rcpnl + cycle2.rcpnl image2/ markers.csv params.yml raw/ - tile1.rcpnl - tile2.rcpnl + cycle1.rcpnl + cycle2.rcpnl ``` they can be consolidated under the same project folder: @@ -26,11 +46,11 @@ myproject/ params.yml raw/ image1/ - tile1.rcpnl - tile2.rcpnl + cycle1.rcpnl + cycle2.rcpnl image2/ - tile1.rcpnl - tile2.rcpnl + cycle1.rcpnl + cycle2.rcpnl ``` ### 2024-01-31 diff --git a/modules/registration.nf b/modules/registration.nf index bfaa9276..84d0f944 100644 --- a/modules/registration.nf +++ b/modules/registration.nf @@ -24,6 +24,7 @@ process ashlar { script: // Options def opts = Opts.moduleOpts(module, mcp) + .replace('{samplename}', sampleName) // Images def imgs = opts.contains("filepattern|") || opts.contains("fileseries|") ? "" :