From e4cc70835cf593e3b9aa6ccf6e286a357c5dbe52 Mon Sep 17 00:00:00 2001 From: RobJY Date: Thu, 11 Jul 2024 18:07:13 -0400 Subject: [PATCH 01/16] basic idea seems to be working; needs testing and clean-up --- assets/markers_1_coreograph.csv | 2 + ...plesheet_1_row_sample_cycle_coreograph.csv | 2 + conf/modules.config | 4 ++ nextflow.config | 1 + nextflow_schema.json | 4 ++ workflows/mcmicro.nf | 51 +++++++++++++++---- 6 files changed, 53 insertions(+), 11 deletions(-) create mode 100644 assets/markers_1_coreograph.csv create mode 100644 assets/samplesheet_1_row_sample_cycle_coreograph.csv diff --git a/assets/markers_1_coreograph.csv b/assets/markers_1_coreograph.csv new file mode 100644 index 0000000..6a66b7c --- /dev/null +++ b/assets/markers_1_coreograph.csv @@ -0,0 +1,2 @@ +channel_number,cycle_number,marker_name,filter,excitation_wavelength +1,1,DNA_6,DAPI,395 diff --git a/assets/samplesheet_1_row_sample_cycle_coreograph.csv b/assets/samplesheet_1_row_sample_cycle_coreograph.csv new file mode 100644 index 0000000..baae966 --- /dev/null +++ b/assets/samplesheet_1_row_sample_cycle_coreograph.csv @@ -0,0 +1,2 @@ +sample,cycle_number,channel_count,image_tiles +TEST1,1,10,/home/pollen/github/mcmicro-nf-core/assets/coreograph_test.tif diff --git a/conf/modules.config b/conf/modules.config index 1311949..002c50d 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -60,6 +60,10 @@ process { ] } + withName: "COREOGRAPH" { + ext.args = '--downsampleFactor 1' + } + /* withName: SCIMAP_MCMICRO { containerOptions = '-e NUMBA_CACHE_DIR=/tmp' diff --git a/nextflow.config b/nextflow.config index 5a64850..25282b3 100644 --- a/nextflow.config +++ b/nextflow.config @@ -13,6 +13,7 @@ params { input_sample = null input_cycle = null marker_sheet = null + coreograph = false // Illumination correction illumination = null diff --git a/nextflow_schema.json b/nextflow_schema.json index 7b24b69..8d421bf 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -65,6 +65,10 @@ "type": "string", "enum": ["basicpy"], "description": "input that defines type of illumination correction to be performed" + }, + "coreograph": { + "type": "boolean", + "description": "Apply coreograph module to create separate images before segmentation" } } }, diff --git a/workflows/mcmicro.nf b/workflows/mcmicro.nf index 77e7b7c..dd72d4d 100644 --- a/workflows/mcmicro.nf +++ b/workflows/mcmicro.nf @@ -16,6 +16,7 @@ include { BASICPY } from '../modules/nf-core/basicpy/main' include { ASHLAR } from '../modules/nf-core/ashlar/main' include { BACKSUB } from '../modules/nf-core/backsub/main' include { CELLPOSE } from '../modules/nf-core/cellpose/main' +include { COREOGRAPH } from '../modules/nf-core/coreograph/main' include { DEEPCELL_MESMER } from '../modules/nf-core/deepcell/mesmer/main' include { MCQUANT } from '../modules/nf-core/mcquant/main' include { SCIMAP_MCMICRO } from '../modules/nf-core/scimap/mcmicro/main' @@ -78,9 +79,20 @@ workflow MCMICRO { //BACKSUB(ASHLAR.out.tif, [[id: "backsub"], params.marker_sheet]) //ch_versions = ch_versions.mix(BACKSUB.out.versions) + // Run Coreograph + if (params.coreograph) { + COREOGRAPH(ASHLAR.out.tif) + COREOGRAPH.out.cores + .transpose() + .map { meta, img -> [[id: meta.id, subimg: img.toString().split('/')[-1].tokenize(".")[0]], img]} + .set { ch_segmentation_input } + } else { + ch_segmentation_input = ASHLAR.out.tif + } + // Run Segmentation - DEEPCELL_MESMER(ASHLAR.out.tif, [[:],[]]) + DEEPCELL_MESMER(ch_segmentation_input, [[:],[]]) ch_versions = ch_versions.mix(DEEPCELL_MESMER.out.versions) // Run Quantification @@ -92,16 +104,33 @@ workflow MCMICRO { it.collect{ _1, _2, marker_name, _4, _5, _6 -> '"' + marker_name + '"' } } .collectFile(name: 'markers.csv', sort: false, newLine: true) - ASHLAR.out.tif - .join(DEEPCELL_MESMER.out.mask) - .combine(ch_mcquant_markers) - .dump(tag: 'MCQUANT in') - .multiMap { it -> - image: [it[0], it[1]] - mask: [it[0], it[2]] - markers: [it[0], it[3]] - } - | MCQUANT + + if (params.coreograph) { + img = ch_segmentation_input.map { meta, img -> [meta.subimg, meta, img]}.dump(tag: "IMG") + mask = DEEPCELL_MESMER.out.mask.map { meta, mask -> [meta.subimg, meta, mask]}.dump(tag: "MASK") + img + .combine(mask, by: [0]) + .combine(ch_mcquant_markers) + .dump(tag: "TEST") + .multiMap { it -> + image: [it[1], it[2]] + mask: [it[1], it[4]] + markers: [it[1], it[5]] + } + | MCQUANT + + } else { + ASHLAR.out.tif + .join(DEEPCELL_MESMER.out.mask) + .combine(ch_mcquant_markers) + .dump(tag: 'MCQUANT in') + .multiMap { it -> + image: [it[0], it[1]] + mask: [it[0], it[2]] + markers: [it[0], it[3]] + } + | MCQUANT + } ch_versions = ch_versions.mix(MCQUANT.out.versions) /* From b137c5e44890c8b561ff701f88a3e9489d5cdbf1 Mon Sep 17 00:00:00 2001 From: RobJY Date: Fri, 12 Jul 2024 12:24:44 -0400 Subject: [PATCH 02/16] added coreograph test --- tests/main.nf.test | 87 +++++++++++++++++++++++++++++++++++++++++ tests/main.nf.test.snap | 72 ++++++++++++++++++++++++++++++---- 2 files changed, 152 insertions(+), 7 deletions(-) diff --git a/tests/main.nf.test b/tests/main.nf.test index d212820..b8e92f9 100644 --- a/tests/main.nf.test +++ b/tests/main.nf.test @@ -396,5 +396,92 @@ nextflow_workflow { } }, + test("cycle: no illumination correction, coreograph") { + + when { + params { + segmentation = "mesmer" + coreograph = true + + } + workflow { + """ + input[0] = Channel.of( + [ + [id:"TEST1", cycle_number:1, channel_count:4], + "/home/pollen/github/mcmicro-nf-core/assets/coreograph_test.tif", + [], + [], + ], + ) + input[1] = Channel.of( + [ + [1,1,'DNA_6',[],[],[]], + ], + ) + """ + } + } + + then { + assertAll ( + { + assert snapshot ( + path("$outputDir/registration/ashlar/TEST1.ome.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1.tif"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/1_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/2_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/3_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/4_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/5_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/6_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/7_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/8_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/9_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/10_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/11_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/12_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/13_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/14_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/15_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/16_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/17_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/18_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/19_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/20_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/21_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/22_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/23_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/24_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/25_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/26_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/27_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/28_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/29_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/30_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/31_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/32_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/33_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/34_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/35_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/36_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/37_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/38_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/39_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/40_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/41_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/42_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/43_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/44_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/45_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/46_mask_TEST1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/47_mask_TEST1.csv"), + ).match() + }, + { assert workflow.success } + ) + } + }, + ] } diff --git a/tests/main.nf.test.snap b/tests/main.nf.test.snap index af16e98..828b5aa 100644 --- a/tests/main.nf.test.snap +++ b/tests/main.nf.test.snap @@ -219,6 +219,18 @@ }, "timestamp": "2024-04-23T11:53:19.871380893" }, + "cycle: no illumination correction": { + "content": [ + "TEST1.ome.tif:md5,ae98ac74e3c818bb26c99ba4b9c2dd51", + "mask_TEST1.tif:md5,c1075eb025f558fcadedc1f0d903ec15", + "TEST1_mask_TEST1.csv:rounded:md5,a7c226a3d32a94dd05356c5998eae522" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T15:58:40.245133922" + }, "cycle: multiple file ashlar input with multiple samples and basicpy correction": { "content": [ { @@ -398,7 +410,7 @@ }, "timestamp": "2024-04-22T16:00:55.775911164" }, - "cycle: no illumination correction": { + "cycle: manual illumination correction": { "content": [ "TEST1.ome.tif:md5,ae98ac74e3c818bb26c99ba4b9c2dd51", "mask_TEST1.tif:md5,c1075eb025f558fcadedc1f0d903ec15", @@ -408,18 +420,64 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-04-22T15:58:40.245133922" + "timestamp": "2024-04-22T15:59:42.197064018" }, - "cycle: manual illumination correction": { + "cycle: no illumination correction, coreograph": { "content": [ - "TEST1.ome.tif:md5,ae98ac74e3c818bb26c99ba4b9c2dd51", - "mask_TEST1.tif:md5,c1075eb025f558fcadedc1f0d903ec15", - "TEST1_mask_TEST1.csv:rounded:md5,a7c226a3d32a94dd05356c5998eae522" + "TEST1.ome.tif:md5,4b667e356ab2f1c675dd74ef1436d902", + "mask_TEST1.tif:md5,ec3b7db9867410223375be113e35f867", + "1_mask_TEST1.csv:rounded:md5,a125a716375795805baeaedc663e8c17", + "2_mask_TEST1.csv:rounded:md5,da512f703f05b73392853361e96844cf", + "3_mask_TEST1.csv:rounded:md5,cef3fd27ae5ddb05873fa6feeb87ba36", + "4_mask_TEST1.csv:rounded:md5,b97ddd3fbc3ff583aefc3ffb31b2b579", + "5_mask_TEST1.csv:rounded:md5,7cf80746d3ef0d14c60d30e0a34baf57", + "6_mask_TEST1.csv:rounded:md5,88c40dd535b9721343b849b533d5114f", + "7_mask_TEST1.csv:rounded:md5,f3c93fd36c0258a70f78aafeff8d2456", + "8_mask_TEST1.csv:rounded:md5,ec5163ff0fdac175ba4136001e6e8129", + "9_mask_TEST1.csv:rounded:md5,40e8414f1ddb32322797dd24dcf0c94d", + "10_mask_TEST1.csv:rounded:md5,88888b39611e403cec429c5e853e454f", + "11_mask_TEST1.csv:rounded:md5,115536dcf4e8b93ec8f9edece045a100", + "12_mask_TEST1.csv:rounded:md5,f52995e23bbf7bcafdab46e82311932c", + "13_mask_TEST1.csv:rounded:md5,fa2a4393fb30e20ea523ca4886431134", + "14_mask_TEST1.csv:rounded:md5,2d5ec14301d60b24dfa7d44cb530ef92", + "15_mask_TEST1.csv:rounded:md5,3689f3ecb776c083b2e52eeb54b5c4c3", + "16_mask_TEST1.csv:rounded:md5,a56468f308a68306b68ac227eb1e0c9a", + "17_mask_TEST1.csv:rounded:md5,fb95739a681f1c14bf501711128f4785", + "18_mask_TEST1.csv:rounded:md5,7cd59af88becb6490aaf8d501b6524c4", + "19_mask_TEST1.csv:rounded:md5,b3ef0b127fdea20d23a4712b263debcb", + "20_mask_TEST1.csv:rounded:md5,80c4eb68ea7c1125b4502bb3117466b8", + "21_mask_TEST1.csv:rounded:md5,bf972b95d8b152129ecde5c09019661b", + "22_mask_TEST1.csv:rounded:md5,c3701c16db941942412c95cbd7be264e", + "23_mask_TEST1.csv:rounded:md5,ddf78293a28b7d232efb4cc08276c546", + "24_mask_TEST1.csv:rounded:md5,0577754ad841c493d0b74fb245cb0202", + "25_mask_TEST1.csv:rounded:md5,94f07122ebf58c5bc81ec274ad7faaa0", + "26_mask_TEST1.csv:rounded:md5,cdbf1e1edd00251e640f3dc9f1249bfa", + "27_mask_TEST1.csv:rounded:md5,4f4154669989de86d0f9179f22a6ae02", + "28_mask_TEST1.csv:rounded:md5,eb3017af35690dcd4e1b23dee0389790", + "29_mask_TEST1.csv:rounded:md5,6fefd178e0af1e2e32ccb0caf25ae082", + "30_mask_TEST1.csv:rounded:md5,74557027dbd25a85a8a3001530c3b9cd", + "31_mask_TEST1.csv:rounded:md5,2acb00dd5584c0d59ab8b0ce8c09c48d", + "32_mask_TEST1.csv:rounded:md5,946278c08a6c09f93c841285047daa6e", + "33_mask_TEST1.csv:rounded:md5,0c307d5303aabc3eaf0364f6b93323a4", + "34_mask_TEST1.csv:rounded:md5,af1e478bcb84d16cbcb98cb32a85b060", + "35_mask_TEST1.csv:rounded:md5,d3ef58ddcb221bc8c0819e3a08d4120e", + "36_mask_TEST1.csv:rounded:md5,7fdf13290ef6965a3431e743b281421a", + "37_mask_TEST1.csv:rounded:md5,eda1fa49c691fec5ccaed36f50c8e873", + "38_mask_TEST1.csv:rounded:md5,2cb2aee630b148967b38e0d89bc9dfa1", + "39_mask_TEST1.csv:rounded:md5,730bb6fa5116a037acd39aeaa4143e5f", + "40_mask_TEST1.csv:rounded:md5,6e66a2d2975efd282265391ac6f5f117", + "41_mask_TEST1.csv:rounded:md5,10ff7e852033c3d1b1fd9b54aa6a5ef6", + "42_mask_TEST1.csv:rounded:md5,81938474e1cd053eae9c61a5f229fb55", + "43_mask_TEST1.csv:rounded:md5,789f8707c20c81e193a69fd7a07c882e", + "44_mask_TEST1.csv:rounded:md5,20f4dd4ffc64a493d461e74b7aaab1af", + "45_mask_TEST1.csv:rounded:md5,e0e62301aeca4c41ef0dda76b675a11e", + "46_mask_TEST1.csv:rounded:md5,57fd5e9858d0b107e35646f31f96e577", + "47_mask_TEST1.csv:rounded:md5,7f8171726aaf1763911b39c209ac8fe6" ], "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-04-22T15:59:42.197064018" + "timestamp": "2024-07-12T12:14:21.916439265" } } \ No newline at end of file From 793ac767c0033df73702135bcab4ae9a8025d081 Mon Sep 17 00:00:00 2001 From: RobJY Date: Tue, 16 Jul 2024 14:43:12 -0400 Subject: [PATCH 03/16] removed conditional run of mcquant as suggeted in Slack --- tests/main.nf.test | 142 +++++++++++++++++++++++++-------------- tests/main.nf.test.snap | 144 ++++++++++++++++++++++++++-------------- workflows/mcmicro.nf | 37 +++-------- 3 files changed, 200 insertions(+), 123 deletions(-) diff --git a/tests/main.nf.test b/tests/main.nf.test index b8e92f9..08bb64c 100644 --- a/tests/main.nf.test +++ b/tests/main.nf.test @@ -428,54 +428,100 @@ nextflow_workflow { { assert snapshot ( path("$outputDir/registration/ashlar/TEST1.ome.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1.tif"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/1_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/2_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/3_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/4_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/5_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/6_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/7_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/8_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/9_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/10_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/11_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/12_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/13_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/14_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/15_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/16_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/17_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/18_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/19_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/20_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/21_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/22_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/23_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/24_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/25_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/26_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/27_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/28_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/29_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/30_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/31_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/32_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/33_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/34_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/35_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/36_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/37_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/38_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/39_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/40_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/41_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/42_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/43_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/44_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/45_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/46_mask_TEST1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/47_mask_TEST1.csv"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_1.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_2.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_3.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_4.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_5.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_6.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_7.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_8.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_9.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_10.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_11.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_12.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_13.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_14.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_15.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_16.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_17.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_18.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_19.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_20.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_21.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_22.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_23.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_24.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_25.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_26.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_27.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_28.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_29.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_30.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_31.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_32.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_33.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_34.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_35.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_36.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_37.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_38.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_39.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_40.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_41.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_42.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_43.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_44.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_45.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_46.tif"), + path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_47.tif"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/1_mask_TEST1_1.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/2_mask_TEST1_2.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/3_mask_TEST1_3.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/4_mask_TEST1_4.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/5_mask_TEST1_5.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/6_mask_TEST1_6.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/7_mask_TEST1_7.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/8_mask_TEST1_8.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/9_mask_TEST1_9.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/10_mask_TEST1_10.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/11_mask_TEST1_11.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/12_mask_TEST1_12.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/13_mask_TEST1_13.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/14_mask_TEST1_14.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/15_mask_TEST1_15.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/16_mask_TEST1_16.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/17_mask_TEST1_17.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/18_mask_TEST1_18.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/19_mask_TEST1_19.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/20_mask_TEST1_20.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/21_mask_TEST1_21.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/22_mask_TEST1_22.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/23_mask_TEST1_23.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/24_mask_TEST1_24.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/25_mask_TEST1_25.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/26_mask_TEST1_26.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/27_mask_TEST1_27.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/28_mask_TEST1_28.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/29_mask_TEST1_29.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/30_mask_TEST1_30.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/31_mask_TEST1_31.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/32_mask_TEST1_32.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/33_mask_TEST1_33.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/34_mask_TEST1_34.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/35_mask_TEST1_35.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/36_mask_TEST1_36.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/37_mask_TEST1_37.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/38_mask_TEST1_38.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/39_mask_TEST1_39.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/40_mask_TEST1_40.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/41_mask_TEST1_41.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/42_mask_TEST1_42.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/43_mask_TEST1_43.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/44_mask_TEST1_44.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/45_mask_TEST1_45.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/46_mask_TEST1_46.csv"), + CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/47_mask_TEST1_47.csv"), ).match() }, { assert workflow.success } diff --git a/tests/main.nf.test.snap b/tests/main.nf.test.snap index 828b5aa..3f1acab 100644 --- a/tests/main.nf.test.snap +++ b/tests/main.nf.test.snap @@ -425,59 +425,105 @@ "cycle: no illumination correction, coreograph": { "content": [ "TEST1.ome.tif:md5,4b667e356ab2f1c675dd74ef1436d902", - "mask_TEST1.tif:md5,ec3b7db9867410223375be113e35f867", - "1_mask_TEST1.csv:rounded:md5,a125a716375795805baeaedc663e8c17", - "2_mask_TEST1.csv:rounded:md5,da512f703f05b73392853361e96844cf", - "3_mask_TEST1.csv:rounded:md5,cef3fd27ae5ddb05873fa6feeb87ba36", - "4_mask_TEST1.csv:rounded:md5,b97ddd3fbc3ff583aefc3ffb31b2b579", - "5_mask_TEST1.csv:rounded:md5,7cf80746d3ef0d14c60d30e0a34baf57", - "6_mask_TEST1.csv:rounded:md5,88c40dd535b9721343b849b533d5114f", - "7_mask_TEST1.csv:rounded:md5,f3c93fd36c0258a70f78aafeff8d2456", - "8_mask_TEST1.csv:rounded:md5,ec5163ff0fdac175ba4136001e6e8129", - "9_mask_TEST1.csv:rounded:md5,40e8414f1ddb32322797dd24dcf0c94d", - "10_mask_TEST1.csv:rounded:md5,88888b39611e403cec429c5e853e454f", - "11_mask_TEST1.csv:rounded:md5,115536dcf4e8b93ec8f9edece045a100", - "12_mask_TEST1.csv:rounded:md5,f52995e23bbf7bcafdab46e82311932c", - "13_mask_TEST1.csv:rounded:md5,fa2a4393fb30e20ea523ca4886431134", - "14_mask_TEST1.csv:rounded:md5,2d5ec14301d60b24dfa7d44cb530ef92", - "15_mask_TEST1.csv:rounded:md5,3689f3ecb776c083b2e52eeb54b5c4c3", - "16_mask_TEST1.csv:rounded:md5,a56468f308a68306b68ac227eb1e0c9a", - "17_mask_TEST1.csv:rounded:md5,fb95739a681f1c14bf501711128f4785", - "18_mask_TEST1.csv:rounded:md5,7cd59af88becb6490aaf8d501b6524c4", - "19_mask_TEST1.csv:rounded:md5,b3ef0b127fdea20d23a4712b263debcb", - "20_mask_TEST1.csv:rounded:md5,80c4eb68ea7c1125b4502bb3117466b8", - "21_mask_TEST1.csv:rounded:md5,bf972b95d8b152129ecde5c09019661b", - "22_mask_TEST1.csv:rounded:md5,c3701c16db941942412c95cbd7be264e", - "23_mask_TEST1.csv:rounded:md5,ddf78293a28b7d232efb4cc08276c546", - "24_mask_TEST1.csv:rounded:md5,0577754ad841c493d0b74fb245cb0202", - "25_mask_TEST1.csv:rounded:md5,94f07122ebf58c5bc81ec274ad7faaa0", - "26_mask_TEST1.csv:rounded:md5,cdbf1e1edd00251e640f3dc9f1249bfa", - "27_mask_TEST1.csv:rounded:md5,4f4154669989de86d0f9179f22a6ae02", - "28_mask_TEST1.csv:rounded:md5,eb3017af35690dcd4e1b23dee0389790", - "29_mask_TEST1.csv:rounded:md5,6fefd178e0af1e2e32ccb0caf25ae082", - "30_mask_TEST1.csv:rounded:md5,74557027dbd25a85a8a3001530c3b9cd", - "31_mask_TEST1.csv:rounded:md5,2acb00dd5584c0d59ab8b0ce8c09c48d", - "32_mask_TEST1.csv:rounded:md5,946278c08a6c09f93c841285047daa6e", - "33_mask_TEST1.csv:rounded:md5,0c307d5303aabc3eaf0364f6b93323a4", - "34_mask_TEST1.csv:rounded:md5,af1e478bcb84d16cbcb98cb32a85b060", - "35_mask_TEST1.csv:rounded:md5,d3ef58ddcb221bc8c0819e3a08d4120e", - "36_mask_TEST1.csv:rounded:md5,7fdf13290ef6965a3431e743b281421a", - "37_mask_TEST1.csv:rounded:md5,eda1fa49c691fec5ccaed36f50c8e873", - "38_mask_TEST1.csv:rounded:md5,2cb2aee630b148967b38e0d89bc9dfa1", - "39_mask_TEST1.csv:rounded:md5,730bb6fa5116a037acd39aeaa4143e5f", - "40_mask_TEST1.csv:rounded:md5,6e66a2d2975efd282265391ac6f5f117", - "41_mask_TEST1.csv:rounded:md5,10ff7e852033c3d1b1fd9b54aa6a5ef6", - "42_mask_TEST1.csv:rounded:md5,81938474e1cd053eae9c61a5f229fb55", - "43_mask_TEST1.csv:rounded:md5,789f8707c20c81e193a69fd7a07c882e", - "44_mask_TEST1.csv:rounded:md5,20f4dd4ffc64a493d461e74b7aaab1af", - "45_mask_TEST1.csv:rounded:md5,e0e62301aeca4c41ef0dda76b675a11e", - "46_mask_TEST1.csv:rounded:md5,57fd5e9858d0b107e35646f31f96e577", - "47_mask_TEST1.csv:rounded:md5,7f8171726aaf1763911b39c209ac8fe6" + "mask_TEST1_1.tif:md5,ba7a1801058f54991f7235e8157b136b", + "mask_TEST1_2.tif:md5,fdf09860d899bd7bb3061d6106746b68", + "mask_TEST1_3.tif:md5,829e9043d6f2cce6895313e1143c5699", + "mask_TEST1_4.tif:md5,7fd8922a931a46b8bc69c4125337b97e", + "mask_TEST1_5.tif:md5,02918ed645d045aa221206d95a10befe", + "mask_TEST1_6.tif:md5,c4ad806d6366c2ced2b739c02d3ce256", + "mask_TEST1_7.tif:md5,8773f1ac2586e2c22e751a6a7b0ef638", + "mask_TEST1_8.tif:md5,bdb3d059217103017fdafae8433fadfb", + "mask_TEST1_9.tif:md5,ec3b7db9867410223375be113e35f867", + "mask_TEST1_10.tif:md5,8e52a81283a64faee2e3cead3b0ef843", + "mask_TEST1_11.tif:md5,eda1d995f31fe6a2fa0da8b5805c54b5", + "mask_TEST1_12.tif:md5,5026564cd3f5d9d178e5611bc630c252", + "mask_TEST1_13.tif:md5,1bece9e6aa117a9b9a2d5fdcf0658364", + "mask_TEST1_14.tif:md5,21d324c70f3b64da559b4291c40787ee", + "mask_TEST1_15.tif:md5,8dd36daf2d79c8016bfae83089be43d1", + "mask_TEST1_16.tif:md5,289dcc5810a448960f7df0ca6f8aeb18", + "mask_TEST1_17.tif:md5,3280af6656f400d07d317eeb8494edef", + "mask_TEST1_18.tif:md5,3ad7eb70674eb94e057feb77f385b567", + "mask_TEST1_19.tif:md5,228d673a5b0e007c3b0a4365b35772fd", + "mask_TEST1_20.tif:md5,85ffdbc124dd191e32d93b0526b0df36", + "mask_TEST1_21.tif:md5,c5a5d2371fd68b458022c852e1c888eb", + "mask_TEST1_22.tif:md5,dba833e63ce1e9fd450fe2b1bcd2adbd", + "mask_TEST1_23.tif:md5,6d605698a1c15fe7599dffe51aed6b9d", + "mask_TEST1_24.tif:md5,35474f9d6e6e5fd31fa8fb94f582fc11", + "mask_TEST1_25.tif:md5,5723d9ee6e89e7676b6fd0c8f0ef87df", + "mask_TEST1_26.tif:md5,67a8f01c88439d61b740d86bb562afb1", + "mask_TEST1_27.tif:md5,2495ea80db37124c5f2ac685aab6d19d", + "mask_TEST1_28.tif:md5,c3b1968423ded13832ad106d0df65431", + "mask_TEST1_29.tif:md5,f748434e458ab60c3227b68dcc0f8795", + "mask_TEST1_30.tif:md5,dd4b9b5d0c271202f1e18c23464d4c27", + "mask_TEST1_31.tif:md5,5a3921df1616ab3751cabde4e039a029", + "mask_TEST1_32.tif:md5,aac51cb335a1b71be762e7974fd967ab", + "mask_TEST1_33.tif:md5,478d4d0dba9db497e0eb17e901b2e072", + "mask_TEST1_34.tif:md5,e392b1a42073ffbe929568741c2c56bb", + "mask_TEST1_35.tif:md5,d7f025d24b4087d7ec67d23561b0cf16", + "mask_TEST1_36.tif:md5,77d27a9a270c16455f6f8685be452f96", + "mask_TEST1_37.tif:md5,23443136d975fd449d7fe125d50b775b", + "mask_TEST1_38.tif:md5,8e78ee0ad2e114eb4247d01214c34093", + "mask_TEST1_39.tif:md5,981e913fcfec7b42d4214f95e80c424e", + "mask_TEST1_40.tif:md5,706fc029d0f29e749f6147c1f4bb5b4e", + "mask_TEST1_41.tif:md5,83dc2edec93a0c6030c829bb598d4c53", + "mask_TEST1_42.tif:md5,ed23194ed8f44b0bb5e8adbe93ba35fc", + "mask_TEST1_43.tif:md5,d0a406e5444637a4cc851959d38140c7", + "mask_TEST1_44.tif:md5,7f82a7a89e66c6ae5d73d4a84fe97bbc", + "mask_TEST1_45.tif:md5,eaea2a997bb231c6c0c08f931419542b", + "mask_TEST1_46.tif:md5,772cfa4322c85b28d8d3439e6179fae6", + "mask_TEST1_47.tif:md5,2edb07cba0b86a90efbef232f26d1b8b", + "1_mask_TEST1_1.csv:rounded:md5,a125a716375795805baeaedc663e8c17", + "2_mask_TEST1_2.csv:rounded:md5,da512f703f05b73392853361e96844cf", + "3_mask_TEST1_3.csv:rounded:md5,cef3fd27ae5ddb05873fa6feeb87ba36", + "4_mask_TEST1_4.csv:rounded:md5,b97ddd3fbc3ff583aefc3ffb31b2b579", + "5_mask_TEST1_5.csv:rounded:md5,7cf80746d3ef0d14c60d30e0a34baf57", + "6_mask_TEST1_6.csv:rounded:md5,88c40dd535b9721343b849b533d5114f", + "7_mask_TEST1_7.csv:rounded:md5,f3c93fd36c0258a70f78aafeff8d2456", + "8_mask_TEST1_8.csv:rounded:md5,ec5163ff0fdac175ba4136001e6e8129", + "9_mask_TEST1_9.csv:rounded:md5,40e8414f1ddb32322797dd24dcf0c94d", + "10_mask_TEST1_10.csv:rounded:md5,88888b39611e403cec429c5e853e454f", + "11_mask_TEST1_11.csv:rounded:md5,115536dcf4e8b93ec8f9edece045a100", + "12_mask_TEST1_12.csv:rounded:md5,f52995e23bbf7bcafdab46e82311932c", + "13_mask_TEST1_13.csv:rounded:md5,fa2a4393fb30e20ea523ca4886431134", + "14_mask_TEST1_14.csv:rounded:md5,2d5ec14301d60b24dfa7d44cb530ef92", + "15_mask_TEST1_15.csv:rounded:md5,3689f3ecb776c083b2e52eeb54b5c4c3", + "16_mask_TEST1_16.csv:rounded:md5,a56468f308a68306b68ac227eb1e0c9a", + "17_mask_TEST1_17.csv:rounded:md5,fb95739a681f1c14bf501711128f4785", + "18_mask_TEST1_18.csv:rounded:md5,7cd59af88becb6490aaf8d501b6524c4", + "19_mask_TEST1_19.csv:rounded:md5,b3ef0b127fdea20d23a4712b263debcb", + "20_mask_TEST1_20.csv:rounded:md5,80c4eb68ea7c1125b4502bb3117466b8", + "21_mask_TEST1_21.csv:rounded:md5,bf972b95d8b152129ecde5c09019661b", + "22_mask_TEST1_22.csv:rounded:md5,c3701c16db941942412c95cbd7be264e", + "23_mask_TEST1_23.csv:rounded:md5,ddf78293a28b7d232efb4cc08276c546", + "24_mask_TEST1_24.csv:rounded:md5,0577754ad841c493d0b74fb245cb0202", + "25_mask_TEST1_25.csv:rounded:md5,94f07122ebf58c5bc81ec274ad7faaa0", + "26_mask_TEST1_26.csv:rounded:md5,cdbf1e1edd00251e640f3dc9f1249bfa", + "27_mask_TEST1_27.csv:rounded:md5,4f4154669989de86d0f9179f22a6ae02", + "28_mask_TEST1_28.csv:rounded:md5,eb3017af35690dcd4e1b23dee0389790", + "29_mask_TEST1_29.csv:rounded:md5,6fefd178e0af1e2e32ccb0caf25ae082", + "30_mask_TEST1_30.csv:rounded:md5,74557027dbd25a85a8a3001530c3b9cd", + "31_mask_TEST1_31.csv:rounded:md5,2acb00dd5584c0d59ab8b0ce8c09c48d", + "32_mask_TEST1_32.csv:rounded:md5,946278c08a6c09f93c841285047daa6e", + "33_mask_TEST1_33.csv:rounded:md5,0c307d5303aabc3eaf0364f6b93323a4", + "34_mask_TEST1_34.csv:rounded:md5,af1e478bcb84d16cbcb98cb32a85b060", + "35_mask_TEST1_35.csv:rounded:md5,d3ef58ddcb221bc8c0819e3a08d4120e", + "36_mask_TEST1_36.csv:rounded:md5,7fdf13290ef6965a3431e743b281421a", + "37_mask_TEST1_37.csv:rounded:md5,eda1fa49c691fec5ccaed36f50c8e873", + "38_mask_TEST1_38.csv:rounded:md5,2cb2aee630b148967b38e0d89bc9dfa1", + "39_mask_TEST1_39.csv:rounded:md5,730bb6fa5116a037acd39aeaa4143e5f", + "40_mask_TEST1_40.csv:rounded:md5,6e66a2d2975efd282265391ac6f5f117", + "41_mask_TEST1_41.csv:rounded:md5,10ff7e852033c3d1b1fd9b54aa6a5ef6", + "42_mask_TEST1_42.csv:rounded:md5,81938474e1cd053eae9c61a5f229fb55", + "43_mask_TEST1_43.csv:rounded:md5,789f8707c20c81e193a69fd7a07c882e", + "44_mask_TEST1_44.csv:rounded:md5,20f4dd4ffc64a493d461e74b7aaab1af", + "45_mask_TEST1_45.csv:rounded:md5,e0e62301aeca4c41ef0dda76b675a11e", + "46_mask_TEST1_46.csv:rounded:md5,57fd5e9858d0b107e35646f31f96e577", + "47_mask_TEST1_47.csv:rounded:md5,7f8171726aaf1763911b39c209ac8fe6" ], "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-07-12T12:14:21.916439265" + "timestamp": "2024-07-16T12:35:15.511339581" } } \ No newline at end of file diff --git a/workflows/mcmicro.nf b/workflows/mcmicro.nf index dd72d4d..3cc3b7f 100644 --- a/workflows/mcmicro.nf +++ b/workflows/mcmicro.nf @@ -84,7 +84,7 @@ workflow MCMICRO { COREOGRAPH(ASHLAR.out.tif) COREOGRAPH.out.cores .transpose() - .map { meta, img -> [[id: meta.id, subimg: img.toString().split('/')[-1].tokenize(".")[0]], img]} + .map { meta, img -> [[id: meta.id + '_' + img.toString().split('/')[-1].tokenize(".")[0]], img]} .set { ch_segmentation_input } } else { ch_segmentation_input = ASHLAR.out.tif @@ -105,32 +105,17 @@ workflow MCMICRO { } .collectFile(name: 'markers.csv', sort: false, newLine: true) - if (params.coreograph) { - img = ch_segmentation_input.map { meta, img -> [meta.subimg, meta, img]}.dump(tag: "IMG") - mask = DEEPCELL_MESMER.out.mask.map { meta, mask -> [meta.subimg, meta, mask]}.dump(tag: "MASK") - img - .combine(mask, by: [0]) - .combine(ch_mcquant_markers) - .dump(tag: "TEST") - .multiMap { it -> - image: [it[1], it[2]] - mask: [it[1], it[4]] - markers: [it[1], it[5]] - } - | MCQUANT + ch_segmentation_input + .combine(DEEPCELL_MESMER.out.mask, by: [0]) + .combine(ch_mcquant_markers) + .dump(tag: 'MCQUANT in') + .multiMap { meta, image, mask, marker -> + image: [meta, image] + mask: [meta, mask] + markers: [meta, marker] + } + | MCQUANT - } else { - ASHLAR.out.tif - .join(DEEPCELL_MESMER.out.mask) - .combine(ch_mcquant_markers) - .dump(tag: 'MCQUANT in') - .multiMap { it -> - image: [it[0], it[1]] - mask: [it[0], it[2]] - markers: [it[0], it[3]] - } - | MCQUANT - } ch_versions = ch_versions.mix(MCQUANT.out.versions) /* From 4976b7ac391dc97d24c192e51d87fd6fb295100f Mon Sep 17 00:00:00 2001 From: RobJY Date: Tue, 16 Jul 2024 15:51:35 -0400 Subject: [PATCH 04/16] changed coreograph input parameter to tma_dearray as suggested --- nextflow_schema.json | 2 +- workflows/mcmicro.nf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nextflow_schema.json b/nextflow_schema.json index 8d421bf..7ee427a 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -66,7 +66,7 @@ "enum": ["basicpy"], "description": "input that defines type of illumination correction to be performed" }, - "coreograph": { + "tma_dearray": { "type": "boolean", "description": "Apply coreograph module to create separate images before segmentation" } diff --git a/workflows/mcmicro.nf b/workflows/mcmicro.nf index 3cc3b7f..d3a3d5c 100644 --- a/workflows/mcmicro.nf +++ b/workflows/mcmicro.nf @@ -80,7 +80,7 @@ workflow MCMICRO { //ch_versions = ch_versions.mix(BACKSUB.out.versions) // Run Coreograph - if (params.coreograph) { + if (params.tma_dearray) { COREOGRAPH(ASHLAR.out.tif) COREOGRAPH.out.cores .transpose() From 192a47c90e3a888ecf242835a4e287f095873547 Mon Sep 17 00:00:00 2001 From: RobJY Date: Tue, 16 Jul 2024 16:57:44 -0400 Subject: [PATCH 05/16] fixed a couple of coreograph references that I had missed --- nextflow.config | 2 +- tests/main.nf.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nextflow.config b/nextflow.config index 25282b3..f474e9b 100644 --- a/nextflow.config +++ b/nextflow.config @@ -13,7 +13,7 @@ params { input_sample = null input_cycle = null marker_sheet = null - coreograph = false + tma_dearray = false // Illumination correction illumination = null diff --git a/tests/main.nf.test b/tests/main.nf.test index 08bb64c..9582e59 100644 --- a/tests/main.nf.test +++ b/tests/main.nf.test @@ -401,7 +401,7 @@ nextflow_workflow { when { params { segmentation = "mesmer" - coreograph = true + tma_dearray = true } workflow { From 53d8f4c2a76fd64d9e20e0d0ee4d3f0386cc9cee Mon Sep 17 00:00:00 2001 From: RobJY Date: Mon, 22 Jul 2024 14:33:06 -0400 Subject: [PATCH 06/16] changed coreograph test to use input file from test data repo --- conf/modules.config | 2 +- tests/main.nf.test | 94 +------------------------------------ tests/main.nf.test.snap | 100 ++-------------------------------------- 3 files changed, 6 insertions(+), 190 deletions(-) diff --git a/conf/modules.config b/conf/modules.config index 68dd60e..692f4a1 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -70,7 +70,7 @@ process { } withName: "COREOGRAPH" { - ext.args = '--downsampleFactor 1' + ext.args = '--downsampleFactor 5' } /* diff --git a/tests/main.nf.test b/tests/main.nf.test index 213449c..221dc14 100644 --- a/tests/main.nf.test +++ b/tests/main.nf.test @@ -536,7 +536,7 @@ nextflow_workflow { input[0] = Channel.of( [ [id:"TEST1", cycle_number:1, channel_count:4], - "/home/pollen/github/mcmicro-nf-core/assets/coreograph_test.tif", + "https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/imaging/core_detection/single_core_dapi.tif", [], [], ], @@ -556,99 +556,7 @@ nextflow_workflow { assert snapshot ( path("$outputDir/registration/ashlar/TEST1.ome.tif"), path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_1.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_2.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_3.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_4.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_5.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_6.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_7.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_8.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_9.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_10.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_11.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_12.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_13.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_14.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_15.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_16.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_17.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_18.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_19.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_20.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_21.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_22.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_23.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_24.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_25.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_26.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_27.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_28.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_29.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_30.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_31.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_32.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_33.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_34.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_35.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_36.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_37.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_38.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_39.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_40.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_41.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_42.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_43.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_44.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_45.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_46.tif"), - path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_47.tif"), CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/1_mask_TEST1_1.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/2_mask_TEST1_2.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/3_mask_TEST1_3.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/4_mask_TEST1_4.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/5_mask_TEST1_5.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/6_mask_TEST1_6.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/7_mask_TEST1_7.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/8_mask_TEST1_8.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/9_mask_TEST1_9.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/10_mask_TEST1_10.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/11_mask_TEST1_11.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/12_mask_TEST1_12.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/13_mask_TEST1_13.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/14_mask_TEST1_14.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/15_mask_TEST1_15.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/16_mask_TEST1_16.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/17_mask_TEST1_17.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/18_mask_TEST1_18.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/19_mask_TEST1_19.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/20_mask_TEST1_20.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/21_mask_TEST1_21.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/22_mask_TEST1_22.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/23_mask_TEST1_23.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/24_mask_TEST1_24.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/25_mask_TEST1_25.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/26_mask_TEST1_26.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/27_mask_TEST1_27.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/28_mask_TEST1_28.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/29_mask_TEST1_29.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/30_mask_TEST1_30.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/31_mask_TEST1_31.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/32_mask_TEST1_32.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/33_mask_TEST1_33.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/34_mask_TEST1_34.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/35_mask_TEST1_35.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/36_mask_TEST1_36.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/37_mask_TEST1_37.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/38_mask_TEST1_38.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/39_mask_TEST1_39.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/40_mask_TEST1_40.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/41_mask_TEST1_41.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/42_mask_TEST1_42.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/43_mask_TEST1_43.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/44_mask_TEST1_44.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/45_mask_TEST1_45.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/46_mask_TEST1_46.csv"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/47_mask_TEST1_47.csv"), ).match() }, { assert workflow.success } diff --git a/tests/main.nf.test.snap b/tests/main.nf.test.snap index 732a430..95cd1de 100644 --- a/tests/main.nf.test.snap +++ b/tests/main.nf.test.snap @@ -455,106 +455,14 @@ }, "cycle: no illumination correction, coreograph": { "content": [ - "TEST1.ome.tif:md5,4b667e356ab2f1c675dd74ef1436d902", - "mask_TEST1_1.tif:md5,ba7a1801058f54991f7235e8157b136b", - "mask_TEST1_2.tif:md5,fdf09860d899bd7bb3061d6106746b68", - "mask_TEST1_3.tif:md5,829e9043d6f2cce6895313e1143c5699", - "mask_TEST1_4.tif:md5,7fd8922a931a46b8bc69c4125337b97e", - "mask_TEST1_5.tif:md5,02918ed645d045aa221206d95a10befe", - "mask_TEST1_6.tif:md5,c4ad806d6366c2ced2b739c02d3ce256", - "mask_TEST1_7.tif:md5,8773f1ac2586e2c22e751a6a7b0ef638", - "mask_TEST1_8.tif:md5,bdb3d059217103017fdafae8433fadfb", - "mask_TEST1_9.tif:md5,ec3b7db9867410223375be113e35f867", - "mask_TEST1_10.tif:md5,8e52a81283a64faee2e3cead3b0ef843", - "mask_TEST1_11.tif:md5,eda1d995f31fe6a2fa0da8b5805c54b5", - "mask_TEST1_12.tif:md5,5026564cd3f5d9d178e5611bc630c252", - "mask_TEST1_13.tif:md5,1bece9e6aa117a9b9a2d5fdcf0658364", - "mask_TEST1_14.tif:md5,21d324c70f3b64da559b4291c40787ee", - "mask_TEST1_15.tif:md5,8dd36daf2d79c8016bfae83089be43d1", - "mask_TEST1_16.tif:md5,289dcc5810a448960f7df0ca6f8aeb18", - "mask_TEST1_17.tif:md5,3280af6656f400d07d317eeb8494edef", - "mask_TEST1_18.tif:md5,3ad7eb70674eb94e057feb77f385b567", - "mask_TEST1_19.tif:md5,228d673a5b0e007c3b0a4365b35772fd", - "mask_TEST1_20.tif:md5,85ffdbc124dd191e32d93b0526b0df36", - "mask_TEST1_21.tif:md5,c5a5d2371fd68b458022c852e1c888eb", - "mask_TEST1_22.tif:md5,dba833e63ce1e9fd450fe2b1bcd2adbd", - "mask_TEST1_23.tif:md5,6d605698a1c15fe7599dffe51aed6b9d", - "mask_TEST1_24.tif:md5,35474f9d6e6e5fd31fa8fb94f582fc11", - "mask_TEST1_25.tif:md5,5723d9ee6e89e7676b6fd0c8f0ef87df", - "mask_TEST1_26.tif:md5,67a8f01c88439d61b740d86bb562afb1", - "mask_TEST1_27.tif:md5,2495ea80db37124c5f2ac685aab6d19d", - "mask_TEST1_28.tif:md5,c3b1968423ded13832ad106d0df65431", - "mask_TEST1_29.tif:md5,f748434e458ab60c3227b68dcc0f8795", - "mask_TEST1_30.tif:md5,dd4b9b5d0c271202f1e18c23464d4c27", - "mask_TEST1_31.tif:md5,5a3921df1616ab3751cabde4e039a029", - "mask_TEST1_32.tif:md5,aac51cb335a1b71be762e7974fd967ab", - "mask_TEST1_33.tif:md5,478d4d0dba9db497e0eb17e901b2e072", - "mask_TEST1_34.tif:md5,e392b1a42073ffbe929568741c2c56bb", - "mask_TEST1_35.tif:md5,d7f025d24b4087d7ec67d23561b0cf16", - "mask_TEST1_36.tif:md5,77d27a9a270c16455f6f8685be452f96", - "mask_TEST1_37.tif:md5,23443136d975fd449d7fe125d50b775b", - "mask_TEST1_38.tif:md5,8e78ee0ad2e114eb4247d01214c34093", - "mask_TEST1_39.tif:md5,981e913fcfec7b42d4214f95e80c424e", - "mask_TEST1_40.tif:md5,706fc029d0f29e749f6147c1f4bb5b4e", - "mask_TEST1_41.tif:md5,83dc2edec93a0c6030c829bb598d4c53", - "mask_TEST1_42.tif:md5,ed23194ed8f44b0bb5e8adbe93ba35fc", - "mask_TEST1_43.tif:md5,d0a406e5444637a4cc851959d38140c7", - "mask_TEST1_44.tif:md5,7f82a7a89e66c6ae5d73d4a84fe97bbc", - "mask_TEST1_45.tif:md5,eaea2a997bb231c6c0c08f931419542b", - "mask_TEST1_46.tif:md5,772cfa4322c85b28d8d3439e6179fae6", - "mask_TEST1_47.tif:md5,2edb07cba0b86a90efbef232f26d1b8b", - "1_mask_TEST1_1.csv:rounded:md5,a125a716375795805baeaedc663e8c17", - "2_mask_TEST1_2.csv:rounded:md5,da512f703f05b73392853361e96844cf", - "3_mask_TEST1_3.csv:rounded:md5,cef3fd27ae5ddb05873fa6feeb87ba36", - "4_mask_TEST1_4.csv:rounded:md5,b97ddd3fbc3ff583aefc3ffb31b2b579", - "5_mask_TEST1_5.csv:rounded:md5,7cf80746d3ef0d14c60d30e0a34baf57", - "6_mask_TEST1_6.csv:rounded:md5,88c40dd535b9721343b849b533d5114f", - "7_mask_TEST1_7.csv:rounded:md5,f3c93fd36c0258a70f78aafeff8d2456", - "8_mask_TEST1_8.csv:rounded:md5,ec5163ff0fdac175ba4136001e6e8129", - "9_mask_TEST1_9.csv:rounded:md5,40e8414f1ddb32322797dd24dcf0c94d", - "10_mask_TEST1_10.csv:rounded:md5,88888b39611e403cec429c5e853e454f", - "11_mask_TEST1_11.csv:rounded:md5,115536dcf4e8b93ec8f9edece045a100", - "12_mask_TEST1_12.csv:rounded:md5,f52995e23bbf7bcafdab46e82311932c", - "13_mask_TEST1_13.csv:rounded:md5,fa2a4393fb30e20ea523ca4886431134", - "14_mask_TEST1_14.csv:rounded:md5,2d5ec14301d60b24dfa7d44cb530ef92", - "15_mask_TEST1_15.csv:rounded:md5,3689f3ecb776c083b2e52eeb54b5c4c3", - "16_mask_TEST1_16.csv:rounded:md5,a56468f308a68306b68ac227eb1e0c9a", - "17_mask_TEST1_17.csv:rounded:md5,fb95739a681f1c14bf501711128f4785", - "18_mask_TEST1_18.csv:rounded:md5,7cd59af88becb6490aaf8d501b6524c4", - "19_mask_TEST1_19.csv:rounded:md5,b3ef0b127fdea20d23a4712b263debcb", - "20_mask_TEST1_20.csv:rounded:md5,80c4eb68ea7c1125b4502bb3117466b8", - "21_mask_TEST1_21.csv:rounded:md5,bf972b95d8b152129ecde5c09019661b", - "22_mask_TEST1_22.csv:rounded:md5,c3701c16db941942412c95cbd7be264e", - "23_mask_TEST1_23.csv:rounded:md5,ddf78293a28b7d232efb4cc08276c546", - "24_mask_TEST1_24.csv:rounded:md5,0577754ad841c493d0b74fb245cb0202", - "25_mask_TEST1_25.csv:rounded:md5,94f07122ebf58c5bc81ec274ad7faaa0", - "26_mask_TEST1_26.csv:rounded:md5,cdbf1e1edd00251e640f3dc9f1249bfa", - "27_mask_TEST1_27.csv:rounded:md5,4f4154669989de86d0f9179f22a6ae02", - "28_mask_TEST1_28.csv:rounded:md5,eb3017af35690dcd4e1b23dee0389790", - "29_mask_TEST1_29.csv:rounded:md5,6fefd178e0af1e2e32ccb0caf25ae082", - "30_mask_TEST1_30.csv:rounded:md5,74557027dbd25a85a8a3001530c3b9cd", - "31_mask_TEST1_31.csv:rounded:md5,2acb00dd5584c0d59ab8b0ce8c09c48d", - "32_mask_TEST1_32.csv:rounded:md5,946278c08a6c09f93c841285047daa6e", - "33_mask_TEST1_33.csv:rounded:md5,0c307d5303aabc3eaf0364f6b93323a4", - "34_mask_TEST1_34.csv:rounded:md5,af1e478bcb84d16cbcb98cb32a85b060", - "35_mask_TEST1_35.csv:rounded:md5,d3ef58ddcb221bc8c0819e3a08d4120e", - "36_mask_TEST1_36.csv:rounded:md5,7fdf13290ef6965a3431e743b281421a", - "37_mask_TEST1_37.csv:rounded:md5,eda1fa49c691fec5ccaed36f50c8e873", - "38_mask_TEST1_38.csv:rounded:md5,2cb2aee630b148967b38e0d89bc9dfa1", - "39_mask_TEST1_39.csv:rounded:md5,730bb6fa5116a037acd39aeaa4143e5f", - "40_mask_TEST1_40.csv:rounded:md5,6e66a2d2975efd282265391ac6f5f117", - "41_mask_TEST1_41.csv:rounded:md5,10ff7e852033c3d1b1fd9b54aa6a5ef6", - "42_mask_TEST1_42.csv:rounded:md5,81938474e1cd053eae9c61a5f229fb55", - "43_mask_TEST1_43.csv:rounded:md5,789f8707c20c81e193a69fd7a07c882e", - "44_mask_TEST1_44.csv:rounded:md5,20f4dd4ffc64a493d461e74b7aaab1af", - "45_mask_TEST1_45.csv:rounded:md5,e0e62301aeca4c41ef0dda76b675a11e", - "46_mask_TEST1_46.csv:rounded:md5,57fd5e9858d0b107e35646f31f96e577", - "47_mask_TEST1_47.csv:rounded:md5,7f8171726aaf1763911b39c209ac8fe6" + "TEST1.ome.tif:md5,755b8a7782f9c561bb9fd6bf5e19f798", + "mask_TEST1_1.tif:md5,525d07ef2a89a8323474ff3017737ac2", + "1_mask_TEST1_1.csv:rounded:md5,5337b79dd086f0ebd0a8ffe2149d9826" ], "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-07-16T12:35:15.511339581" + "timestamp": "2024-07-22T13:53:08.522915839" } } \ No newline at end of file From 792970d17f72eeee24d5d904f7ccd872595ec50c Mon Sep 17 00:00:00 2001 From: RobJY Date: Mon, 22 Jul 2024 15:28:46 -0400 Subject: [PATCH 07/16] added missing coreograph module; thanks Jeremy! --- modules/nf-core/coreograph/Dockerfile | 12 +++++ modules/nf-core/coreograph/environment.yml | 5 ++ modules/nf-core/coreograph/main.nf | 48 +++++++++++++++++++ modules/nf-core/coreograph/meta.yml | 56 ++++++++++++++++++++++ 4 files changed, 121 insertions(+) create mode 100644 modules/nf-core/coreograph/Dockerfile create mode 100644 modules/nf-core/coreograph/environment.yml create mode 100644 modules/nf-core/coreograph/main.nf create mode 100644 modules/nf-core/coreograph/meta.yml diff --git a/modules/nf-core/coreograph/Dockerfile b/modules/nf-core/coreograph/Dockerfile new file mode 100644 index 0000000..b57a58c --- /dev/null +++ b/modules/nf-core/coreograph/Dockerfile @@ -0,0 +1,12 @@ +FROM tensorflow/tensorflow:1.15.0-py3 + +RUN apt-get update +RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata +RUN apt-get install -y python3-opencv +RUN apt-get install -y libtiff5-dev git + +RUN pip install cython scikit-image==0.14.2 matplotlib tifffile==2020.2.16 scipy==1.1.0 opencv-python==4.3.0.36 + +RUN pip install git+https://github.com/FZJ-INM1-BDA/pytiff.git@0701f28e5862c26024e8daa34201005b16db4c8f + +COPY . /app diff --git a/modules/nf-core/coreograph/environment.yml b/modules/nf-core/coreograph/environment.yml new file mode 100644 index 0000000..0ee4a96 --- /dev/null +++ b/modules/nf-core/coreograph/environment.yml @@ -0,0 +1,5 @@ +name: coreograph +channels: + - conda-forge + - bioconda + - defaults diff --git a/modules/nf-core/coreograph/main.nf b/modules/nf-core/coreograph/main.nf new file mode 100644 index 0000000..52a1adc --- /dev/null +++ b/modules/nf-core/coreograph/main.nf @@ -0,0 +1,48 @@ +process COREOGRAPH { + tag "$meta.id" + label 'process_single' + + container "docker.io/labsyspharm/unetcoreograph:2.2.9" + + input: + tuple val(meta), path(image) + + output: + tuple val(meta), path("*[0-9]*.tif"), emit: cores + tuple val(meta), path("./masks/"), emit: masks + tuple val(meta), path("TMA_MAP.tif"), emit: tma_map + tuple val(meta), path("centroidsY-X.txt"), emit: centroids + + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def VERSION = '2.2.9' + + """ + python /app/UNetCoreograph.py \\ + --imagePath ${image}\\ + --outputPath .\\ + $args + + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + coreograph: $VERSION + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch TMA_MAP.tif + cat <<-END_VERSIONS > versions.yml + "${task.process}": + coreograph: $VERSION + END_VERSIONS + """ +} diff --git a/modules/nf-core/coreograph/meta.yml b/modules/nf-core/coreograph/meta.yml new file mode 100644 index 0000000..cbff776 --- /dev/null +++ b/modules/nf-core/coreograph/meta.yml @@ -0,0 +1,56 @@ +name: "coreograph" +description: Great....yet another TMA dearray program. What does this one do? Coreograph uses UNet, a deep learning model, to identify complete/incomplete tissue cores on a tissue microarray. It has been trained on 9 TMA slides of different sizes and tissue types. +keywords: + - UNet + - TMA dearray + - Segmentation + - Cores +tools: + - "coreograph": + description: "A TMA dearray porgram that uses UNet, a deep learning model, to identify complete/incomplete tissue cores on a tissue microarray." + homepage: "https://mcmicro.org/parameters/core.html#coreograph" + documentation: "https://mcmicro.org/troubleshooting/tuning/coreograph.html" + tool_dev_url: "https://github.com/HMS-IDAC/UNetCoreograph" + doi: 10.1038/s41592-021-01308-y + licence: "MIT License" +input: + - image: + type: file + description: ome.tif/tif file + pattern: "*.{ome.tif,tif}" + - meta: + type: map + description: | + Groovy Map containing sample information +output: + # + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - cores: + type: file + description: Complete/Incomplete tissue cores + pattern: "*.{tif}" + - masks: + type: file + description: Binary masks for the Complete/Incomplete tissue cores + pattern: "./masks/*.{tif}" + - tma_map: + type: file + description: A TMA map showing labels and outlines + pattern: "TMA_MAP.tif" + - centroids: + type: file + description: A text file listing centroids of each core in format Y, X + pattern: "centroidsY-X.txt" + - meta: + type: map + description: | + Groovy Map containing sample information +authors: + - "@arozhada" + - "@MargotCh" +maintainers: + - "@arozhada" + - "@MargotCh" From 917c5c2707397e6d0d6d06293810b662b76110fb Mon Sep 17 00:00:00 2001 From: RobJY Date: Thu, 1 Aug 2024 10:41:17 -0400 Subject: [PATCH 08/16] removed marker and sample sheets used for local testing --- assets/markers_1_coreograph.csv | 2 -- assets/samplesheet_1_row_sample_cycle_coreograph.csv | 2 -- 2 files changed, 4 deletions(-) delete mode 100644 assets/markers_1_coreograph.csv delete mode 100644 assets/samplesheet_1_row_sample_cycle_coreograph.csv diff --git a/assets/markers_1_coreograph.csv b/assets/markers_1_coreograph.csv deleted file mode 100644 index 6a66b7c..0000000 --- a/assets/markers_1_coreograph.csv +++ /dev/null @@ -1,2 +0,0 @@ -channel_number,cycle_number,marker_name,filter,excitation_wavelength -1,1,DNA_6,DAPI,395 diff --git a/assets/samplesheet_1_row_sample_cycle_coreograph.csv b/assets/samplesheet_1_row_sample_cycle_coreograph.csv deleted file mode 100644 index baae966..0000000 --- a/assets/samplesheet_1_row_sample_cycle_coreograph.csv +++ /dev/null @@ -1,2 +0,0 @@ -sample,cycle_number,channel_count,image_tiles -TEST1,1,10,/home/pollen/github/mcmicro-nf-core/assets/coreograph_test.tif From 71e7b7c791c79075e741f4a1fcb0c2b84e292261 Mon Sep 17 00:00:00 2001 From: RobJY Date: Thu, 1 Aug 2024 10:47:18 -0400 Subject: [PATCH 09/16] fixed tma_dearray description with suggestion from PR --- nextflow_schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nextflow_schema.json b/nextflow_schema.json index eec27a8..b54ed79 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -68,7 +68,7 @@ }, "tma_dearray": { "type": "boolean", - "description": "Apply coreograph module to create separate images before segmentation" + "description": "If the sample is a tissue microarray (TMA), set this to 'true' to generate a separate output for each tissue core for pipeline steps beginning with cell segmentation. This also tends to speed up processing and reduce RAM usage." }, "segmentation": { "type": "string", From cf32e80d5197232892a129410377d87f7eefff59 Mon Sep 17 00:00:00 2001 From: RobJY Date: Thu, 1 Aug 2024 11:04:13 -0400 Subject: [PATCH 10/16] cleaned up coreograph map with suggestion from PR --- workflows/mcmicro.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/mcmicro.nf b/workflows/mcmicro.nf index b0cbf95..ab6b604 100644 --- a/workflows/mcmicro.nf +++ b/workflows/mcmicro.nf @@ -94,7 +94,7 @@ workflow MCMICRO { COREOGRAPH(ASHLAR.out.tif) COREOGRAPH.out.cores .transpose() - .map { meta, img -> [[id: meta.id + '_' + img.toString().split('/')[-1].tokenize(".")[0]], img]} + .map { meta, img -> [[id: meta.id + '_' + img.fileName.toString().tokenize('.')[0]], img]} .set { ch_segmentation_input } } else { ch_segmentation_input = ASHLAR.out.tif From b8829f419bf9ac4b71bb6e1321ab5bbe698e1ce9 Mon Sep 17 00:00:00 2001 From: RobJY Date: Thu, 1 Aug 2024 17:18:12 -0400 Subject: [PATCH 11/16] added parameter pixel_size to compute downsampleFactor --- conf/modules.config | 2 +- nextflow_schema.json | 4 ++++ subworkflows/local/utils_nfcore_mcmicro_pipeline/main.nf | 3 +++ tests/main.nf.test | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/conf/modules.config b/conf/modules.config index 692f4a1..5eae5dd 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -70,7 +70,7 @@ process { } withName: "COREOGRAPH" { - ext.args = '--downsampleFactor 5' + ext.args = { "--downsampleFactor ${Math.round(Math.log(0.65 * 32 / params.pixel_size) / Math.log(2))}" } } /* diff --git a/nextflow_schema.json b/nextflow_schema.json index b54ed79..0d6ca93 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -78,6 +78,10 @@ "cellpose_model": { "type": "string", "description": "optional model file for cellpose segmentation" + }, + "pixel_size": { + "type": "number", + "description": "required input when the sample is a tissue microarray (TMA). This is needed to compute the downsample factor." } } }, diff --git a/subworkflows/local/utils_nfcore_mcmicro_pipeline/main.nf b/subworkflows/local/utils_nfcore_mcmicro_pipeline/main.nf index 6e14870..735e760 100644 --- a/subworkflows/local/utils_nfcore_mcmicro_pipeline/main.nf +++ b/subworkflows/local/utils_nfcore_mcmicro_pipeline/main.nf @@ -180,6 +180,9 @@ def validateInputParameters() { error "You can only provide a cellpose model if you have selected cellpose as one of your segmentation methods" } + if (params.tma_dearray && !params.pixel_size) { + error "You must provide an pixel_size in microns when the sample is a tissue microarray (TMA)." + } } // diff --git a/tests/main.nf.test b/tests/main.nf.test index 221dc14..ec841a7 100644 --- a/tests/main.nf.test +++ b/tests/main.nf.test @@ -529,7 +529,7 @@ nextflow_workflow { params { segmentation = "mesmer" tma_dearray = true - + pixel_size = 0.7 } workflow { """ From d828fb82bd546c691747f4559d840cc7c29082e3 Mon Sep 17 00:00:00 2001 From: RobJY Date: Thu, 1 Aug 2024 17:55:26 -0400 Subject: [PATCH 12/16] changed coreograph test of mcquant output to summarizeCsv as suggested in PR --- tests/main.nf.test | 2 +- tests/main.nf.test.snap | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/tests/main.nf.test b/tests/main.nf.test index ec841a7..921e19b 100644 --- a/tests/main.nf.test +++ b/tests/main.nf.test @@ -556,7 +556,7 @@ nextflow_workflow { assert snapshot ( path("$outputDir/registration/ashlar/TEST1.ome.tif"), path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_1.tif"), - CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/1_mask_TEST1_1.csv"), + CsvUtils.summarizeCsv("$outputDir/quantification/mcquant/mesmer/1_mask_TEST1_1.csv"), ).match() }, { assert workflow.success } diff --git a/tests/main.nf.test.snap b/tests/main.nf.test.snap index 95cd1de..980d434 100644 --- a/tests/main.nf.test.snap +++ b/tests/main.nf.test.snap @@ -457,12 +457,27 @@ "content": [ "TEST1.ome.tif:md5,755b8a7782f9c561bb9fd6bf5e19f798", "mask_TEST1_1.tif:md5,525d07ef2a89a8323474ff3017737ac2", - "1_mask_TEST1_1.csv:rounded:md5,5337b79dd086f0ebd0a8ffe2149d9826" + { + "headers": [ + "CellID", + "DNA_6", + "X_centroid", + "Y_centroid", + "Area", + "MajorAxisLength", + "MinorAxisLength", + "Eccentricity", + "Solidity", + "Extent", + "Orientation" + ], + "rowCount": 4804 + } ], "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-07-22T13:53:08.522915839" + "timestamp": "2024-08-01T17:44:21.535294636" } } \ No newline at end of file From b404d688c45ca4664c29901c85b0d03c5304f376 Mon Sep 17 00:00:00 2001 From: RobJY Date: Thu, 1 Aug 2024 18:07:59 -0400 Subject: [PATCH 13/16] added default pixel_size to config --- nextflow.config | 1 + 1 file changed, 1 insertion(+) diff --git a/nextflow.config b/nextflow.config index 2864aa6..0d5c70c 100644 --- a/nextflow.config +++ b/nextflow.config @@ -14,6 +14,7 @@ params { input_cycle = null marker_sheet = null tma_dearray = false + pixel_size = null segmentation = 'mesmer' cellpose_model = [] From 1719c17ee47b753f09f8ed686d4ade87ff0c03a6 Mon Sep 17 00:00:00 2001 From: RobJY Date: Fri, 2 Aug 2024 17:33:41 -0400 Subject: [PATCH 14/16] updated validation and schema text as suggested in PR --- nextflow_schema.json | 3 ++- subworkflows/local/utils_nfcore_mcmicro_pipeline/main.nf | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/nextflow_schema.json b/nextflow_schema.json index 0d6ca93..1130cd3 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -81,7 +81,8 @@ }, "pixel_size": { "type": "number", - "description": "required input when the sample is a tissue microarray (TMA). This is needed to compute the downsample factor." + "description": "Pixel width of input image data, in microns", + "help_text": "You must set this parameter when enabling TMA de-arraying with the `tma_dearray` parameter. This is required for the de-arraying module to correctly process the image." } } }, diff --git a/subworkflows/local/utils_nfcore_mcmicro_pipeline/main.nf b/subworkflows/local/utils_nfcore_mcmicro_pipeline/main.nf index 735e760..9b7b1be 100644 --- a/subworkflows/local/utils_nfcore_mcmicro_pipeline/main.nf +++ b/subworkflows/local/utils_nfcore_mcmicro_pipeline/main.nf @@ -181,7 +181,7 @@ def validateInputParameters() { } if (params.tma_dearray && !params.pixel_size) { - error "You must provide an pixel_size in microns when the sample is a tissue microarray (TMA)." + error "You must also provide the pixel_size parameter (image pixel width in microns) when enabling tma_dearray." } } From a62308bda5ee1a240c7a38396a1a507fce386e91 Mon Sep 17 00:00:00 2001 From: RobJY Date: Mon, 5 Aug 2024 14:29:03 -0400 Subject: [PATCH 15/16] added validation test as suggested in PR --- .../tests/initialisation.nf.test | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/subworkflows/local/utils_nfcore_mcmicro_pipeline/tests/initialisation.nf.test b/subworkflows/local/utils_nfcore_mcmicro_pipeline/tests/initialisation.nf.test index 3486df4..8c9b415 100644 --- a/subworkflows/local/utils_nfcore_mcmicro_pipeline/tests/initialisation.nf.test +++ b/subworkflows/local/utils_nfcore_mcmicro_pipeline/tests/initialisation.nf.test @@ -24,5 +24,25 @@ nextflow_workflow { }, + test("Error on tma_dearray without pixel_size") { + when { + params { + input_cycle = "${projectDir}/assets/samplesheet-test.csv" + marker_sheet = "${projectDir}/assets/markers_1_sp.csv" + tma_dearray = true + + } + workflow { + """ + input = [false, false, false, false, [], '$outputDir', params.input_cycle, [], params.marker_sheet] + """ + } + } + then { + assert workflow.failed + assert workflow.stdout*.contains("pixel_size").any() + } + }, + ] } From 2d07fad7f9e4d4baa921ff44197bba0e91d268f5 Mon Sep 17 00:00:00 2001 From: RobJY Date: Mon, 5 Aug 2024 14:47:20 -0400 Subject: [PATCH 16/16] moved coreograph output to outdir/tma_dearray as suggested in PR --- conf/modules.config | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/conf/modules.config b/conf/modules.config index 5eae5dd..91150dd 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -71,6 +71,11 @@ process { withName: "COREOGRAPH" { ext.args = { "--downsampleFactor ${Math.round(Math.log(0.65 * 32 / params.pixel_size) / Math.log(2))}" } + publishDir = [ + path: { "${params.outdir}/tma_dearray" }, + mode: params.publish_dir_mode, + ] + } /*