Skip to content

Commit a027631

Browse files
authored
Merge pull request #54 from CaroAMN/dev
Adding Review feedback
2 parents 6cf2bd8 + 08ea7bd commit a027631

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2434
-1496
lines changed

assets/numorph_params_schema.json

Lines changed: 525 additions & 0 deletions
Large diffs are not rendered by default.

assets/params_template_lsmquant.csv

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
Parameter,Value
2+
group,TEST;WT;R1
3+
channel_num,C01;C00
4+
markers,topro;ctip2
5+
position_exp,[\d*;\d*];Z\d*
6+
resolution,1.2100;1.2100;4
7+
orientation,ail
8+
hemisphere,both
9+
use_processed_images,false
10+
ignore_markers,Auto
11+
save_images,true
12+
save_samples,true
13+
adjust_intensity,true
214
darkfield_intensity,101
15+
adjust_tile_shading,basic
16+
adjust_tile_position,true
317
update_intensity_channels,
418
single_sheet,true
519
ls_width,50
@@ -8,14 +22,15 @@ sampling_frequency,0.2
822
shading_correction_tiles,
923
shading_smoothness,2
1024
shading_intensity,1
11-
update_z_adjustment,false
12-
z_positions,0.01
13-
z_window,5
14-
z_initial,0
25+
channel_alignment,update
1526
align_method,translation
1627
align_tiles,
1728
align_channels,
1829
align_slices,
30+
update_z_adjustment,false
31+
z_positions,0.01
32+
z_window,5
33+
z_initial,0
1934
align_stepsize,5
2035
only_pc,false
2136
align_chunks,
@@ -26,6 +41,7 @@ chunk_pad,30
2641
mask_int_threshold,
2742
resample_s,3;3;1
2843
hist_match,64
44+
stitch_images,true
2945
sift_refinement,true
3046
load_alignment_params,true
3147
overlap,0.20
@@ -49,28 +65,10 @@ smooth_img,false
4965
smooth_sigma,
5066
flip_axis,none
5167
rotate_axis,0
52-
group,TEST;WT;R1
53-
channel_num,C01;C00
54-
markers,topro;ctip2
55-
position_exp,[\d*;\d*];Z\d*
56-
resolution,1.2100;1.2100;4
57-
overlap,0.15
58-
orientation,ail
59-
hemisphere,both
60-
channel_alignment,update
61-
adjust_intensity,true
62-
stitch_images,true
63-
use_processed_images,false
64-
ignore_markers,Auto
65-
save_images,true
66-
save_samples,true
67-
adjust_tile_shading,basic
68-
adjust_tile_position,true
6968
resample_images,true
7069
register_images,true
7170
count_nuclei,true
7271
classify_cells,true
73-
use_processed_images,false
7472
resample_resolution,25
7573
resample_channels,
7674
use_annotation_mask,false
@@ -103,4 +101,3 @@ measure_coloc,
103101
n_channels,
104102
use_mask,
105103
mask_file,
106-
resample_resolution,

conf/modules.config

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ process {
3333
]
3434
}
3535

