OSCR

Coherent-resonant netting: disorder-enhanced selectivity from transient wave-like dynamics on biological connectomes.

Code ↔ Paper

16 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

14 blocks of code here have a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.

The 16 matches
  1. [1] § Methods › Controls (competitors) and surrogate networks ↔ experiments/drosophila/A8_4_5/A8_4_5_bundle_localization_arch/A8_5_architecture_dependence.py, lines 337 to 403 · score 0.86 · lesion_KC_MBON, lesion_drop, n_surrogates, n_trials, architecture dependence, rewired · block oscr:b:6DZHQV3399EQS-U · Report a mismatch
  2. [2] § Methods › Substrates and rationale ↔ experiments/bridgeA_scripts/A2_freeze_benchmark_config.py, lines 306 to 384 · score 0.80 · k_source, k_target, max_hops, active subgraph, PN, MBON · block oscr:b:6T9TAM2D88DXE-1 · Report a mismatch
  3. [3] § Methods › Simulation parameters ↔ experiments/step6_release_candidate/CRN_step6_release_candidate/steps/step2_repro_bundle/CRN_step2_repro_bundle/step2_cortex_transport/run_cortex_transport_eps_sweep.py, lines 1 to 39 · score 0.68 · diagonal disorder amplitude, temperature parameter, T_env · block oscr:b:232KBE9EPAX1Q-S · Report a mismatch
  4. [4] § Methods › Model–substrate correspondence ↔ experiments/bridgeA_scripts/A3_run_real_graph_benchmark.py, lines 219 to 315 · score 0.68 · sink jump, L_sym, Hamiltonian, uv, symmetrized, Laplacian · block oscr:b:9P2MGGAF5FP91-9 · Report a mismatch
  5. [5] § The CRN framework › Two-factor mechanism: coherence × topology ↔ experiments/bridgeA_scripts/A3_run_real_graph_benchmark.py, lines 219 to 315 · score 0.65 · sink jump, L_sym, distractor node, symmetrized, coherent, graph · block oscr:b:9P2MGGAF5FP91-9 · Report a mismatch
  6. [6] § The CRN framework › Two-regime architecture: Stage-I netting and Stage-II fixation ↔ datasets/zenodo_18379851_evolutionary_game/PUBLIC/run_step4_evolutionary_selection.py, lines 1 to 48 · score 0.64 · recurrent associative memory, confinement, gating, permeability, recall, dynamics · block oscr:b:NGBQ7NDPS2GY0-T · Report a mismatch
  7. [7] § Results › Architecture dependence across κ ↔ experiments/drosophila/A8_4_5/A8_4_5_bundle_localization_arch/A8_5_architecture_dependence.py, lines 4 to 45 · score 0.64 · Disorder Enhanced Selectivity, Architecture dependence, mushroom body, confidence, lesion, variant · block oscr:b:K2G6SQVEKX1GH-I · Report a mismatch
  8. [8] § Results › Architecture dependence across κ ↔ experiments/drosophila/A8_6/A8_6_postprocess_A85.py, lines 168 to 243 · score 0.60 · P_good, pT_min, coverage end, lesion, variants, rewiring · block oscr:b:YC8AMJ1BJXPD9-K · Report a mismatch
  9. [9] § Methods › Statistical analysis ↔ experiments/elegans_touch_circuit/crn_nematode_pipeline.py, lines 132 to 173 · score 0.60 · elegans touch circuit, expm multiply, Liouvillian, CRN · block oscr:b:129PYRSD467V9-8 · Report a mismatch
  10. [10] § The CRN framework › Two-regime architecture: Stage-I netting and Stage-II fixation ↔ datasets/zenodo_18379851_evolutionary_game/PUBLIC/run_cortex_transport.py, lines 1 to 66 · score 0.60 · associative memory, inter, leaks, permeability, inhibitory, recurrent · block oscr:b:R6B7K8AQ9FQ6S-X · Report a mismatch
  11. [11] § Methods › Model–substrate correspondence ↔ experiments/bridgeA_scripts/A2_freeze_benchmark_config.py, lines 1 to 36 · score 0.58 · active subgraph, Drosophila larva, PN, MBON, hop, benchmark · block oscr:b:HJEM8MKS3DGMZ-J · Report a mismatch
  12. [12] § Methods › Model–substrate correspondence ↔ experiments/bridgeA_scripts/A2_freeze_benchmark_config.py, lines 1 to 36 · score 0.55 · mushroom body, canonical, PN, MBON, subgraph, hop · block oscr:b:HJEM8MKS3DGMZ-J · Report a mismatch
  13. [13] § Methods › Statistical analysis ↔ experiments/drosophila/A8_analysis/A8_1_uncertainty_analysis.py, lines 262 to 307 · score 0.55 · coverage_end, Uncertainty, Selectivity_end, bootstrap, curves, model · block oscr:b:C31MXXZCTFB1N-H · Report a mismatch
  14. [14] § The CRN framework › Two-regime architecture: Stage-I netting and Stage-II fixation ↔ datasets/zenodo_18379851_evolutionary_game/PUBLIC/run_step3_architecture_tradeoff.py, lines 241 to 291 · score 0.54 · probability mass, t_end, global, memory, architectural, distractor · block oscr:b:XXPJRHVARFNBA-M · Report a mismatch
  15. [15] § Methods › Statistical analysis ↔ experiments/elegans_touch_circuit/crn_graph_topology_metrics.py, lines 412 to 463 · score 0.54 · elegans touch circuit, human, seeds, CRN, graph · block oscr:b:D5TJFG3BBAGWZ-K · Report a mismatch
  16. [16] § Methods › Model–substrate correspondence ↔ experiments/bridgeA_stepA1_real_connectome/CRN_bridgeA_stepA1_real/scripts/run_stepA1_real_connectome.py, lines 541 to 664 · score 0.53 · PN nodes, MBON nodes, subgraph, larva, connectome · block oscr:b:KJ71ET2W2HHZY-D · Report a mismatch

