Skip to content

Commit 78e5c11

Browse files
Update synapse measurement script
1 parent c51f624 commit 78e5c11

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

scripts/measurements/measure_synapses.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@
1111

1212
def check_project(plot=False, save_ihc_table=False, max_dist=None):
1313
s3 = create_s3_target()
14-
cochleae = ['M_LR_000226_L', 'M_LR_000226_R', 'M_LR_000227_L', 'M_LR_000227_R', 'M_AMD_OTOF1_L']
14+
# cochleae = ["M_LR_000226_L", "M_LR_000226_R", "M_LR_000227_L", "M_LR_000227_R", "M_AMD_OTOF1_L"]
15+
cochleae = ["M_LR_000226_L", "M_LR_000226_R", "M_LR_000227_L", "M_LR_000227_R"]
1516

1617
results = {}
1718
for cochlea in cochleae:
1819
synapse_table_name = "synapse_v3_ihc_v4c"
1920
ihc_table_name = "IHC_v4c"
2021
component_id = [1]
2122

22-
if cochlea == 'M_AMD_OTOF1_L':
23+
if cochlea == "M_AMD_OTOF1_L":
2324
synapse_table_name = "synapse_v3_ihc_v4b"
2425
ihc_table_name = "IHC_v4b"
2526
component_id = [3, 11]
@@ -61,6 +62,13 @@ def check_project(plot=False, save_ihc_table=False, max_dist=None):
6162
print("@ max dist:", max_dist)
6263
print()
6364

65+
run_length_dict = {
66+
ihc_id: run_length for ihc_id, run_length in zip(ihc_table.label_id.values, ihc_table["length[µm]"].values)
67+
}
68+
frequency_dict = {
69+
ihc_id: freq for ihc_id, freq in zip(ihc_table.label_id.values, ihc_table["frequency[kHz]"].values)
70+
}
71+
6472
if save_ihc_table:
6573
ihc_to_count = {ihc_id: count for ihc_id, count in zip(ihc_ids, syn_per_ihc)}
6674
unmatched_ihcs = np.setdiff1d(valid_ihcs, ihc_ids)
@@ -71,6 +79,8 @@ def check_project(plot=False, save_ihc_table=False, max_dist=None):
7179
"snyapse_table": [synapse_table_name for _ in list(ihc_to_count.values())],
7280
"ihc_table": [ihc_table_name for _ in list(ihc_to_count.values())],
7381
"max_dist": [max_dist for _ in list(ihc_to_count.values())],
82+
"run_length": [run_length_dict[ihc_id] for ihc_id in ihc_to_count.keys()],
83+
"frequency": [frequency_dict[ihc_id] for ihc_id in ihc_to_count.keys()]
7484
})
7585
os.makedirs(OUTPUT_FOLDER, exist_ok=True)
7686
output_path = os.path.join(OUTPUT_FOLDER, f"ihc_count_{cochlea}.tsv")

0 commit comments

Comments
 (0)