Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prep for new looptrace #13

Merged
merged 9 commits into from
Nov 20, 2024
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,21 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v0.3.0] - 2024-11-20
This is compatible with the 0.11.x line of `looptrace`.

### Changed
* Updated expected column and file names of input to match those emitted by `looptrace` processing;
in particular, the file previously represented by `*_rois.proximity_accepted.nuclei_labeled.csv` is replaced by `*_rois.with_trace_ids.csv`.

### Added
* Now the joint tracing structure of ROIs from different regional barcodes / imaging timepoints can be visualised.

### Changed
* Adapted to new `looptrace` column names

## [v0.2.0] - 2024-10-21
* This is compatible with the 0.10.x line line of `looptrace`.

### Changed
* Patterns expected for input files:
Expand Down
15 changes: 11 additions & 4 deletions docs/using-the-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,17 @@ The spots are color-coded:

Spot shape differs by $z$-slice; the $z$-slice closest to the truncated $z$-coordinate of the spot's centroid will be square while everywhere else will be circular. We do not add $z$ slices for spots for which the bounding box extends below $0$, but there can be $z$ slices "beyond" the true images, if a spot was detected close to the max $z$ depth. This may also change in a future release.

For the ROIs/spots _resulting from_ a merger, you should see the ID of the ROI itself and the IDs of those which were merged to create it.
For the ROIs/spots _contributing to_ a merger, you should see the ID of the ROI itself and the ID(s) of the ROI(s) to which it contributed.
Some spots are labeled:
* For the ROIs/spots _resulting from_ a merger, you should see the ID of the ROI itself (`i=<merge ID>`).
* For the ROIs/spots _contributing to_ a merger, you should see the ID of the resulting merger ROI (`i=<merge ID>`).
* For the ROIs which participate in a larger tracing structure, you should see the ID (`t=<trace ID>`).

### Necessary data files
1. 1 ZARR per field of view you wish to view, named like `P0001.zarr`
1. 0 or 1 files of each of the following types, per field of view, organized into a folder that has the same field of view name as the ZARR, e.g. `P0001`. There must be at least 1 of these 3 files present:
- A `*_rois.csv` file: unfiltered regional spots
- A `*_rois.proximity_accepted.csv` file: regional spots after discarding those which are too close together
- A `*_rois.proximity_accepted.nuclei_labeled.csv` file: regional spots after proximity-based filtration and filtration for inclusion in nuclei
- A `*_rois.with_trace_ids.csv` file: regional spots after proximity-based filtration and labeling attribution of ROIs/spots to nuclei

### File format notes
* For each spot, the following must be parsed:
Expand All @@ -51,4 +53,9 @@ For the ROIs/spots _contributing to_ a merger, you should see the ID of the ROI
* The bounding box is defined by columns suffixed `Min` and `Max` for each axis, e.g. `zMin`, `zMax`, etc.
* The timepoint is read from column `timepoint`.
* The channel is read from the `channel` column.
* For the `*_rois.proximity_accepted.nuclei_labeled.csv` file, `mergeRois` and `nucleusNumber` columns are parsed.
* For the merge contributors file, the `mergeOutput` column is parsed to get the ID of the merge result.
* For the `*_rois.with_trace_ids.csv` file, the following additional columns are parsed:
* `mergePartners` (to tell singleton ROIs from merger output ROIs)
* `nucleusNumber` (to tell nuclear from non-nuclear ROIs)
* `traceId` (to label ROIs which participate in a multi-ROI trace)
* `tracePartners` (to determine whether a ROI participates in a multi-rOI trace)
2 changes: 1 addition & 1 deletion looptrace_regionals_vis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from numpydoc_decorator import doc # type: ignore[import-untyped]

__version__ = "0.2.0"
__version__ = "0.3"