Paper

Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Python · 481 lines · 16 KB · MIT · 3 matches

  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. """
  4. A2_freeze_benchmark_config.py
  5. Step A.2 (Drosophila larva / Mushroom Body): Freeze a reproducible benchmark config
  6. on top of the real connectome graph produced in Step A.1.
  7. What it does:
  8. 1) Loads GraphML(s) from A.1 outputs (core and/or extended).
  9. 2) Detects node "type" attribute and edge weight attribute.
  10. 3) Computes sanity/topology reports (reachability, path length stats).
  11. 4) Picks canonical Source / Target / Distractor sets deterministically.
  12. 5) Builds an "active subgraph" (nodes on PN→...→MBON paths, hop-limited).
  13. 6) Writes:
  14. - topology_report_<mode>.json
  15. - bench_config_<mode>.json
  16. - active_subgraph_<mode>.graphml
  17. - active_nodes_<mode>.csv
  18. - active_edges_<mode>.csv
  19. No pandas required (pure stdlib + networkx + numpy).
  20. """
  21. import argparse
  22. import csv
  23. import json
  24. import os
  25. import sys
  26. from collections import Counter, defaultdict, deque
  27. import networkx as nx
  28. import numpy as np
  29. KNOWN_TYPE_TOKENS = ("PN", "KC", "MBON", "MBIN", "FBN", "FFN")
  30. def _find_graphml_files(a1_dir: str):
  31. """Recursively find .graphml files under a directory."""
  32. out = []
  33. for root, _, files in os.walk(a1_dir):
  34. for fn in files:
  35. if fn.lower().endswith(".graphml"):
  36. out.append(os.path.join(root, fn))
  37. return sorted(out)
  38. def _guess_mode_from_path(p: str) -> str:
  39. low = os.path.basename(p).lower()
  40. if "extended" in low:
  41. return "extended"
  42. if "core" in low:
  43. return "core"
  44. # Fallback: infer from directory names
  45. low2 = p.lower()
  46. if "/extended" in low2 or "\\extended" in low2:
  47. return "extended"
  48. if "/core" in low2 or "\\core" in low2:
  49. return "core"
  50. return "unknown"
  51. def _detect_node_type_attr(G: nx.Graph):
  52. """
  53. Detect node attribute containing the coarse cell type.
  54. Heuristic: attribute whose values contain tokens PN/KC/MBON etc.
  55. """
  56. # Collect candidate keys
  57. keys = set()
  58. for _, attrs in G.nodes(data=True):
  59. for k in attrs.keys():
  60. keys.add(k)
  61. # Score keys by how many values look like known types
  62. best_key = None
  63. best_score = -1
  64. for k in keys:
  65. vals = []
  66. for _, attrs in G.nodes(data=True):
  67. v = attrs.get(k, None)
  68. if v is None:
  69. continue
  70. vals.append(str(v))
  71. if not vals:
  72. continue
  73. score = 0
  74. for v in vals:
  75. vv = v.upper()
  76. if any(tok in vv for tok in KNOWN_TYPE_TOKENS):
  77. score += 1
  78. # Prefer keys that classify most nodes
  79. if score > best_score:
  80. best_score = score
  81. best_key = k
  82. return best_key, best_score
  83. def _detect_weight_attr(G: nx.Graph):
  84. """
  85. Detect edge attribute that represents weight (synapse count).
  86. Preference order: 'weight', 'w', 'synapses', 'count', otherwise first numeric attr.
  87. """
  88. if G.number_of_edges() == 0:
  89. return None
  90. u, v, attrs = next(iter(G.edges(data=True)))
  91. preferred = ["weight", "w", "synapses", "count", "n_syn", "n_synapses"]
  92. for k in preferred:
  93. if k in attrs:
  94. return k
  95. # Fallback: first numeric
  96. for k, val in attrs.items():
  97. try:
  98. float(val)
  99. return k
  100. except Exception:
  101. continue
  102. return None
  103. def _as_float(x, default=1.0):
  104. try:
  105. return float(x)
  106. except Exception:
  107. return default
  108. def _node_type(G: nx.Graph, n, type_key: str):
  109. v = G.nodes[n].get(type_key, None)
  110. if v is None:
  111. return "UNKNOWN"
  112. return str(v)
  113. def _split_types(G: nx.DiGraph, type_key: str):
  114. """
  115. Return dict of {coarse_type: set(nodes)}. Uses substring matching.
  116. """
  117. buckets = defaultdict(set)
  118. for n in G.nodes():
  119. t = _node_type(G, n, type_key).upper()
  120. if "MBON" in t:
  121. buckets["MBONs"].add(n)
  122. elif "KC" in t:
  123. buckets["KCs"].add(n)
  124. elif "PN" in t:
  125. buckets["PNs"].add(n)
  126. elif "MBIN" in t:
  127. buckets["MBINs"].add(n)
  128. elif "FBN" in t:
  129. buckets["MB-FBNs"].add(n)
  130. elif "FFN" in t:
  131. buckets["MB-FFNs"].add(n)
  132. else:
  133. buckets["OTHER"].add(n)
  134. return buckets
  135. def _edge_type_counts(G: nx.DiGraph, type_key: str):
  136. c = Counter()
  137. for u, v in G.edges():
  138. tu = _node_type(G, u, type_key)
  139. tv = _node_type(G, v, type_key)
  140. c[f"{tu}->{tv}"] += 1
  141. return dict(c)
  142. def _weighted_out_degree(G: nx.DiGraph, nodes, weight_key: str):
  143. scores = {}
  144. for n in nodes:
  145. s = 0.0
  146. for _, v, attrs in G.out_edges(n, data=True):
  147. s += _as_float(attrs.get(weight_key, 1.0), 1.0)
  148. scores[n] = s
  149. return scores
  150. def _weighted_in_degree(G: nx.DiGraph, nodes, weight_key: str):
  151. scores = {}
  152. for n in nodes:
  153. s = 0.0
  154. for u, _, attrs in G.in_edges(n, data=True):
  155. s += _as_float(attrs.get(weight_key, 1.0), 1.0)
  156. scores[n] = s
  157. return scores
  158. def _multi_source_bfs_limited(G: nx.DiGraph, sources, max_hops: int):
  159. """
  160. Return dict {node: dist} for nodes within max_hops from any source (directed).
  161. """
  162. dist = {}
  163. q = deque()
  164. for s in sources:
  165. dist[s] = 0
  166. q.append(s)
  167. while q:
  168. u = q.popleft()
  169. du = dist[u]
  170. if du >= max_hops:
  171. continue
  172. for v in G.successors(u):
  173. if v in dist:
  174. continue
  175. dist[v] = du + 1
  176. q.append(v)
  177. return dist
  178. def _path_length_stats(G: nx.DiGraph, sources, targets):
  179. """
  180. Compute directed shortest-path lengths from any source to each target.
  181. """
  182. # BFS from all sources (unweighted hop-count)
  183. dist = _multi_source_bfs_limited(G, sources, max_hops=10**9)
  184. lens = []
  185. unreachable = 0
  186. for t in targets:
  187. if t in dist:
  188. lens.append(dist[t])
  189. else:
  190. unreachable += 1
  191. if lens:
  192. arr = np.array(lens, dtype=float)
  193. stats = {
  194. "n_targets": int(len(targets)),
  195. "n_reachable": int(len(lens)),
  196. "n_unreachable": int(unreachable),
  197. "min": float(np.min(arr)),
  198. "p25": float(np.percentile(arr, 25)),
  199. "median": float(np.median(arr)),
  200. "mean": float(np.mean(arr)),
  201. "p75": float(np.percentile(arr, 75)),
  202. "max": float(np.max(arr)),
  203. }
  204. else:
  205. stats = {
  206. "n_targets": int(len(targets)),
  207. "n_reachable": 0,
  208. "n_unreachable": int(unreachable),
  209. }
  210. return stats
  211. def _write_csv_nodes(path, rows):
  212. with open(path, "w", newline="", encoding="utf-8") as f:
  213. w = csv.DictWriter(f, fieldnames=list(rows[0].keys()))
  214. w.writeheader()
  215. for r in rows:
  216. w.writerow(r)
  217. def _write_csv_edges(path, rows):
  218. with open(path, "w", newline="", encoding="utf-8") as f:
  219. w = csv.DictWriter(f, fieldnames=list(rows[0].keys()))
  220. w.writeheader()
  221. for r in rows:
  222. w.writerow(r)
  223. def freeze_one(graphml_path: str, out_dir: str, k_source: int, k_target: int, max_hops: int, seed: int):
  224. mode = _guess_mode_from_path(graphml_path)
  225. print(f"\n[A2] Loading GraphML ({mode}): {graphml_path}")
  226. G = nx.read_graphml(graphml_path)
  227. if not isinstance(G, nx.DiGraph):
  228. # GraphML can load as Graph; if so, treat as directed for safety
  229. G = nx.DiGraph(G)
  230. type_key, type_score = _detect_node_type_attr(G)
  231. if type_key is None:
  232. raise RuntimeError("Could not detect node-type attribute in GraphML nodes.")
  233. weight_key = _detect_weight_attr(G)
  234. if weight_key is None:
  235. raise RuntimeError("Could not detect edge-weight attribute in GraphML edges.")
  236. # Normalize weight attribute to float for all edges
  237. for u, v, attrs in G.edges(data=True):
  238. attrs[weight_key] = _as_float(attrs.get(weight_key, 1.0), 1.0)
  239. buckets = _split_types(G, type_key)
  240. pns = sorted(list(buckets.get("PNs", [])))
  241. kcs = sorted(list(buckets.get("KCs", [])))
  242. mbons = sorted(list(buckets.get("MBONs", [])))
  243. node_type_counts = {k: len(v) for k, v in buckets.items() if len(v) > 0}
  244. # Simple sanity
  245. isolated = [n for n in G.nodes() if (G.in_degree(n) + G.out_degree(n)) == 0]
  246. n_isolated = len(isolated)
  247. # Weighted degree for picking sources/targets
  248. rng = np.random.default_rng(seed)
  249. pn_scores = _weighted_out_degree(G, pns, weight_key)
  250. # take top-k_source by weighted out-degree; tie-break by node id for determinism
  251. pns_sorted = sorted(pns, key=lambda n: (-pn_scores.get(n, 0.0), str(n)))
  252. source_nodes = pns_sorted[: min(k_source, len(pns_sorted))]
  253. mbon_scores = _weighted_in_degree(G, mbons, weight_key)
  254. mbons_sorted = sorted(mbons, key=lambda n: (-mbon_scores.get(n, 0.0), str(n)))
  255. target_nodes = mbons_sorted[: min(k_target, len(mbons_sorted))]
  256. distractor_nodes = mbons_sorted[min(k_target, len(mbons_sorted)) : min(2 * k_target, len(mbons_sorted))]
  257. # Reachability stats (any PN -> MBON)
  258. path_stats_all = _path_length_stats(G, sources=pns, targets=mbons)
  259. path_stats_sel = _path_length_stats(G, sources=source_nodes, targets=target_nodes)
  260. # Active subgraph: forward-reachable from selected sources within max_hops AND
  261. # reverse-reachable to selected targets within max_hops.
  262. forward = _multi_source_bfs_limited(G, source_nodes, max_hops=max_hops)
  263. Grev = G.reverse(copy=False)
  264. backward = _multi_source_bfs_limited(Grev, target_nodes, max_hops=max_hops)
  265. active_nodes = set(forward.keys()).intersection(set(backward.keys()))
  266. # Always include selected endpoints
  267. active_nodes.update(source_nodes)
  268. active_nodes.update(target_nodes)
  269. active_nodes.update(distractor_nodes)
  270. H = G.subgraph(active_nodes).copy()
  271. # Edge-type counts (coarse)
  272. edge_type_counts = Counter()
  273. for u, v in H.edges():
  274. tu = _node_type(H, u, type_key)
  275. tv = _node_type(H, v, type_key)
  276. edge_type_counts[f"{tu}->{tv}"] += 1
  277. # Build reports
  278. def _node_label(n):
  279. # Try common label keys; else return node id
  280. attrs = G.nodes[n]
  281. for k in ("label", "name", "id", "cell_id"):
  282. if k in attrs and attrs[k] not in (None, ""):
  283. return str(attrs[k])
  284. return str(n)
  285. selection = {
  286. "sources": [{"node": str(n), "label": _node_label(n), "w_out": pn_scores.get(n, 0.0)} for n in source_nodes],
  287. "targets": [{"node": str(n), "label": _node_label(n), "w_in": mbon_scores.get(n, 0.0)} for n in target_nodes],
  288. "distractors": [{"node": str(n), "label": _node_label(n), "w_in": mbon_scores.get(n, 0.0)} for n in distractor_nodes],
  289. }
  290. topo_report = {
  291. "mode": mode,
  292. "graphml": os.path.abspath(graphml_path),
  293. "detected": {"node_type_attr": type_key, "node_type_score": int(type_score), "weight_attr": weight_key},
  294. "counts_full": {"N_nodes": int(G.number_of_nodes()), "N_edges": int(G.number_of_edges()), "N_isolated": int(n_isolated)},
  295. "counts_types_full": node_type_counts,
  296. "path_lengths_all_PN_to_all_MBON": path_stats_all,
  297. "path_lengths_selected_sources_to_selected_targets": path_stats_sel,
  298. "selection": selection,
  299. "active_subgraph": {"N_nodes": int(H.number_of_nodes()), "N_edges": int(H.number_of_edges()), "max_hops": int(max_hops)},
  300. "edge_type_counts_active": dict(edge_type_counts),
  301. }
  302. bench_config = {
  303. "mode": mode,
  304. "graphml_source": os.path.abspath(graphml_path),
  305. "node_type_attr": type_key,
  306. "weight_attr": weight_key,
  307. "seed": int(seed),
  308. "k_source": int(k_source),
  309. "k_target": int(k_target),
  310. "max_hops": int(max_hops),
  311. "source_nodes": [str(n) for n in source_nodes],
  312. "target_nodes": [str(n) for n in target_nodes],
  313. "distractor_nodes": [str(n) for n in distractor_nodes],
  314. "active_nodes": [str(n) for n in sorted(active_nodes, key=str)],
  315. # Simulation defaults (editable later)
  316. "sim_defaults": {
  317. "gamma": 1.0,
  318. "eta_sink": 1.0,
  319. "kappa_grid": [1e-3, 3e-3, 1e-2, 3e-2, 1e-1, 3e-1, 1.0, 3.0, 10.0],
  320. "T_max": 10.0,
  321. "dt": 0.05,
  322. "disorder": {"kind": "none", "epsilon": 0.0, "seed": int(seed)},
  323. },
  324. "selection_human_readable": selection,
  325. }
  326. os.makedirs(out_dir, exist_ok=True)
  327. # Write JSONs
  328. topo_path = os.path.join(out_dir, f"topology_report_{mode}.json")
  329. cfg_path = os.path.join(out_dir, f"bench_config_{mode}.json")
  330. with open(topo_path, "w", encoding="utf-8") as f:
  331. json.dump(topo_report, f, indent=2, ensure_ascii=False)
  332. with open(cfg_path, "w", encoding="utf-8") as f:
  333. json.dump(bench_config, f, indent=2, ensure_ascii=False)
  334. # Write active subgraph
  335. subgraph_path = os.path.join(out_dir, f"active_subgraph_{mode}.graphml")
  336. nx.write_graphml(H, subgraph_path)
  337. # Write nodes/edges CSV for convenience
  338. nodes_rows = []
  339. for n, attrs in H.nodes(data=True):
  340. row = {"node": str(n), "cell_type": str(attrs.get(type_key, ""))}
  341. # store a couple of optional labels if exist
  342. for k in ("label", "name"):
  343. if k in attrs:
  344. row[k] = str(attrs.get(k))
  345. nodes_rows.append(row)
  346. edges_rows = []
  347. for u, v, attrs in H.edges(data=True):
  348. row = {"u": str(u), "v": str(v), "weight": float(attrs.get(weight_key, 1.0))}
  349. # also preserve edge type if present
  350. for k in ("type", "edge_type"):
  351. if k in attrs:
  352. row[k] = str(attrs.get(k))
  353. edges_rows.append(row)
  354. nodes_csv = os.path.join(out_dir, f"active_nodes_{mode}.csv")
  355. edges_csv = os.path.join(out_dir, f"active_edges_{mode}.csv")
  356. if nodes_rows:
  357. _write_csv_nodes(nodes_csv, nodes_rows)
  358. if edges_rows:
  359. _write_csv_edges(edges_csv, edges_rows)
  360. # Print summary
  361. print(f"[A2:{mode}] node_type_attr='{type_key}', weight_attr='{weight_key}'")
  362. print(f"[A2:{mode}] FULL: N={G.number_of_nodes()} E={G.number_of_edges()} (isolated={n_isolated})")
  363. print(f"[A2:{mode}] ACTIVE: N={H.number_of_nodes()} E={H.number_of_edges()} (max_hops={max_hops})")
  364. print(f"[A2:{mode}] Sources={len(source_nodes)} Targets={len(target_nodes)} Distractors={len(distractor_nodes)}")
  365. print(f"[A2:{mode}] Wrote:")
  366. print(f" - {topo_path}")
  367. print(f" - {cfg_path}")
  368. print(f" - {subgraph_path}")
  369. if nodes_rows:
  370. print(f" - {nodes_csv}")
  371. if edges_rows:
  372. print(f" - {edges_csv}")
  373. return topo_path, cfg_path, subgraph_path
  374. def main():
  375. ap = argparse.ArgumentParser()
  376. ap.add_argument("--a1_dir", default=None, help="Folder where Step-A1 wrote GraphML(s). If set, auto-discovers .graphml files.")
  377. ap.add_argument("--graphml", default=None, nargs="*", help="Explicit GraphML file path(s). Overrides --a1_dir.")
  378. ap.add_argument("--out_dir", default="A2_outputs", help="Output folder.")
  379. ap.add_argument("--k_source", type=int, default=10, help="Number of PN source nodes to freeze.")
  380. ap.add_argument("--k_target", type=int, default=5, help="Number of MBON target nodes to freeze.")
  381. ap.add_argument("--max_hops", type=int, default=4, help="Hop limit used to define the active subgraph.")
  382. ap.add_argument("--seed", type=int, default=42, help="RNG seed for deterministic selection.")
  383. args = ap.parse_args()
  384. graphml_files = []
  385. if args.graphml:
  386. graphml_files = [os.path.abspath(os.path.expanduser(p)) for p in args.graphml]
  387. elif args.a1_dir:
  388. a1 = os.path.abspath(os.path.expanduser(args.a1_dir))
  389. graphml_files = _find_graphml_files(a1)
  390. if not graphml_files:
  391. raise RuntimeError(f"No .graphml files found under: {a1}")
  392. else:
  393. raise RuntimeError("Provide either --graphml <file(s)> or --a1_dir <folder>.")
  394. out_dir = os.path.abspath(os.path.expanduser(args.out_dir))
  395. os.makedirs(out_dir, exist_ok=True)
  396. # Freeze each graphml found
  397. for p in graphml_files:
  398. freeze_one(
  399. graphml_path=p,
  400. out_dir=out_dir,
  401. k_source=args.k_source,
  402. k_target=args.k_target,
  403. max_hops=args.max_hops,
  404. seed=args.seed,
  405. )
  406. print("\n[A2] DONE")
  407. if __name__ == "__main__":
  408. main()

