Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
10eecf1
modules for assign and measure spots; changed spots container for pos…
cgoina Apr 21, 2025
1c5a32d
changed warp_spots to return both fixed round spots - unchanged - and…
cgoina Apr 21, 2025
4877fa6
added some comments
cgoina Apr 21, 2025
278f9be
fixed typo
cgoina Apr 22, 2025
279eabf
changed result returned when skipping segmentation
cgoina Apr 22, 2025
14dadeb
removed fixme comment
cgoina Apr 22, 2025
99069dd
fixed post-rs-fish container
cgoina Apr 22, 2025
06dead7
renamed var
cgoina Apr 22, 2025
4f60794
changed log messages
cgoina Apr 22, 2025
2730bf9
update cellpose to include dataset in the results
cgoina Apr 22, 2025
b25b48e
added step to extract spots features
cgoina Apr 22, 2025
1904007
fixed var name
cgoina Apr 22, 2025
bfaf949
use the same meta for segmentation instead of creating a different on…
cgoina Apr 22, 2025
d74ddea
missed return
cgoina Apr 22, 2025
c26d909
logging
cgoina Apr 22, 2025
f14c5e3
fixed the channel passed in the tuple
cgoina Apr 22, 2025
698d6ea
rs-fish return real input image path
cgoina Apr 22, 2025
7388bdf
fixed log call
cgoina Apr 22, 2025
8d9cd6c
stage paths to avoid conflict
cgoina Apr 22, 2025
e70def4
fixed syntax error - extra comma
cgoina Apr 22, 2025
63df28d
concat fixed and warped spots instead of mix
cgoina Apr 22, 2025
de64e9f
logging - the output from warp spots is not as I expected
cgoina Apr 22, 2025
f55a813
more logging; changed some cellpose params
cgoina Apr 22, 2025
8a00651
changed how I get the fixed spots
cgoina Apr 22, 2025
6a8e0ba
fixed unique call
cgoina Apr 22, 2025
17dab80
combine warped spots with segmentaton results
cgoina Apr 22, 2025
4d929fa
changed how results are combined
cgoina Apr 22, 2025
ceaa214
eliminate seg meta from combined results
cgoina Apr 22, 2025
e1bc1a9
fixed the pattern; display command
cgoina Apr 22, 2025
0f73426
pass different output dir for spot features
cgoina Apr 22, 2025
cce075f
fixed var
cgoina Apr 22, 2025
d608f87
adjust input image scale
cgoina Apr 22, 2025
4078873
removed bad def
cgoina Apr 22, 2025
9d25022
changed meta for warp spots; changed how input is created for spots s…
cgoina Apr 23, 2025
840f7d0
fixed syntax error
cgoina Apr 23, 2025
9207093
fixed vars
cgoina Apr 23, 2025
57a8226
more vars fixed
cgoina Apr 23, 2025
fd6d46c
fixed inv transform path
cgoina Apr 23, 2025
9c2a752
fixed join for final spots
cgoina Apr 23, 2025
6c0b293
fixed vars
cgoina Apr 23, 2025
48d70d8
fixed combine for measure spots
cgoina Apr 23, 2025
1793bf4
call spots regionprops
cgoina Apr 23, 2025
5a6a401
var fix
cgoina Apr 23, 2025
49e39ed
fixed unbound var
cgoina Apr 23, 2025
f571596
re-enable all steps
cgoina Apr 28, 2025
7774d40
try cellpose merge using iou only
cgoina Apr 29, 2025
ddd5e4c
changed cellpose dask configuration
cgoina Apr 29, 2025
e0cb46a
do not measure spots until all spots were extracted
cgoina Apr 29, 2025
d41de73
renamed post-rs-fish to verify when spot extraction is skipped
cgoina Apr 30, 2025
0076882
trying to debug the case when spots are skipped but they are also mis…
cgoina Apr 30, 2025
0e2179f
changed how missing spots csv is handled
cgoina Apr 30, 2025
de944fd
set output to empty
cgoina Apr 30, 2025
651d8cb
set version
cgoina Apr 30, 2025
ecab029
changed vars
cgoina Apr 30, 2025
ec087fc
check if spots file exist - bug fix
cgoina Apr 30, 2025
d8d1f97
only test with -f
cgoina Apr 30, 2025
2979054
fixed var
cgoina May 1, 2025
791825e
filter empty spots
cgoina May 1, 2025
750a7e7
bug fix - explicit return from filter
cgoina May 1, 2025
8eefa62
changed log level
cgoina May 1, 2025
db95429
use dapi channel for segmentation
cgoina May 2, 2025
32e5857
renamed spots_counts module
cgoina May 5, 2025
b5070a1
renamed spots counts
cgoina May 5, 2025
c2089c5
renamed measure spots wf
cgoina May 5, 2025
ce6c87f
logging
cgoina May 5, 2025
3c1acc2
combine transform with all spots
cgoina May 6, 2025
c19b51c
logging to track why not cell props are processed
cgoina May 6, 2025
eee0185
combine all spot channels to extract region properties
cgoina May 6, 2025
da2ae4a
fixed syntax error
cgoina May 6, 2025
1e4e050
missed include
cgoina May 6, 2025
7b7c90f
use the proper round id to create the dataset
cgoina May 6, 2025
c17581d
renamed vars
cgoina May 6, 2025
95b3b03
renamed spots props module
cgoina May 6, 2025
700d40e
enable all steps
cgoina May 7, 2025
866c842
changed cellpose_use_model_and_size to cellpose_eval_with_model_only …
cgoina May 13, 2025
8224020
change log level
cgoina May 14, 2025
433b84e
changelog update
cgoina May 14, 2025
6d87dee
added missing params
cgoina May 14, 2025
0b48e75
Merge branch 'main' into spot-intensities
cgoina May 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# JaneliaSciComp/easifish: Changelog

