Skip to content

Commit 7921317

Browse files
Update sgn subtype analysis
1 parent bbc922a commit 7921317

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

reproducibility/templates_transfer/mobie_segmentation_template.sbatch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ micromamba activate sam
1717

1818
# name of cochlea, as it appears in MoBIE and the NHR
1919
COCHLEA=$1
20-
# data in n5 format, e.g. G_EK_000233_L/IHC_v5/segmentation.zarr
20+
# data in n5 format, e.g. IHC_v5/segmentation.zarr
2121
DATA=$2
2222
# segmentation name, as it appears in MoBIE, e.g. SGN_V2
2323
CHANNEL_NAME=$3

reproducibility/templates_transfer/s3_seg_template.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export SERVICE_ENDPOINT="https://s3.fs.gwdg.de"
1212
mobie.add_remote_metadata -i $MOBIE_DIR -s $SERVICE_ENDPOINT -b $BUCKET_NAME
1313

1414
rclone --progress copyto "$MOBIE_DIR"/"$COCHLEA"/dataset.json cochlea-lightsheet:cochlea-lightsheet/"$COCHLEA"/dataset.json
15-
rclone --progress copyto "$MOBIE_DIR"/"$COCHLEA"/images/ome-zarr cochlea-lightsheet:cochlea-lightsheet/"$COCHLEA"/images/ome-zarr
15+
rclone --progress copyto "$MOBIE_DIR"/"$COCHLEA"/images/ome-zarr/"$SEG_CHANNEL".ome.zarr cochlea-lightsheet:cochlea-lightsheet/"$COCHLEA"/images/ome-zarr/"$SEG_CHANNEL".ome.zarr
1616
# take care that segmentation tables containing evaluations (tonotopic mapping, marker labels, etc.) might be overwritten
1717
rclone --progress copyto "$MOBIE_DIR"/"$COCHLEA"/tables/"$SEG_CHANNEL" cochlea-lightsheet:cochlea-lightsheet/"$COCHLEA"/tables/"$SEG_CHANNEL"
1818

scripts/measurements/sgn_subtypes.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@
1616
"M_LR_000214_L": ["PV", "CR", "Calb1"],
1717
"M_AMD_N62_L": ["PV", "CR", "Calb1"],
1818
"M_AMD_N180_R": ["CR", "Ntng1", "CTBP2"],
19+
"M_AMD_N180_L": ["CR", "Ntng1", "Lypd1"],
1920
# Mutant / some stuff is weird.
2021
# "M_AMD_Runx1_L": ["PV", "Lypd1", "Calb1"],
2122
# This one still has to be stitched:
2223
# "M_LR_000184_R": {"PV", "Prph"},
23-
# We don't have PV here, so we exclude these two for now.
24-
# "M_AMD_00N180_L": {"CR", "Ntng1", "Lypd1"},
2524
}
2625

2726
# Map from channels to subtypes.
@@ -99,7 +98,15 @@ def check_processing_status():
9998
continue
10099

101100
# Check which tables we have.
102-
expected_tables = [f"{chan}_{seg_name}_object-measures.tsv" for chan in channels]
101+
if cochlea == "M_AMD_N180_L": # we need all intensity measures here
102+
seg_names = ["CR-SGN-v2", "Ntng1-SGN-v2", "Lypd1-SGN-v2"]
103+
expected_tables = [f"{chan}_{sname}_object-measures.tsv" for chan in channels for sname in seg_names]
104+
elif cochlea == "M_AMD_N180_R":
105+
seg_names = ["CR-SGN-v2", "Ntng1-SGN-v2"]
106+
expected_tables = [f"{chan}_{sname}_object-measures.tsv" for chan in channels for sname in seg_names]
107+
else:
108+
expected_tables = [f"{chan}_{seg_name}_object-measures.tsv" for chan in channels]
109+
103110
tables = s3.ls(os.path.join(BUCKET_NAME, cochlea, table_folder))
104111
tables = [os.path.basename(tab) for tab in tables]
105112

@@ -118,10 +125,10 @@ def require_missing_tables(missing_tables):
118125
output_root = "./object_measurements"
119126

120127
for cochlea, missing_tabs in missing_tables.items():
121-
seg_name = "PV_SGN_v2" if "PV" in COCHLEAE_FOR_SUBTYPES[cochlea] else "CR_SGN_v2"
122128
for missing in missing_tabs:
123129
channel = missing.split("_")[0]
124-
print("Computing intensities for:", cochlea, channel)
130+
seg_name = missing.split("_")[1].replace("-", "_")
131+
print("Computing intensities for cochlea:", cochlea, "segmentation:", seg_name, "channel:", channel)
125132

126133
img_s3 = f"{cochlea}/images/ome-zarr/{channel}.ome.zarr"
127134
seg_s3 = f"{cochlea}/images/ome-zarr/{seg_name}.ome.zarr"
@@ -327,18 +334,14 @@ def analyze_subtype_data(show_plots=True):
327334

328335

329336
# General notes:
330-
# M_LR_000099_L: PV looks weird and segmentation doesn't work so well. Besides this intensities look good.
331-
# Double check if this is the right channel. Maybe we try domain adaptation here?
332-
# M_LR_000214_L: PV looks correct, segmentation is not there yet.
333-
# M_AMD_N62_L: PV signal and segmentation look good.
334-
# M_AMD_N180_R: Need SGN segmentation based on CR.
337+
# See:
335338
def main():
336-
# missing_tables = check_processing_status()
337-
# require_missing_tables(missing_tables)
339+
missing_tables = check_processing_status()
340+
require_missing_tables(missing_tables)
338341

339342
# compile_data_for_subtype_analysis()
340343

341-
analyze_subtype_data(show_plots=False)
344+
# analyze_subtype_data(show_plots=False)
342345

343346

344347
if __name__ == "__main__":

0 commit comments

Comments
 (0)