36-
withName: 'NUMORPHINTENSITY' {
36+
withName: 'NUMORPH_INTENSITY' {
3737
cpus = { 2 * task.attempt }
3838
memory = { 30.GB * task.attempt }
3939
time = { 2.h * task.attempt }
4040
publishDir = [
41-
path: { "${params.outdir}/numorphintensity/" },
41+
path: { "${params.outdir}/numorph_intensity" },
4242
mode: params.publish_dir_mode,
43-
pattern: 'results/**/*',
43+
pattern: 'results/**',
4444
saveAs: { filename ->
4545
if (filename.equals('versions.yml')) {
4646
null
@@ -87,9 +87,9 @@ process {
8787
]
8888
}
8989

90-
withName: 'NUMORPHRESAMPLE' {
90+
withName: 'NUMORPH_RESAMPLE' {
9191
publishDir = [
92-
path: { "${params.outdir}/numorphresample/" },
92+
path: { "${params.outdir}/numorph_resample/" },
9393
mode: params.publish_dir_mode,
9494
pattern: 'results/**/*',
9595
saveAs: { filename ->

docs/usage.md

Lines changed: 26 additions & 27 deletions
Large diffs are not rendered by default.

modules.json

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,27 @@
55
"https://github.com/nf-core/modules.git": {
66
"modules": {
77
"nf-core": {
8+
"mat2json": {
9+
"branch": "master",
10+
"git_sha": "163b8a7181a343e98a292c626889a81d2da90298",
11+
"installed_by": ["modules"]
12+
},
813
"multiqc": {
914
"branch": "master",
1015
"git_sha": "af27af1be706e6a2bb8fe454175b0cdf77f47b49",
1116
"installed_by": ["modules"]
1217
},
13-
"unzip": {
18+
"numorph/intensity": {
1419
"branch": "master",
15-
"git_sha": "41dfa3f7c0ffabb96a6a813fe321c6d1cc5b6e46",
20+
"git_sha": "163b8a7181a343e98a292c626889a81d2da90298",
1621
"installed_by": ["modules"]
1722
},
18-
"unzipfiles": {
23+
"numorph/resample": {
24+
"branch": "master",
25+
"git_sha": "380cb90926b8c28558cb11479da5ff45bc4f1c5d",
26+
"installed_by": ["modules"]
27+
},
28+
"unzip": {
1929
"branch": "master",
2030
"git_sha": "41dfa3f7c0ffabb96a6a813fe321c6d1cc5b6e46",
2131
"installed_by": ["modules"]

modules/local/numorph3dunet/main.nf

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ process NUMORPH3DUNET {
99
path(model_file)
1010

1111
output:
12-
path "${prefix}/*" , emit: cellcounts
13-
path "versions.yml" , emit: versions
12+
tuple val(meta), path ("${prefix}/") , emit: cellcounts
13+
14+
tuple val("${task.process}"), val('numorph-3dunet'), val('1.0.0'), emit: versions_numorph_3dunet, topic: versions
1415

1516
when:
1617
task.ext.when == null || task.ext.when
@@ -38,10 +39,6 @@ process NUMORPH3DUNET {
3839
--sample_id ${prefix} \\
3940
$args
4041
41-
cat <<-END_VERSIONS > versions.yml
42-
"${task.process}":
43-
numorph3dunet: 1.0
44-
END_VERSIONS
4542
"""
4643

4744
stub:
@@ -53,9 +50,5 @@ process NUMORPH3DUNET {
5350
touch ${prefix}/${prefix}.csv
5451
touch ${prefix}/${prefix}_counts.csv
5552
56-
cat <<-END_VERSIONS > versions.yml
57-
"${task.process}":
58-
numorph3dunet: 1.0
59-
END_VERSIONS
6053
"""
6154
}

modules/local/numorph3dunet/tests/main.nf.test

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ nextflow_process {
1212

1313
config './nextflow.config'
1414

15-
test("Numorph3DUnet test - tif") {
15+
test("numorph-3DUnet test - tif") {
1616

1717
setup {
1818
run ("UNZIP") {
@@ -30,7 +30,7 @@ nextflow_process {
3030

3131
when {
3232
params {
33-
outdir = "$workDir/output"
33+
outdir = "$outputDir"
3434
}
3535
process {
3636
"""
@@ -47,13 +47,21 @@ nextflow_process {
4747
}
4848

4949
then {
50-
assert process.success // Check process completed successfully
51-
assert snapshot(process.out).match() // Validate outputs match expected snapshot
50+
def cellcounDir = process.out.cellcounts.get(0).get(1)
51+
def cellcountFiles = getAllFilesFromDir(cellcounDir, relative: true, includeDir: false)
52+
assertAll(
53+
{assert process.success },
54+
{assert cellcountFiles.size() == 2 },
55+
{ assert snapshot(
56+
cellcountFiles,
57+
process.out.versions
58+
).match() }
59+
)
5260
}
5361

5462
}
5563

56-
test("Numorph3DUnet stub test - tif") {
64+
test("numorph-3DUnet stub test - tif") {
5765

5866
options '-stub'
5967

modules/local/numorph3dunet/tests/main.nf.test.snap

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,60 @@
11
{
2-
"Numorph3DUnet test - tif": {
2+
"numorph-3DUnet test - tif": {
33
"content": [
4-
{
5-
"0": [
6-
[
7-
"TEST1.csv:md5,fa930f84f08fa69d825bca59cc08dcec",
8-
"TEST1_counts.csv:md5,6f482bb276d66163f0646ba6d4712075"
9-
]
10-
],
11-
"1": [
12-
"versions.yml:md5,a48272c66a933f2bbbaa710df8129f03"
13-
],
14-
"cellcounts": [
15-
[
16-
"TEST1.csv:md5,fa930f84f08fa69d825bca59cc08dcec",
17-
"TEST1_counts.csv:md5,6f482bb276d66163f0646ba6d4712075"
18-
]
19-
],
20-
"versions": [
21-
"versions.yml:md5,a48272c66a933f2bbbaa710df8129f03"
22-
]
23-
}
4+
[
5+
"TEST1.csv",
6+
"TEST1_counts.csv"
7+
],
8+
null
249
],
25-
"timestamp": "2026-02-28T16:52:51.765396671",
10+
"timestamp": "2026-03-18T09:39:51.811502005",
2611
"meta": {
2712
"nf-test": "0.9.4",
2813
"nextflow": "25.10.3"
2914
}
3015
},
31-
"Numorph3DUnet stub test - tif": {
16+
"numorph-3DUnet stub test - tif": {
3217
"content": [
3318
{
3419
"0": [
3520
[
36-
"TEST1.csv:md5,d41d8cd98f00b204e9800998ecf8427e",
37-
"TEST1_counts.csv:md5,d41d8cd98f00b204e9800998ecf8427e"
21+
{
22+
"id": "TEST1"
23+
},
24+
[
25+
"TEST1.csv:md5,d41d8cd98f00b204e9800998ecf8427e",
26+
"TEST1_counts.csv:md5,d41d8cd98f00b204e9800998ecf8427e"
27+
]
3828
]
3929
],
4030
"1": [
41-
"versions.yml:md5,a48272c66a933f2bbbaa710df8129f03"
31+
[
32+
"NUMORPH3DUNET",
33+
"numorph-3dunet",
34+
"1.0.0"
35+
]
4236
],
4337
"cellcounts": [
4438
[
45-
"TEST1.csv:md5,d41d8cd98f00b204e9800998ecf8427e",
46-
"TEST1_counts.csv:md5,d41d8cd98f00b204e9800998ecf8427e"
39+
{
40+
"id": "TEST1"
41+
},
42+
[
43+
"TEST1.csv:md5,d41d8cd98f00b204e9800998ecf8427e",
44+
"TEST1_counts.csv:md5,d41d8cd98f00b204e9800998ecf8427e"
45+
]
4746
]
4847
],
49-
"versions": [
50-
"versions.yml:md5,a48272c66a933f2bbbaa710df8129f03"
48+
"versions_numorph_3dunet": [
49+
[
50+
"NUMORPH3DUNET",
51+
"numorph-3dunet",
52+
"1.0.0"
53+
]
5154
]
5255
}
5356
],
54-
"timestamp": "2026-03-03T15:01:48.714597704",
57+
"timestamp": "2026-03-18T09:40:24.396612007",
5558
"meta": {
5659
"nf-test": "0.9.4",
5760
"nextflow": "25.10.3"

modules/local/numorphalign/main.nf

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,16 @@ process NUMORPHALIGN {
66
container "nf-core/numorph_preprocessing:1.0.0"
77

88
input:
9-
tuple val(meta), path(img_directory), path(parameter_file)
10-
path adj_params_mat
11-
path path_table_mat
12-
path thresholds_mat
13-
path NM_variables
9+
tuple val(meta), path(img_directory), path(parameter_file), path(variables), path(NM_variable)
1410

1511

1612
output:
17-
path "./results/samples/alignment/" , emit: samples
18-
path "./results/variables/path_table.mat" , emit: path_table_mat
19-
path "./results/variables/alignment_table.mat" , emit: alignment_table_mat
20-
path "./results/variables/z_displacement_align.mat" , emit: z_displacement_align_mat
21-
path "./results/NM_variables.mat" , emit: NM_variables
22-
path "versions.yml" , emit: versions
13+
tuple val(meta), path("./results/samples/alignment/") , emit: samples_alignment
14+
tuple val(meta), path("./results/variables/") , emit: variables_alignment
15+
tuple val(meta), path("./results/NM_variables.mat") , emit: NM_variable
16+
17+
tuple val("${task.process}"), val('numorph_align'), val('1.0.0'), emit: versions_numorph_align, topic: versions
18+
2319

2420

2521
when:
@@ -32,27 +28,20 @@ process NUMORPHALIGN {
3228
"""
3329
# create output directories needed by the tool
3430
mkdir -p ./results/samples/
35-
mkdir -p ./results/variables/
31+
3632
3733
3834
# symlink input files to variables directory
39-
ln -sr ${adj_params_mat} ./results/variables
40-
ln -sr ${path_table_mat} ./results/variables
41-
ln -sr ${thresholds_mat} ./results/variables
35+
cp -rL ${variables} ./results
4236
43-
# resolve symlinks and paths
37+
# resolve symlinks and paths for matlab tool
4438
img_dir=\$(readlink -f ${img_directory})
4539
parameter_file=\$(readlink -f ${parameter_file})
4640
results_dir=\$(readlink -f ./results)
47-
NM_variables=\$(readlink -f ${NM_variables})
41+
NM_variables=\$(readlink -f ${NM_variable})
4842
4943
numorph_preprocessing 'input_dir' \$img_dir 'output_dir' \$results_dir 'parameter_file' \$parameter_file 'sample_name' ${meta.id} 'stage' 'align' 'NM_variables' \$NM_variables
5044
51-
cat <<-END_VERSIONS > versions.yml
52-
"${task.process}":
53-
numorphalign: 1.0
54-
END_VERSIONS
55-
5645
"""
5746

5847
stub:
@@ -69,9 +58,5 @@ process NUMORPHALIGN {
6958
touch results/NM_variables.mat
7059
touch results/samples/alignment/${meta.id}_full.tif
7160
72-
cat <<-END_VERSIONS > versions.yml
73-
"${task.process}":
74-
numorphalign: 1.0
75-
END_VERSIONS
7661
"""
7762
}

0 commit comments

Comments
 (0)