Who talks to LC16?¶
Introduction¶
Question¶
Which cell types send strong connections to LC16, and which receive them from it?
Background¶
The picture Codex shows under Network Graphs:
one node per cell type, LC16 in the middle,
and an edge \(A \to B\) when type \(A\) has synapses onto type \(B\),
with its width by synapse count.
Here the edges are the strong connections of
lc_output_strength,
for the right-hemisphere LC16 cells:
each edge counts the synapses that LC16 exchanges with the strong
partners of one type.
One color leaves LC16 and another enters it.
census = load_census()
sides = load_visual_types().select("root_id", "side")
proofread_ids = load_proofread_ids()
cells = cells_of_types(census, sides, [CENTER_TYPE])
_scored = cells[CENTER_TYPE]
_out = with_pre_type(load_connections_of(_scored), cells)
_in = with_pre_type(
reversed_connections(load_connections_of(_scored, end="post")), cells
)
strong_out, strong_in = (
strong_partners_of(
labeled_partners(
_c,
cells,
census,
proofread_ids,
lateral_pattern=config.LATERAL,
),
_c,
CLASSIFY,
STRONG_SYN,
)
for _c in (_out, _in)
)
out_mass = type_mass(strong_out)
in_mass = type_mass(strong_in)
Keep the heaviest partners¶
The partner types are ranked by the synapses that LC16 exchanges
with them in both directions,
and the top TOP_PARTNERS are kept.
Partner-to-partner edges are not drawn.
network_edges returns one edge for each direction that has
synapses, with the synapses as its weight.
edges = network_edges(out_mass, in_mass, top_per_type=TOP_PARTNERS)
_types = set(edges["src"]) | set(edges["dst"])
mo.md(
f"{len(_types)} types: "
f"{(edges['kind'] == 'in').sum()} input edges, "
f"{(edges['kind'] == 'out').sum()} output edges."
)
25 types: 13 input edges, 14 output edges.
network_figure draws the edges as an interactive network:
the center type in its color, the partner types in gray and larger
the more edges they have,
and the edges as arrows in the color of their direction,
as wide as their synapse count in proportion to the heaviest edge.
Drag a node to move it.
_page = network_figure(edges, [CENTER_TYPE])
# Saved for use in papers; the file loads its library from a CDN.
figure_path("lc16_network.html").write_text(_page, encoding="utf-8")
mo.iframe(_page, height="660px")
The cells themselves¶
The LC16 cells of the right hemisphere in 3D: Neuroglancer draws the public FlyWire meshes in a new tab (drag to rotate, scroll to zoom). The Codex link lists the same cells in its search; it needs a Codex login.
_ids = cells[CENTER_TYPE]
_url = neuroglancer_url(
_ids, colors=dict.fromkeys(_ids, TYPE_COLORS[CENTER_TYPE])
)
_codex = codex_search_url(", ".join(str(_i) for _i in _ids))
mo.md(
f"- [All {len(_ids)} {CENTER_TYPE} cells in Neuroglancer]({_url})\n"
f"- [The same cells in the Codex search]({_codex})"
)