A2_freeze_benchmark_config.py at commit e12f45d, under MIT · at the source

Overview

Authors: Oleg Dolgikh1
ORCID iDs: Oleg Dolgikh
  1. Independent Researcher, Sant Cugat del Vallès, Spain
Journal: Frontiers in computational neuroscience, volume 20, article 1813959
Dates: received 19 February 2026; accepted 15 April 2026; published online 13 May 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.3389/fncom.2026.1813959 · PMID 42211247 · PMCID PMC13212248 · OpenAlex W7161008748
Open access: gold, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Methods: Connectivity, Statistics, Single-unit activity, calcium imaging
Keywords: connectome transport, decision architecture, dephasing, disorder-enhanced selectivity, mechanistically neutral model, structural graph
Topic: Spectroscopy and Quantum Chemical Studies (Atomic and Molecular Physics, and Optics, Physics and Astronomy), according to OpenAlex
Citations: not cited yet (Europe PMC); 33 references in the paper

Abstract

Biological agents face an energy-information bottleneck: inference requires rapid exploration of large hypothesis spaces, yet high-gain spiking is metabolically expensive. We propose Coherent-Resonant Netting (CRN) as a two-regime decision architecture in which a low-amplitude Stage-I transport process filters candidate routes on a structural graph before a higher-cost Stage-II commitment step. In this manuscript, we model Stage-I only, using a mechanistically neutral GKSL open-system proxy with dephasing rate κ and diagonal disorder ε. The model does not imply microscopic quantum coherence in neural tissue. In two biological connectome benchmarks, selectivity improves under partial coherence. In a compact Caenorhabditis elegans touch-circuit benchmark, the wave proxy yields a 1.39 × improvement in peak target absorption over a matched low-temperature classical baseline. In a Drosophila larva mushroom-body motif (N = 243 active nodes), selectivity shows a pronounced non-monotonic disorder-enhanced selectivity peak at intermediate ε, strongest in the native topology and strongly attenuated by degree-preserving rewiring. A permutation-based reanalysis confirms the pre-specified DES contrast (ε = 3 versus ε = 0, p = 0.010), and the effect weakens progressively with increasing dephasing, becoming non-significant in the high-κ regime. We interpret these findings as evidence for a topology-sensitive, dephasing-dependent Stage-I routing effect on biological connectomes. Broader energetic and evolutionary implications remain conditional because Stage-II commitment is not explicitly modeled here.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repositories