_PACKAGE_NAME = package = Path(__file__).parent.name

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
index,fieldOfView,timepoint,spotChannel,zc,yc,xc,intensityMean,zMin,zMax,yMin,yMax,xMin,xMax,mergeIndices
index,fieldOfView,timepoint,spotChannel,zc,yc,xc,intensityMean,zMin,zMax,yMin,yMax,xMin,xMax,mergeOutput
0,P0001.zarr,79,0,3.907628987532479,231.9874778925304,871.9833511648726,118.26726920593931,-2.092371012467521,9.90762898753248,219.9874778925304,243.9874778925304,859.9833511648726,883.9833511648726,101
1,P0001.zarr,79,0,17.994259347453493,24.042015416774795,1360.0069098862991,117.1394688491732,11.994259347453491,23.994259347453493,12.042015416774795,36.0420154167748,1348.0069098862991,1372.0069098862991,102;103
1,P0001.zarr,79,0,17.994259347453493,24.042015416774795,1360.0069098862991,117.1394688491732,11.994259347453491,23.994259347453493,12.042015416774795,36.0420154167748,1348.0069098862991,1372.0069098862991,103
2,P0001.zarr,79,0,23.00910242218976,231.98008711401275,871.9596645390719,116.14075915047448,17.009102422189756,29.00910242218976,219.98008711401275,243.98008711401275,859.9596645390719,883.9596645390719,101
3,P0001.zarr,79,0,16.527137137619988,422.5165732477932,667.2129969610728,157.0530303030303,10.527137137619988,22.527137137619988,410.5165732477932,434.5165732477932,655.2129969610728,679.2129969610728,102;103
4,P0001.zarr,79,0,16.950424004488077,118.88259896330818,349.6540530977019,161.81065410400436,10.950424004488076,22.95042400448808,106.88259896330818,130.88259896330817,337.6540530977019,361.6540530977019,102;103
3,P0001.zarr,79,0,16.527137137619988,422.5165732477932,667.2129969610728,157.0530303030303,10.527137137619988,22.527137137619988,410.5165732477932,434.5165732477932,655.2129969610728,679.2129969610728,102
4,P0001.zarr,79,0,16.950424004488077,118.88259896330818,349.6540530977019,161.81065410400436,10.950424004488076,22.95042400448808,106.88259896330818,130.88259896330817,337.6540530977019,361.6540530977019,103
5,P0001.zarr,79,0,18.177805530982404,445.4564669785048,607.9657421380375,160.33961681087763,12.177805530982404,24.177805530982404,433.4564669785048,457.4564669785048,595.9657421380375,619.9657421380375,100
6,P0001.zarr,79,0,17.83959674876146,1006.0753359579252,306.5263466292306,160.1254275940707,11.839596748761458,23.83959674876146,994.0753359579252,1018.0753359579252,294.5263466292306,318.5263466292306,100
6,P0001.zarr,79,0,17.83959674876146,1006.0753359579252,306.5263466292306,160.1254275940707,11.839596748761458,23.83959674876146,994.0753359579252,1018.0753359579252,294.5263466292306,318.5263466292306,102
7,P0001.zarr,79,0,17.70877472362621,1040.482813665982,290.6567022086824,163.12094117647058,11.70877472362621,23.70877472362621,1028.482813665982,1052.482813665982,278.6567022086824,302.6567022086824,100
8,P0001.zarr,79,0,17.294947508199503,1701.3423124347908,1665.0076588607058,152.65736930345983,11.294947508199504,23.294947508199503,1689.3423124347908,1713.3423124347908,1653.0076588607058,1677.0076588607058,101
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
index,fieldOfView,timepoint,spotChannel,zc,yc,xc,intensityMean,zMin,zMax,yMin,yMax,xMin,xMax,mergeRois,nucleusNumber
3,P0001.zarr,79,0,16.527137137619988,422.5165732477932,667.2129969610728,157.0530303030303,10.527137137619988,22.527137137619988,410.5165732477932,434.5165732477932,655.2129969610728,679.2129969610728,100;101,3
4,P0001.zarr,79,0,16.950424004488077,118.88259896330818,349.6540530977019,161.81065410400436,10.950424004488076,22.95042400448808,106.88259896330818,130.88259896330817,337.6540530977019,361.6540530977019,,2
5,P0001.zarr,79,0,18.177805530982404,445.4564669785048,607.9657421380375,160.33961681087763,12.177805530982404,24.177805530982404,433.4564669785048,457.4564669785048,595.9657421380375,619.9657421380375,,3
6,P0001.zarr,79,0,17.83959674876146,1006.0753359579252,306.5263466292306,160.1254275940707,11.839596748761458,23.83959674876146,994.0753359579252,1018.0753359579252,294.5263466292306,318.5263466292306,102;110,7
7,P0001.zarr,79,0,17.70877472362621,1040.482813665982,290.6567022086824,163.12094117647058,11.70877472362621,23.70877472362621,1028.482813665982,1052.482813665982,278.6567022086824,302.6567022086824,,7
8,P0001.zarr,79,0,17.294947508199503,1701.3423124347908,1665.0076588607058,152.65736930345983,11.294947508199504,23.294947508199503,1689.3423124347908,1713.3423124347908,1653.0076588607058,1677.0076588607058,,4
10,P0001.zarr,79,0,18.5289337545209,28.24453371789589,1634.215648033695,149.63521150882,12.5289337545209,24.5289337545209,16.244533717895894,40.24453371789589,1622.215648033695,1646.215648033695,,0
11,P0001.zarr,79,0,18.266489401564822,533.7770489058973,1747.1225533182217,159.3707150612688,12.266489401564826,24.266489401564822,521.7770489058973,545.7770489058973,1735.1225533182217,1759.1225533182217,121;131,4
12,P0001.zarr,79,0,18.09858176406764,863.1257478224696,984.5327240679828,146.90628445424477,12.09858176406764,24.09858176406764,851.1257478224696,875.1257478224696,972.5327240679828,996.5327240679828,,5
index,fieldOfView,timepoint,spotChannel,zc,yc,xc,intensityMean,zMin,zMax,yMin,yMax,xMin,xMax,mergePartners,nucleusNumber,traceId,tracePartners
3,P0001.zarr,79,0,16.527137137619988,422.5165732477932,667.2129969610728,157.0530303030303,10.527137137619988,22.527137137619988,410.5165732477932,434.5165732477932,655.2129969610728,679.2129969610728,100;101,3,13,5
4,P0001.zarr,79,0,16.950424004488077,118.88259896330818,349.6540530977019,161.81065410400436,10.950424004488076,22.95042400448808,106.88259896330818,130.88259896330817,337.6540530977019,361.6540530977019,,2,14,
5,P0001.zarr,79,0,18.177805530982404,445.4564669785048,607.9657421380375,160.33961681087763,12.177805530982404,24.177805530982404,433.4564669785048,457.4564669785048,595.9657421380375,619.9657421380375,,3,13,3
6,P0001.zarr,79,0,17.83959674876146,1006.0753359579252,306.5263466292306,160.1254275940707,11.839596748761458,23.83959674876146,994.0753359579252,1018.0753359579252,294.5263466292306,318.5263466292306,102;110,7,16,7;12
7,P0001.zarr,79,0,17.70877472362621,1040.482813665982,290.6567022086824,163.12094117647058,11.70877472362621,23.70877472362621,1028.482813665982,1052.482813665982,278.6567022086824,302.6567022086824,,7,16,6;12
8,P0001.zarr,79,0,17.294947508199503,1701.3423124347908,1665.0076588607058,152.65736930345983,11.294947508199504,23.294947508199503,1689.3423124347908,1713.3423124347908,1653.0076588607058,1677.0076588607058,,4,17,
10,P0001.zarr,79,0,18.5289337545209,28.24453371789589,1634.215648033695,149.63521150882,12.5289337545209,24.5289337545209,16.244533717895894,40.24453371789589,1622.215648033695,1646.215648033695,,0,18,
11,P0001.zarr,79,0,18.266489401564822,533.7770489058973,1747.1225533182217,159.3707150612688,12.266489401564826,24.266489401564822,521.7770489058973,545.7770489058973,1735.1225533182217,1759.1225533182217,121;131,4,19,
12,P0001.zarr,79,0,18.09858176406764,863.1257478224696,984.5327240679828,146.90628445424477,12.09858176406764,24.09858176406764,851.1257478224696,875.1257478224696,972.5327240679828,996.5327240679828,,5,16,6;7
2 changes: 1 addition & 1 deletion looptrace_regionals_vis/napari.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ contributions:
filename_patterns:
- '*_rois.merge_contributors.csv'
- '*_rois.proximity_rejected.csv'
- '*_rois.proximity_accepted.nuclei_labeled.csv'
- '*_rois.with_trace_ids.csv'
accepts_directories: true
Loading