Skip to content

Commit 057e17c

Browse files
author
Suraj Mishra
committed
added support for local(batch1 and missing H2B) and quilt(batch2 and batch3) read
1 parent e87fc1d commit 057e17c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

EMT_data_analysis/analysis_scripts/Nuclei_localization.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,23 @@ def nuclei_localization(
5050
tmp_dir = Path("./emt_tmp/nuclei_localization/")
5151
tmp_dir.mkdir(exist_ok=True, parents=True)
5252

53-
# load segmetnations and meshes
54-
if df['Gene'].values[0] == 'HIST1H2BJ':
53+
# load segmentations and meshes
54+
# First, check for local ZARR file in the reprocessed directory
55+
local_zarr_base = Path("/allen/aics/emt/all_cells_masks/ZARR_Conversion/August_24_H2B_reprocess_v2/main")
56+
local_zarr_path = local_zarr_base / f"{data_id}_H2B_nuclear_segmentation.ome.zarr"
57+
58+
if local_zarr_path.exists():
59+
seg_path = str(local_zarr_path)
60+
print(f"Using local ZARR: {seg_path}")
61+
elif df['Gene'].values[0] == 'HIST1H2BJ':
5562
seg_path = df['H2B Nuclear Segmentation URL'].values[0]
63+
print(f"Using H2B segmentation from quilt manifest: {seg_path}")
5664
else:
5765
raise ValueError(f"The move {data_id} does not have H2B segmentations")
5866

5967
# import pdb; pdb.set_trace()
6068
segmentations = BioImage(seg_path)
69+
6170
# download meshes into temporary directory from s3 bucket
6271
mesh_path = df['CollagenIV Segmentation Mesh Folder'].values[0].replace('s3://allencell/', '')
6372
bucket = q3.Bucket("s3://allencell")

0 commit comments

Comments
 (0)