* Added spots count and spots intensities

* Added spots warping using Bigstream

* Added RS-FISH module for spot extraction
Expand Down
2 changes: 2 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ includeConfig './multiscale-modules.config'
includeConfig './segmentation-modules.config'
includeConfig './spot-extraction-modules.config'
includeConfig './warp-spots-modules.config'
includeConfig './spots-features-modules.config'

10 changes: 10 additions & 0 deletions conf/spots-features-modules.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
params {
spots_counts_cores = 1
spots_counts_mem_gb = 2
spots_props_cores = 1
spots_props_mem_gb = 2
spots_counts_subdir = 'spots-counts'
spots_props_subdir = 'spots-props'
dapi_channel = ''
bleeding_channel = ''
}
6 changes: 5 additions & 1 deletion examples/tiny_sample_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@

"cellpose_test": false,
"cellpose_verbose": true,
"cellpose_dask_workers": 3,
"cellpose_dask_workers": 1,
"cellpose_dask_worker_cpus": 4,
"cellpose_merge_with_iou_only": false,
"cellpose_worker_runtime_opts": "--nv",

Expand All @@ -50,6 +51,9 @@
"multiscale_spark_worker_cores": 20,
"multiscale_spark_gb_per_core": 5,

"dapi_channel": "c1",
"bleeding_channel": "c0",

