Skip to content

Who talks to LC16?

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 in the color of their direction.

_net = network_figure(edges, [CENTER_TYPE])
# Saved for use in papers.
_net.write_html(
    str(figure_path("lc16_network.html")),
    open_browser=False,
    notebook=False,
)
mo.iframe(_net.generate_html(), height="680px")