Its files are read in the Code ↔ Paper reader above, with 16 matches between paragraphs and lines of code.

Zenodo 18338260

License: MIT
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Size: 1 file
Software Heritage: not checked
Found in: “Data availability statement”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 28 September 2026: the link answers (HTTP 200)
  • 28 September 2026: the link answers (HTTP 200)

ovdspb-code/crn_4.1

License: MIT
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Commit: e12f45d5f428b101784e624953ddc4aea5d4317f, 19 February 2026
Languages: Python (48), Shell (1)
Size: 384 files, 49 scripts
Software Heritage: not archived
Found in: the Zenodo archive record
Holds: README, license file, CITATION.cff, environment (requirements.txt, env/requirements.txt, R12-CROWN/requirements.txt, experiments/bridgeA_stepA1_real_connectome/CRN_bridgeA_stepA1_real/requirements_a1.txt, experiments/step6_release_candidate/CRN_step6_release_candidate/env/requirements.txt, experiments/step6_release_candidate/CRN_step6_release_candidate/steps/step4_evolutionary_selection_bundle/env/requirements.txt, experiments/step6_release_candidate/CRN_step6_release_candidate/steps/step2_repro_bundle/CRN_step2_repro_bundle/env/requirements.txt, experiments/step6_release_candidate/CRN_step6_release_candidate/steps/step3_architecture_tradeoff_bundle/CRN_step3_bundle/env/requirements.txt, experiments/step6_release_candidate/CRN_step6_release_candidate/steps/step5_consolidated_evidence_bundle/CRN_step5_consolidated_evidence_bundle/env/requirements.txt), tests, documentation
Not found: continuous integration
Tools: NumPy (45 files), SciPy (24 files), Matplotlib (22 files), pandas (18 files), NetworkX (12 files)
Availability: 1 check, the latest on 28 September 2026: the link answers
  • 28 September 2026: the link answers
