cyd0806's picture
Release all nine KC structure/function rounds and auditable dependencies
6f24982 verified
Raw History Blame Contribute Delete
21.4 kB
from pathlib import Path
import json,re
P=Path(__file__).resolve().parents[1]
p=P/'manuscript/manuscript.md';s=p.read_text()
if s.startswith('# Testing functional specificity in the mushroom body'):
print('Current manuscript already revised; no changes made.')
raise SystemExit(0)
s=s.replace('# Structure-constrained modelling of Kenyon-cell input combinations is limited by cross-animal physiology and observation uncertainty','# Testing functional specificity in the mushroom body with synapse-resolved models and public physiology')
s=s.replace('**Authors:** Y. Chen and collaborators (author list and affiliations to be confirmed)','**Authors and affiliations:** To be confirmed by the research team.\n\n**Project contact:** ydchen0806; yindachen@mail.ustc.edu.cn. This contact entry does not assign authorship or corresponding-author status.')
abstract='''Connectomes reveal anatomical diversity, but its functional specificity requires tests that separate geometry, input identity and physiological transfer. We combined structure-preserving models of Drosophila mushroom-body Kenyon cells (KCs) with conditional null models and public electrophysiology. Across 5,177 KCs, joint identity–position features improved anatomical output prediction by 3.06%, but regional and branch-conditioned permutations reproduced 98.98% and 99.70% of this gain. A frozen 32-KC recurrent network retained real trees, directed synapse locations and connected output neurons. Its binary response supports were identical across cells at each tested conductance, and an individual input family could trigger propagation without a mixture. In seven public Fly-ID holdouts, a fixed parameter implementation had 35.22 mV mean trace error versus 32.72 mV for a training-waveform baseline. Reconstructing the authors’ quality control reproduced all 24 decisions; errors in the four eligible holdouts were 15.82 and 14.19 mV. Source recordings lacked cell-specific KC subtype labels. These analyses support conditional anatomical and dynamical predictions while limiting claims of new functional subclasses, multisensory synergy and physiological transfer.'''
s=re.sub(r'(?s)(## Abstract\n\n).*?(\n\n## Introduction)',lambda m:m.group(1)+abstract+m.group(2),s)
start='The mushroom body is a sparse expansion layer'
s=s.replace(start,'The mushroom body is a sparse expansion layer [1,2]')
s=s.replace('The corresponding physiological inference is harder:', 'Connectome-constrained models can predict activity and sensorimotor processing when tested against external measurements [3,4]. The corresponding physiological inference is harder:')
s=s.replace('The present work follows the constraints set for the study by Wu’s group-meeting review. We retain the original right-side 32/15/14 membership split, preserve unexplained cells, keep ALPN, direct visual projection and indirect visual candidate sources separate, and retain actual morphology, synapse positions, direction and partner identity. We use public data to test transferability rather than treating synthetic pulses as natural sensory stimuli. The goal is a falsifiable computational account that makes its observation model and limits explicit.', 'Here we follow a structure-first design: preserve neuron trees, synapse locations, pre- and postsynaptic direction, partner identity and network connectivity; compare anatomically motivated input combinations; and test their explanatory specificity with matched null models and public data. An exploratory right-side split of 32, 15 and 14 KCs was frozen before the current functional comparisons. The 14 unresolved cells retain their KCab-p parent annotation and are not discarded or relabelled to improve a result. ALPN, direct visual projection and indirect visual candidate sources are analysed separately. We ask which claims survive this sequence of structural, dynamical and public physiological tests.')
insert='''### Identity–position associations do not explain the apparent prediction gain beyond conditioned nulls
We retained all 5,177 KC objects and used 957,554 incoming endpoints as structural predictors after excluding inputs annotated as MBON. The target was a 35-category anatomical MBON output-contact distribution, containing 256,719 output contacts; ambiguous annotation strings were retained. A five-fold split within known type and hemisphere separated fitting from evaluation, and the vocabulary, dimensionality reduction and scaling were fitted within training folds. The primary score was squared Hellinger error, equally averaged over 18 parent classes with at least 25 cells. Five rare singleton classes remained in fitting and individual prediction records but did not enter that primary macro-average.
At the fixed primary regularization and spatial scale, the known-anatomy baseline had macro-error 0.05807009; adding separate geometry and partner features (GP) reduced it to 0.05383898, and joint features (GPJ) reduced it to 0.05218953 (Fig. 1). This apparent 3.06% gain over GP was largely reproduced by dimension-matched conditional nulls. Regional identity permutations had mean error 0.05220635 and branch-conditioned permutations 0.05219441, reproducing 98.98% and 99.70% of the gain. The real-versus-null advantages were 0.00001682 and 0.00000488, with permutation-rank p values 0.10 and 0.15 (19 null draws; minimum attainable p = 0.05). Regularization and spatial-scale sensitivities were retained across 340 fits.
The nulls preserve location, direction, neuropil and per-cell partner counts; branch-conditioned nulls also preserve branch-level partner frequencies. They therefore test an association increment beyond these retained margins and feature capacity. The results do not establish that connectivity or location is biologically unimportant. They show that the proposed unique identity–position explanation is unsupported by this benchmark. Same-brain cell folds also do not provide independent-animal replication.
'''
s=s.replace('### A structure-preserving network retains the frozen cohort and synaptic geometry',insert+'### A structure-preserving network retains the frozen cohort and synaptic geometry')
s=s.replace('The primary model contains the frozen 32-cell KC cohort','The primary model contains the frozen 32-cell KC cohort (Fig. 2)')
s=s.replace('Boundary contacts were partitioned into ALPN, direct visual projection and operational indirect visual candidate families.', 'Boundary contacts comprised 62 ALPN, 196 direct visual projection and 1,098 operational indirect visual candidate contacts. Thirty-five annotation/transmitter-conflicted contacts were excluded before this panel. These labels describe anatomical sources and do not establish the sensory selectivity of every candidate.')
s=s.replace('The model was evaluated without refitting','The model was evaluated without refitting')
s=s.replace('These results motivated an external public-data test rather than adding parameters or redefining cell membership.', '''These results motivated a public-data transfer test. They also distinguish two mixture comparisons. The primary balanced contrast, ABC minus the mean of A, V and L, averaged 0.014173 mV at 0.1 nS and 11.727164 mV at 1 nS across all 32 KCs (Fig. 3). ABC minus each cell’s strongest single response averaged only 0.008422 and 0.025065 mV. Joint mesh/time refinement changed the primary means to 0.014170 and 11.731084 mV, with maximum per-cell changes 0.000183 and 0.022963 mV. Conductance matching equates external conductance exposure, not injected charge, recurrent event count or downstream arrivals. Thus a large mean-single contrast cannot identify an interaction mechanism or establish natural multisensory synergy.''')
s=s.replace('The public author repository contains 24 raw current-clamp files,','The public author repository accompanying a published KC channel-perturbation study [5] contains 24 raw current-clamp files,')
s=s.replace('The fixed WT9 implementation produced 35.216 mV','The fixed WT9 implementation produced 35.216 mV (Fig. 4)')
s=s.replace('The source paper excluded recordings','The source paper [5] excluded recordings')
s=s.replace('all 24 inclusion decisions matched.', 'all 24 inclusion decisions matched (Fig. 5).')
s=s.replace('These are source-data reconstructions of the published perturbation, not new experiments.', 'These are source-data reconstructions of the published perturbation, not new experiments (Extended Data Fig. 4).')
s=s.replace('Several limitations are structural.', 'Several limitations concern the available evidence.')
s=s.replace('The next decisive test is a genuinely animal-resolved, subtype-resolved confirmation set with current calibration and a frozen observation model. Until such data are available, public cross-brain structural prediction, geometry/degree/region/identity null models and separate APL, receptor and MBON observation models offer the strongest defensible computational path.', 'Public-data work can advance without new wet experiments. Structural generalization can be tested in distinct connectome animals, while preserving differences in reconstruction, annotation and sex: the existing known-parent audit covers 128 FlyWire and 129 MaleCNS KCab-p cells from two animals, without establishing correspondence for the exploratory 32/15/14 split. Public APL imaging [6], heterologous receptor data and MBON physiology [7] constrain different model components and should retain separate observation models. A subtype-resolved public confirmation set with animal identity and current calibration would support the strongest next physiological test. A model tuned on the present holdouts would require a different confirmation set.')
s=s.replace('### Connectome and network model\n\n','''### Structural atlas, cohort and cross-brain scope
The structural inventory contained 5,177 FlyWire KC objects, 2,261,016 directional endpoints and 1,881,678 distinct synapses. All identifiers and annotation ambiguities were retained in the source registry. The right-side 32/15/14 split was frozen as an exploratory cohort partition, not used as an independent functional label. The unresolved 14 cells have an existing KCab-p parent identity; no functional label was inferred for them. Real tree forests were preserved, and soma-path distances were recorded as unavailable where disconnected. Known-parent comparisons in FlyWire and MaleCNS are descriptive comparisons between two connectome animals; hemispheres are not counted as separate animals. Multi-connectome annotations and mushroom-body anatomy provide the biological taxonomy [1,8].
### Structural prediction and matched conditional nulls
The predictor hierarchy comprised a known-anatomy baseline, geometry and partner marginals, and a joint identity–position encoding. Training-only vocabulary, SVD and scaling prevented preprocessing leakage across five fixed cell folds within known type and hemisphere. The primary geometry/partner/joint dimensions were 32/32/64; regularization alpha was 10 and the spatial grid 40 μm. Alpha 1 and 100 and grids 20 and 80 μm were reported as sensitivities, not selected for the strongest effect. Targets contained only outgoing MBON-contact distributions; outgoing endpoints, output degree and exploratory cohort membership did not enter predictors. Macro squared Hellinger error averaged 18 parent classes with at least 25 cells. Nineteen regional and 19 branch-conditioned identity permutations preserved designated margins and used identical dimensions, folds and regularization. Permutation-rank p values were (1 + number of null scores at least as favourable as observed)/20. The full 340-fit registry and per-cell outputs are available; this remains a single-brain structural prediction test.
### Connectome and network model
''')
s=s.replace('The model was run with the previously frozen discretizations and two conductance regimes.', 'The main network used KC maximum extent 0.25 μm, MBON maximum extent 0.5 μm and time step 0.0025 ms (158,568 CVs); joint refinement used 0.125/0.25 μm and 0.00125 ms (299,873 CVs). Synaptic conductance regimes were 0.1 and 1 nS per reference contact before downscaling. The combination panel comprised 24 main and 10 refinement runs; computational conditions are not independent biological replicates. The primary voltage window was 100 ≤ t < 1,100 ms relative to the matched no-input trace.')
s=s.replace('External conductance balancing used \\(B = \\min(n_A,n_V,n_L)\\)', 'External conductance balancing used B = min(n_A,n_V,n_L)')
s=s.replace('The recurrent release proxy detected', 'The channel parameter transfer and candidate channel-localization rule were hypotheses; no conductance was increased to achieve a desired waveform. The recurrent release proxy detected')
s=s.replace('For each model, errors were first averaged over time, then over the three currents, then over Fly ID.', 'For each trace, RMSE was the square root of the mean squared voltage error over time; these trace RMSEs were then averaged equally over the three currents and finally over Fly IDs. This differs from pooling all squared errors before taking a square root.')
s=s.replace('Bootstrap resampling was performed over Fly IDs only;', 'Ten thousand paired bootstrap resamples (seed 1104) were performed over Fly IDs only;')
s=s.replace('an exact 128-pattern sign-flip calculation was used for the paired primary contrast.', 'an exact 128-pattern sign-flip calculation was used for the two-sided paired primary contrast. Its inferential interpretation requires symmetric/exchangeable sign errors and is limited to the seven available public files. Public prior access means this local protocol freeze is not a prospective blinded preregistration. The 120-pA condition was retained as a high-drive stress test; a 40/80-pA descriptive sensitivity is provided because the paper’s main spike-waveform analysis used 10–100 pA.')
s=s.replace('The workbook’s lack of direct ABF identifiers is reported explicitly.', 'The workbook’s lack of direct ABF identifiers is reported explicitly. The source author fit uses the first 200-ms mean baseline and the first negative-step exponential fit, whereas the primary prediction benchmark uses the separately frozen 100–200-ms median baseline. These operations are not conflated. Multi-prominence peak descriptors are retained separately from author-verified spike counts. The ABF current-monitor step is approximately half the nominal DAC/source-paper current; lacking a hardware gain specification, all primary analyses retain nominal currents and do not assert a calibrated physical rescaling.')
s=s.replace('## Data availability\n\nAll derived data, source-data tables, exact public-file checksums, processed aligned traces, model predictions, figures, PPT/PDF briefing and reproducibility manifests are released with this manuscript. Original ABF and Dataset S1 files are redistributed only where permitted by their source terms; source URLs, version identifiers and checksums are retained for files that should be fetched from the original archive. A Hugging Face dataset release will provide the derived tables, predictions, figures and provenance manifest.', '## Data availability\n\nThe local release manifest enumerates task-related derived results, processed traces, scientific figures, source tables and dependencies across all completed rounds. The intended dataset is https://huggingface.co/datasets/cyd0806/neuronmimic-data under the versioned path `wu_20261104_structure_function/`. Remote publication is not asserted until a commit and file/hash verification are recorded in `publication_status.json`. Public originals retain their own attribution and redistribution terms; an original-source retrieval ledger is provided for sources whose repository license is not explicit. No blanket license is applied to third-party materials.')
s=s.replace('The analysis code, frozen protocols, native diagnostic scripts, figure generation, PPT generation, verification scripts and read-only reproduction entry point are released in the `wu_20261104_public_validation` project directory of the associated GitHub repository. The repository records the source commit, public dependency versions and output hashes. No credentials are included.', 'The release code and frozen protocols are prepared for https://github.com/ydchen0806/bio_fly_cyber_lateralization on a dedicated `research/wu-structure-function-20261104` branch. The GitHub code snapshot preserves the original workspace-relative paths; bulk outputs and dependency objects belong in the corresponding Hugging Face snapshot. Publication status and remote commit identifiers are recorded separately and are not inferred from local commit creation. No credentials are included.')
# Replace inaccurate draft references using verified original article metadata.
s=s[:s.index('## References')]
refs=json.loads((P/'metadata/verified_references.json').read_text())
dois=['10.7554/eLife.62576','10.1038/s41467-024-49616-z','10.1038/s41586-024-07763-9','10.1038/s41586-024-07939-3','10.1113/JP288790','10.7554/eLife.56954','10.7554/eLife.77578','10.1038/s41586-024-07686-5']
s+='## References\n\n'
for i,doi in enumerate(dois,1):
r=refs[doi];author=r['authors'][0]+' et al.';s+=f"{i}. {author} {r['title']}. *{r['journal']}* ({r['year']}). https://doi.org/{doi}\n\n"
s+='''## Figure legends
**Figure 1 | Testing whether identity–position associations add structural explanatory power.** Fixed known-anatomy, geometry/partner (GP) and joint (GPJ) representations are compared with dimension-matched regional and branch-conditioned identity permutations across 5,177 KCs. Outcome: macro squared Hellinger error for anatomical MBON output distributions, not activity or independent-animal validation. Main null distribution uses 19 draws per scheme. Source: association project `figures/association_controls.pdf` and its linked synthesis tables.
**Figure 2 | Anatomy-preserving input combinations in the frozen KC cohort.** Real KC trees, directed contacts and the anatomical eligibility for ALPN/directVPN/operationalLVIN input balancing. Ten of the original 32 KCs have all three source classes; other cells remain in the recurrent network without fabricated inputs. The two MBON14 cells receive only the modelled cohort’s true contacts. Source: combination project `figures/anatomical_coverage.pdf`.
**Figure 3 | Complete primary combination contrast and joint numerical refinement.** ABC minus mean(A,V,L) is reported for all 32 cells and both MBONs at 0.1 and 1 nS, using main and jointly refined meshes/time steps. This is not ABC minus strongest single, a charge-matched intervention or a sensory-synergy assay. Numerical-rest MBON residuals at low weight retain their physical scale. Source: combination project `figures/full_primary_refinement.pdf`.
**Figure 4 | Zero-refit public Fly-ID holdout with competing baselines.** Seven held-out Fly IDs, each represented by the mean of three nominal-current trace RMSEs. Training empirical mean uses only Fly IDs 8–10. Lines join the same Fly ID; circles indicate inferred source-QC-passed files and crosses source-excluded files. The seven files constitute a within-study retrospective holdout; QC annotations were reconstructed after the primary benchmark. Source: public-validation `figures/animal_model_comparison.pdf`.
**Figure 5 | Reconstructing source quality control changes the usable sample.** Left, source versus reconstructed input resistance for all 24 ABFs; the dotted line marks 0.8 GΩ. Right, mean trace error in the four source-QC-passed holdouts. This is descriptive sensitivity and is not used for a new p-value or preferred-variant selection. Condition-within-row mapping is inferred and checked by resistance fingerprints. Source: public-validation `figures/author_QC_and_sensitivity.pdf`.
**Extended Data Figure 1 | All 21 held-out waveforms.** Observed KC voltage, fixed WT9 and training-waveform mean; shared physical voltage axes, all files and currents retained. Source: `all21_heldout_traces.pdf`.
**Extended Data Figure 2 | SIZ/electrode sensitivity.** Fixed-parameter native NEURON variants, all seven files and four QC-passed files shown separately. No variant replaces the frozen primary model. Source: `native_variants.pdf`.
**Extended Data Figure 3 | Observation and same-animal calibration diagnostics.** Current-monitor/DAC ratios remain an uncalibrated observation issue; same-animal negative-step RC calibration is a protocol-transfer secondary analysis. Source: `observation_and_calibration.pdf`.
**Extended Data Figure 4 | Published perturbation source reconstruction.** Eighty-two source cell records, with original input-resistance exclusions retained, displayed by NaChBac expression regime and control. Horizontal lines show retained-cell means; cell-to-animal hierarchy is not supplied. This is published source-data reconstruction, not a new independent experiment. Source: `published_perturbation_source.pdf`.
**Extended Data Figures 5 and 6 | Raw WT and NaChBac quality panels.** All 24 files retained, nominal negative/positive currents plotted without label-driven exclusions. Source: `raw_WT_QC.pdf` and `raw_NaChBac_QC.pdf`.
'''
p.write_text(s)
print({'abstract_words':len(abstract.split()),'manuscript_words':len(s.split()),'references':len(dois)})