"lsf_opts": "-P scicompsoft",
"cellpose_worker_lsf_opts": "-q gpu_l4 -gpu 'num=1'"
}
1 change: 0 additions & 1 deletion modules/local/post_rs_fish/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,4 @@ process POST_RS_FISH {
post-rs-fish: v1
END_VERSIONS
"""

}
60 changes: 60 additions & 0 deletions modules/local/spots/counts/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
process SPOTS_COUNTS {
tag { meta.id }
container { task.ext.container ?: 'ghcr.io/janeliascicomp/easifish-spots-utils:v1' }
cpus { ncpus }
memory { "${mem_in_gb}GB" }

input:
tuple val(meta),
path(input_image_path, stageAs: 'image/*'),
val(input_dataset),
path(labels_path, stageAs: 'labels/*'),
val(labels_dataset),
path(spots_input_dir, stageAs: 'spots/*'),
val(input_pattern),
path(output_dir, stageAs: 'output/*')
val(ncpus)
val(mem_in_gb)

output:
tuple val(meta),
env(full_input_image_path),
val(input_dataset),
env(full_spots_input_dir),
env(output_csv_file), emit: results
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
"""
full_input_image_path=\$(readlink -e ${input_image_path})
full_labels_path=\$(readlink -e ${labels_path})
full_spots_input_dir=\$(readlink -e ${spots_input_dir})
full_output_dir=\$(readlink ${output_dir})

mkdir -p \${full_output_dir}

output_csv_file="\${full_output_dir}/count.csv"

CMD=(
python
/opt/scripts/spots-utils/labeled-spots-counts.py
--image-container \${full_input_image_path}
--image-subpath ${input_dataset}
--labels-container \${full_labels_path}
--labels-subpath ${labels_dataset}
--spots-pattern \"\${full_spots_input_dir}/${input_pattern}\"
--output \${output_csv_file}
)
echo "CMD: \${CMD[@]}"
(exec "\${CMD[@]}")

cat <<-END_VERSIONS > versions.yml
"${task.process}":
assign-spots: v1
END_VERSIONS
"""

}
62 changes: 62 additions & 0 deletions modules/local/spots/props/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
process SPOTS_PROPS {
tag { meta.id }
container { task.ext.container ?: 'ghcr.io/janeliascicomp/easifish-spots-utils:v1' }
cpus { ncpus }
memory { "${mem_in_gb}GB" }

input:
tuple val(meta),
path(input_image_path, stageAs: 'image/*'),
val(input_dataset),
path(labels_path, stageAs: 'labels/*'),
val(labels_dataset),
val(dapi_dataset),
val(bleed_dataset),
path(output_dir, stageAs: 'output/*'),
val(output_name)
val(ncpus)
val(mem_in_gb)

output:
tuple val(meta),
env(full_input_image_path),
val(input_dataset),
env(output_csv_file) , emit: results
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
dapi_dataset_arg = dapi_dataset ? "--dapi-subpath ${dapi_dataset}" : ""
bleed_dataset_arg = bleed_dataset ? "--bleed-subpath ${bleed_dataset}" : ""
"""
full_input_image_path=\$(readlink -e ${input_image_path})
full_labels_path=\$(readlink -e ${labels_path})
full_output_dir=\$(readlink ${output_dir})

mkdir -p \${full_output_dir}

output_csv_file="\${full_output_dir}/${output_name}"

CMD=(
python
/opt/scripts/spots-utils/labeled-spots-props.py
--image-container \${full_input_image_path}
--image-subpath ${input_dataset}
--labels-container \${full_labels_path}
--labels-subpath ${labels_dataset}
${dapi_dataset_arg}
${bleed_dataset_arg}
--output \${output_csv_file}
)
echo "CMD: \${CMD[@]}"
(exec "\${CMD[@]}")

cat <<-END_VERSIONS > versions.yml
"${task.process}":
measure-spots: v1
END_VERSIONS
"""

}
166 changes: 166 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,166 @@
},
"help_text": "Registration parameters"
},
"spot_extraction": {
"title": "Spot extraction",
"type": "object",
"description": "Spot extraction options",
"help_text": "Spot extraction arguments",
"fa_icon": "far fa-map",
"properties": {
"skip_spot_extraction": {
"type": "boolean",
"description": "If set skip spot extraction"
},
"spot_extraction_subdir": {
"type": "string",
"fa_icon": "fas fa-folder-open",
"description": "Spot extraction results sub-directory"
},
"spot_extraction_ids": {
"type": "string",
"description": "rounds used for extracting spots"
},
"spot_channels": {
"type": "string",
"description": "Comma delimited list of spot channels. This together with spot_scales is used for determining the datasets used for spot extraction."
},
"spot_scales": {
"type": "string",
"description": "image scale used for spot extraction. This together with spot_channels is used for determining the datasets used for spot extraction."
},
"spot_subpaths": {
"type": "string",
"description": "alternative for defining the datasets used for spot extraction. If this is defined it takes priority over spot_channels and spot_scales."
},
"rsfish_min_intensity": {
"type": "integer",
"description": "Minimal intensity of the image. Default: 0",
"fa_icon": "fas fa-angle-double-down"
},
"rsfish_max_intensity": {
"type": "integer",
"description": "Maximal intensity of the image. Default: 4096",
"fa_icon": "fas fa-angle-double-up"
},
"rsfish_anisotropy": {
"type": "number",
"description": "The anisotropy factor. Default: 0.7",
"help_text": "Scaling of z relative to xy. Can be determined using the RS-FISH anisotropy plugin in Fiji.",
"fa_icon": "fas fa-arrows-alt"
},
"rsfish_sigma": {
"type": "number",
"description": "Sigma value for Difference-of-Gaussian (DoG) calculation. Default 1.5",
"fa_icon": "fab fa-etsy"
},
"rsfish_threshold": {
"type": "number",
"description": "Threshold value for Difference-of-Gaussian (DoG) calculation. Default: 0.007",
"fa_icon": "fas fa-level-down-alt"
},
"rsfish_background": {
"type": "integer",
"description": "Background subtraction method, 0 == None, 1 == Mean, 2==Median, 3==RANSAC on Mean, 4==RANSAC on Median. Default: 0 (None)",
"fa_icon": "fas fa-level-down-alt"
},
"rsfish_intensity": {
"type": "integer",
"description": "Intensity calculation method, 0 == Linear Interpolation, 1 == Gaussian fit (on inlier pixels), 2 == Integrate spot intensities (on candidate pixels). Default: 0 (Linear Interpolation)",
"fa_icon": "fas fa-level-down-alt"
},
"rsfish_spark_workers": {
"type": "integer",
"fa_icon": "fas fa-cogs",
"description": "Number of Spark workers to use for spot extraction.",
"default": 2
},
"rsfish_min_spark_workers": {
"type": "integer",
"fa_icon": "fas fa-cogs",
"description": "Minimum number of Spark workers needed to start spot extraction pipeline.",
"default": 1
},
"rsfish_spark_worker_cores": {
"type": "integer",
"fa_icon": "fas fa-microchip",
"description": "Number of cores allocated to each Spark worker.",
"default": 5
},
"rsfish_spark_gb_per_core": {
"type": "integer",
"fa_icon": "fas fa-cog",
"description": "Size of memory (in GB) that is allocated for each core of a Spark worker.",
"help_text": "The total memory usage for extracting spots from one acquisition will be workers * worker_cores * gb_per_core.",
"default": 5
},
"rsfish_spark_driver_cores": {
"type": "integer",
"fa_icon": "fas fa-microchip",
"description": "Number of cores allocated for the Spark driver. Default: 1",
"default": 1
},
"rsfish_spark_driver_mem_gb": {
"type": "integer",
"fa_icon": "fas fa-memory",
"description": "Amount of memory to allocate for the Spark driver. Default: 12g",
"default": 4
}
}
},
"spots_features": {
"title": "Spots stats and characteristics",
"type": "object",
"description": "Various spots characteristcs, such as counts, area, intensity",
"fa_icon": "far fa-map",
"properties": {
"spots_counts_subdir": {
"type": "string",
"fa_icon": "fas fa-folder-open",
"description": "data sub-directory used for spots counts"
},
"spots_props_subdir": {
"type": "string",
"fa_icon": "fas fa-folder-open",
"description": "data sub-directory used for spots properties"
},
"dapi_channel": {
"type": "string",
"fa_icon": "fas fa-asterisk",
"description": "Name of the DAPI channel.",
"help_text": "The DAPI channel is used as a reference channel for registration, segmentation, and spot extraction."
},
"bleed_channel": {
"type": "string",
"fa_icon": "fas fa-asterisk",
"description": "Channel (other than DAPI) that needs bleedthrough correction."
},
"spots_counts_cores": {
"type": "integer",
"fa_icon": "fas fa-microchip",
"description": "Number of cores needed for getting spots counts.",
"default": 1
},
"spots_counts_mem_gb": {
"type": "integer",
"fa_icon": "fas fa-memory",
"description": "Amount of memory needed for getting spots counts",
"default": 2
},
"spots_props_cores": {
"type": "integer",
"fa_icon": "fas fa-microchip",
"description": "Number of cores needed for getting spots properties (intensity).",
"default": 1
},
"spots_props_mem_gb": {
"type": "integer",
"fa_icon": "fas fa-memory",
"description": "Amount of memory needed for getting spots properties (intensity)",
"default": 2
}
}
},
"institutional_config_options": {
"title": "Institutional config options",
"type": "object",
Expand Down Expand Up @@ -1030,6 +1190,12 @@
{
"$ref": "#/definitions/segmentation"
},
{
"$ref": "#/definitions/spot_extraction"
},
{
"$ref": "#/definitions/spots_features"
},
{
"$ref": "#/definitions/generic_options"
}
Expand Down
Loading
Loading