51 files

The paper's code and data availability statement is in the Data section.

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 49 scripts, each with its path and the digest of its content;
  • 16 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

Datasets cited

Data availability statement

Datasets and supplementary exploratory artifacts are archived on Zenodo: auxiliary evolutionary game-theory dataset (https://doi.org/10.5281/zenodo.18379850), C. elegans touch-circuit artifacts (https://doi.org/10.5281/zenodo.18432680), Drosophila larva mushroom-body benchmark artifacts (https://doi.org/10.5281/zenodo.18697116), and mouse proxy artifacts (https://doi.org/10.5281/zenodo.18433186). The code used in this study is archived on Zenodo: https://doi.org/10.5281/zenodo.18338260.

Reproduced under the paper's license (CC BY), from the paper cited above.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 1, 28 September 2026: the first record

Recorded: type, language, journal, volume, pages, dates, 1 author, 6 keywords, 33 references.

Cite

This paper

Dolgikh, O. (2026). Coherent-resonant netting: disorder-enhanced selectivity from transient wave-like dynamics on biological connectomes. Frontiers in computational neuroscience, 20, 1813959. https://doi.org/10.3389/fncom.2026.1813959

BibTeX

@article{dolgikh2026coherent,
author = {Dolgikh, Oleg},
title = {{Coherent-resonant netting: disorder-enhanced selectivity from transient wave-like dynamics on biological connectomes}},
journal = {Frontiers in computational neuroscience},
year = {2026},
month = may,
volume = {20},
pages = {1813959},
publisher = {Frontiers Media SA},
issn = {1662-5188},
doi = {10.3389/fncom.2026.1813959},
url = {https://doi.org/10.3389/fncom.2026.1813959},
pmid = {42211247},
pmcid = {PMC13212248}
}

RIS

TY - JOUR
AU - Dolgikh, Oleg
TI - Coherent-resonant netting: disorder-enhanced selectivity from transient wave-like dynamics on biological connectomes
T2 - Frontiers in computational neuroscience
J2 - Front Comput Neurosci
PY - 2026
DA - 2026/05/13
VL - 20
SP - 1813959
SN - 1662-5188
PB - Frontiers Media SA
DO - 10.3389/fncom.2026.1813959
UR - https://doi.org/10.3389/fncom.2026.1813959
LA - en
ER -

CSL-JSON

{
"id": "10.3389/fncom.2026.1813959",
"type": "article-journal",
"title": "Coherent-resonant netting: disorder-enhanced selectivity from transient wave-like dynamics on biological connectomes",
"container-title": "Frontiers in computational neuroscience",
"author": [
{
"family": "Dolgikh",
"given": "Oleg"
}
],
"container-title-short": "Front Comput Neurosci",
"volume": "20",
"page": "1813959",
"DOI": "10.3389/fncom.2026.1813959",
"PMID": "42211247",
"PMCID": "PMC13212248",
"ISSN": "1662-5188",
"publisher": "Frontiers Media SA",
"URL": "https://doi.org/10.3389/fncom.2026.1813959",
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
13
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.1038/s41586-024-07968-y [code]
Network statistics of the whole-brain connectome of Drosophila.
Journal: Nature
In common: NetworkX, pandas, SciPy, 2 other tools, 3 references
[2] doi:10.1016/j.isci.2024.111585 [code]
Heterogeneous and higher-order cortical connectivity undergirds efficient, robust, and reliable neural codes.
Journal: iScience
In common: NetworkX, pandas, SciPy, 2 other tools, 3 references
[3] doi:10.7554/elife.101780 [code]
A general framework for characterizing optimal communication in brain networks.
Journal: eLife
In common: NetworkX, pandas, SciPy, 2 other tools, 3 references
[4] doi:10.1073/pnas.2320177121 [code]
Hierarchical communities in the larval &lt;i&gt;Drosophila&lt;/i&gt; connectome: Links to cellular annotations and network topology.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: pandas, SciPy, Matplotlib, 1 other tool, 4 references
[5] doi:10.1038/s41598-026-52140-3 [code]
Energy-efficient information processing and eligibility-trace plasticity in the Drosophila optic lobe connectome.
Journal: Scientific reports
In common: NetworkX, pandas, SciPy, 2 other tools, 2 references
[6] doi:10.1007/s00422-026-01063-3 [code]
Increased firing rates monotonically expand neuronal coding bandwidth.
Journal: Biological cybernetics
In common: pandas, SciPy, Matplotlib, 1 other tool, 3 references
[7] doi:10.1038/s41467-025-62491-6 [code]
Using an ordinary differential equation model to separate rest and task signals in fMRI.
Journal: Nature communications
In common: NetworkX, pandas, SciPy, 2 other tools, 2 references
[8] doi:10.1038/s41467-023-42053-4 [code]
Enhanced brain structure-function tethering in transmodal cortex revealed by high-frequency eigenmodes.
Journal: Nature communications
In common: NetworkX, pandas, SciPy, 2 other tools, 2 references
[9] doi:10.1162/netn.a.533 [code]
An entropic measure of diverse specialization highlights multifunctional neurons in annotated connectomes.
Journal: Network neuroscience (Cambridge, Mass.)
In common: NetworkX, pandas, SciPy, 2 other tools, 2 references
[10] doi:10.1038/s41586-024-07686-5 [code]
Whole-brain annotation and multi-connectome cell typing of Drosophila.
Journal: Nature
In common: NetworkX, pandas, SciPy, 2 other tools, 2 references

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Add the badge to the code's README

OSCR: the badge of this paper

If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.

Markdown
<!-- oscr-badge:start -->
[![OSCR](https://openscicode.org/badge/doi/10.3389/fncom.2026.1813959.svg)](https://openscicode.org/badge/doi/10.3389/fncom.2026.1813959)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.3389/fncom.2026.1813959.svg
   :target: https://openscicode.org/badge/doi/10.3389/fncom.2026.1813959
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.3389/fncom.2026.1813959"><img src="https://openscicode.org/badge/doi/10.3389/fncom.2026.1813959.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->

On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".

If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.

Report a mismatch between the code and the paper · Report a code error (signed in)

Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.

Report a reproduction failure (signed in)

Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.