logo Netzschleuder network catalog, repository, and centrifuge

History of fly_male_cns

The changes to the source code of this entry in the repository, newest first, each with the differences it made to the entry's files. They are also listed on GitLab.

[entries] Remove superfluous details of the upstream distribution from the descriptions by Tiago de Paula Peixoto dc07aa0
The descriptions mentioned incidental details of how the upstream data
are made available: the file formats (CSV, JSON, XML, GEXF, SBML, HIF,
Pajek, UCINET, ...), file names, where the files were published or
obtained from (Zenodo, figshare, Kaggle, the Pajek datasets page, the
Internet Archive), and that some networks are only available in the gt
format. These are left out; caveats about the data themselves are kept,
referring to "the data" instead of "the file". The description of
sp_baboons now lists its properties instead of the upstream columns,
and says that events without a recipient are left out.
diff --git a/entries/fly_male_cns/__init__.py b/entries/fly_male_cns/__init__.py
index eb8ba89..bf99bf4 100644
--- a/entries/fly_male_cns/__init__.py
+++ b/entries/fly_male_cns/__init__.py
@@ -24,7 +24,7 @@ import pyarrow.ipc
 import pyarrow.compute as pc
 
 title = "Male fly central nervous system (2026)"
-description = r"""The connectome of the complete central nervous system of an adult male fruit fly *Drosophila melanogaster*, the brain (including both optic lobes) together with the ventral nerve cord, reconstructed by the FlyEM project at the Janelia Research Campus and collaborators from focused ion beam scanning electron microscopy (FIB-SEM) images, with automated segmentation and synapse detection followed by extensive manual proofreading. Nodes are neurons (or, in one network, all segments of the reconstruction), and a directed edge $(i, j)$ indicates chemical synapses from neuron $i$ (presynaptic) to neuron $j$ (postsynaptic). The data come from the two public releases of the data set, v1.0 (June 2026, with minor proofreading changes and refined annotations) and v0.9 (October 2025, the initial release), and from the intermediate version v0.13 (April 2026), which is in the authors' download bucket but is not announced in their release notes, all as exported by the authors as flat files.
+description = r"""The connectome of the complete central nervous system of an adult male fruit fly *Drosophila melanogaster*, the brain (including both optic lobes) together with the ventral nerve cord, reconstructed by the FlyEM project at the Janelia Research Campus and collaborators from focused ion beam scanning electron microscopy (FIB-SEM) images, with automated segmentation and synapse detection followed by extensive manual proofreading. Nodes are neurons (or, in one network, all segments of the reconstruction), and a directed edge $(i, j)$ indicates chemical synapses from neuron $i$ (presynaptic) to neuron $j$ (postsynaptic). The data come from the two public releases of the data set, v1.0 (June 2026, with minor proofreading changes and refined annotations) and v0.9 (October 2025, the initial release), and from the intermediate version v0.13 (April 2026), which is not announced in the authors' release notes.
 
 Only synapses detected with a confidence of at least 0.5 are included, as in the authors' published data. There are eleven networks. Ten of them are named `<version>_<nodes>_<threshold>`:
 
[entries] Add the date when each entry was added, and remove icon_hash by Tiago de Paula Peixoto beff7c9
The dates are those of the commits that first added the entries' files
(2020-08-11 for the entries of the initial commit); renamed entries keep
the date of their first name.

Changed: none
diff --git a/entries/fly_male_cns/__init__.py b/entries/fly_male_cns/__init__.py
index 40b2aeb..eb8ba89 100644
--- a/entries/fly_male_cns/__init__.py
+++ b/entries/fly_male_cns/__init__.py
@@ -64,7 +64,7 @@ The networks have the following properties:
 tags = ['Biological', 'Connectome', 'Weighted', 'Metadata']
 url = 'https://male-cns.janelia.org/download/'
 citation = [('S. Berg et al., "Sexual dimorphism in the complete Drosophila male central nervous system connectome." Cell 189, 5504-5526 (2026)', 'https://doi.org/10.1016/j.cell.2026.08.015')]
-icon_hash = None
+date_added = '2026-10-27'
 upstream_license = ("CC BY 4.0", "https://creativecommons.org/licenses/by/4.0/")
 upstream_prefix = 'https://storage.googleapis.com/flyem-male-cns'
 # the public releases v1.0 (June 2026) and v0.9 (October 2025), and the
[entries] Prefix the properties in the descriptions with (Node), (Edge) or (Graph) by Tiago de Paula Peixoto bc3dbbd
The lists of properties at the end of the descriptions marked edge
properties with "Edge" but left node properties unmarked, or grouped
them in "Nodes: `a`, ...; `b`, ..." items, so the kind of a property
was often unclear. Every item now starts with (Node), (Edge) or (Graph),
followed by the property names, a colon and the explanation, one item
per property or group of properties; qualifications (kinds of nodes,
networks) follow the names in parentheses. Properties that were only
named got a short explanation, and a few items that named the wrong
kind of property were corrected.
diff --git a/entries/fly_male_cns/__init__.py b/entries/fly_male_cns/__init__.py
index 5c4e87f..40b2aeb 100644
--- a/entries/fly_male_cns/__init__.py
+++ b/entries/fly_male_cns/__init__.py
@@ -44,23 +44,23 @@ All networks of a release and node set have the same nodes, so that neurons with
 
 The networks have the following properties:
 
-- `body_id`: the neuron's identifier in the data set (neuPrint body ID).
-- `type`: the cell type of the neuron (e.g. `DNp01`); empty if not assigned.
-- `instance`: the neuron's instance name, typically the cell type followed by additional qualifiers and the side (e.g. `DNp01(GF)_R`).
-- `flywire_type`, `hemibrain_type`, `manc_type`: the matched cell types in the female brain connectomes FlyWire and hemibrain (see the `flywire` and `fly_hemibrain` entries) and in the male adult nerve cord connectome (MANC); empty if not assigned.
-- `superclass`, `class`, `subclass`: coarser classifications of the neuron (e.g. `descending_neuron`, `Kenyon_Cell`); empty if not assigned.
-- `soma_side`: the side of the neuron's soma (`L`, `R`, or `M` for the midline); empty if not assigned (e.g. sensory neurons without soma in the volume).
-- `root_side`: the side where the neuron enters the volume, for neurons without soma; empty otherwise.
-- `hemilineage`: the developmental hemilineage of the neuron (Ito-Lee nomenclature for the brain, Truman nomenclature for the ventral nerve cord); empty if not assigned.
-- `soma_neuromere`: the neuromere (segment) of the neuron's soma; empty if not assigned.
-- `entry_nerve`, `exit_nerve`: the nerve through which the neuron enters or exits the nervous system; empty if none.
-- `dimorphism`: whether the neuron is `male-specific` or `sexually dimorphic` (possibly with the qualifier `potentially`); empty otherwise.
-- `fru_dsx`: the expression of the sex-determination genes *fruitless* and *doublesex* in the neuron, from matches to genetic lines; empty if not known.
-- `status_label`: the detailed proofreading status of the neuron (e.g. `Roughly traced`, `Reviewed`).
-- `status` (only in `v1_0_segments_all`): the status of the segment (`Traced`, `Anchor`, `Assign`, `Orphan`, `Glia`, `Unimportant`); empty if not annotated.
-- `neurotransmitter`: the consensus neurotransmitter of the neuron, from the predictions for the neuron and its cell type (`unclear` if ambiguous); empty if not available. Not available in the `v0_13_*` networks.
-- `predicted_nt`, `predicted_nt_confidence`: the neurotransmitter predicted from the neuron's own synapses, and the confidence of that prediction (empty and NaN if not available). Not available in the `v0_13_*` networks.
-- `weight` (edges): the number of synapses from $i$ to $j$."""
+- (Node) `body_id`: the neuron's identifier in the data set (neuPrint body ID).
+- (Node) `type`: the cell type of the neuron (e.g. `DNp01`); empty if not assigned.
+- (Node) `instance`: the neuron's instance name, typically the cell type followed by additional qualifiers and the side (e.g. `DNp01(GF)_R`).
+- (Node) `flywire_type`, `hemibrain_type`, `manc_type`: the matched cell types in the female brain connectomes FlyWire and hemibrain (see the `flywire` and `fly_hemibrain` entries) and in the male adult nerve cord connectome (MANC); empty if not assigned.
+- (Node) `superclass`, `class`, `subclass`: coarser classifications of the neuron (e.g. `descending_neuron`, `Kenyon_Cell`); empty if not assigned.
+- (Node) `soma_side`: the side of the neuron's soma (`L`, `R`, or `M` for the midline); empty if not assigned (e.g. sensory neurons without soma in the volume).
+- (Node) `root_side`: the side where the neuron enters the volume, for neurons without soma; empty otherwise.
+- (Node) `hemilineage`: the developmental hemilineage of the neuron (Ito-Lee nomenclature for the brain, Truman nomenclature for the ventral nerve cord); empty if not assigned.
+- (Node) `soma_neuromere`: the neuromere (segment) of the neuron's soma; empty if not assigned.
+- (Node) `entry_nerve`, `exit_nerve`: the nerve through which the neuron enters or exits the nervous system; empty if none.
+- (Node) `dimorphism`: whether the neuron is `male-specific` or `sexually dimorphic` (possibly with the qualifier `potentially`); empty otherwise.
+- (Node) `fru_dsx`: the expression of the sex-determination genes *fruitless* and *doublesex* in the neuron, from matches to genetic lines; empty if not known.
+- (Node) `status_label`: the detailed proofreading status of the neuron (e.g. `Roughly traced`, `Reviewed`).
+- (Node) `status` (only in `v1_0_segments_all`): the status of the segment (`Traced`, `Anchor`, `Assign`, `Orphan`, `Glia`, `Unimportant`); empty if not annotated.
+- (Node) `neurotransmitter`: the consensus neurotransmitter of the neuron, from the predictions for the neuron and its cell type (`unclear` if ambiguous); empty if not available. Not available in the `v0_13_*` networks.
+- (Node) `predicted_nt`, `predicted_nt_confidence`: the neurotransmitter predicted from the neuron's own synapses, and the confidence of that prediction (empty and NaN if not available). Not available in the `v0_13_*` networks.
+- (Edge) `weight`: the number of synapses from $i$ to $j$."""
 tags = ['Biological', 'Connectome', 'Weighted', 'Metadata']
 url = 'https://male-cns.janelia.org/download/'
 citation = [('S. Berg et al., "Sexual dimorphism in the complete Drosophila male central nervous system connectome." Cell 189, 5504-5526 (2026)', 'https://doi.org/10.1016/j.cell.2026.08.015')]
[entries] New entry: fly_male_cns by Tiago de Paula Peixoto 0d238b7
diff --git a/entries/fly_male_cns/__init__.py b/entries/fly_male_cns/__init__.py
new file mode 100644
index 0000000..5c4e87f
--- /dev/null
+++ b/entries/fly_male_cns/__init__.py
@@ -0,0 +1,218 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2020-2026 Tiago de Paula Peixoto <tiago@skewed.de>
+#
+# This program is free software: you can redistribute it and/or modify it under
+# the terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Affero General Public License along
+# with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+from .. import *
+import numpy as np
+import pandas as pd
+import pyarrow.feather
+import pyarrow.ipc
+import pyarrow.compute as pc
+
+title = "Male fly central nervous system (2026)"
+description = r"""The connectome of the complete central nervous system of an adult male fruit fly *Drosophila melanogaster*, the brain (including both optic lobes) together with the ventral nerve cord, reconstructed by the FlyEM project at the Janelia Research Campus and collaborators from focused ion beam scanning electron microscopy (FIB-SEM) images, with automated segmentation and synapse detection followed by extensive manual proofreading. Nodes are neurons (or, in one network, all segments of the reconstruction), and a directed edge $(i, j)$ indicates chemical synapses from neuron $i$ (presynaptic) to neuron $j$ (postsynaptic). The data come from the two public releases of the data set, v1.0 (June 2026, with minor proofreading changes and refined annotations) and v0.9 (October 2025, the initial release), and from the intermediate version v0.13 (April 2026), which is in the authors' download bucket but is not announced in their release notes, all as exported by the authors as flat files.
+
+Only synapses detected with a confidence of at least 0.5 are included, as in the authors' published data. There are eleven networks. Ten of them are named `<version>_<nodes>_<threshold>`:
+
+- `v1_0_traced_*`: release v1.0, with the 165,122 neurons with status "Traced" as nodes (the proofread neurons, analogous to the "traced" neurons of the `fly_hemibrain` entry).
+- `v1_0_significant_*`: release v1.0, from the authors' "significant-only" connection table, whose nodes are the 165,733 bodies with status "Traced" or "Anchor" (anchors are large segments, e.g. with a soma or entering through a nerve, that were not fully traced). The upstream documentation does not describe this table; this is what it contains.
+- `v0_13_traced_*`, `v0_13_significant_*`: the same for version v0.13, with 165,113 and 165,728 nodes. Its full connection table is identical to that of v1.0 (the tables of v1.0 differ only through the changed annotations), and there is no table of neurotransmitter predictions for this version, so these networks lack the neurotransmitter properties.
+- `v0_9_traced_*`: release v0.9, with the 165,114 neurons with status "Traced" in that release as nodes, keeping only the connections between them from the full connection table of all 88 million segments.
+
+and, for each of them:
+
+- `*_min5`: only the pairs of neurons with at least five synapses are considered connected, since weak connections are unreliable (the authors find that connections need more than about ten synapses to be reproducible across animals), and for consistency with the `flywire` and `fly_banc` entries. In `v1_0_traced_min5`, these are 6,235,682 of the 25,563,197 connected pairs, carrying 89.7 million of their 124.0 million synapses.
+- `*_all`: all connections, without threshold on the number of synapses.
+
+The eleventh network, `v1_0_segments_all`, is the full connection table of release v1.0: all 88,404,403 segments of the reconstruction with synapses (including the small fragments not attached to any neuron, "orphans", glia, etc.) and all 151,856,684 connections between them, without threshold. Only 211,577 segments are annotated; their status is given by the properties `status`, `status_label` and `type` (empty for the others), and its other vertex properties are only `body_id`.
+
+All networks of a release and node set have the same nodes, so that neurons without connections (with at least five synapses, in `*_min5`) are isolated nodes. Self-loops are synapses of a neuron onto itself (autapses). The annotations and neurotransmitter predictions are those of the corresponding version.
+
+The networks have the following properties:
+
+- `body_id`: the neuron's identifier in the data set (neuPrint body ID).
+- `type`: the cell type of the neuron (e.g. `DNp01`); empty if not assigned.
+- `instance`: the neuron's instance name, typically the cell type followed by additional qualifiers and the side (e.g. `DNp01(GF)_R`).
+- `flywire_type`, `hemibrain_type`, `manc_type`: the matched cell types in the female brain connectomes FlyWire and hemibrain (see the `flywire` and `fly_hemibrain` entries) and in the male adult nerve cord connectome (MANC); empty if not assigned.
+- `superclass`, `class`, `subclass`: coarser classifications of the neuron (e.g. `descending_neuron`, `Kenyon_Cell`); empty if not assigned.
+- `soma_side`: the side of the neuron's soma (`L`, `R`, or `M` for the midline); empty if not assigned (e.g. sensory neurons without soma in the volume).
+- `root_side`: the side where the neuron enters the volume, for neurons without soma; empty otherwise.
+- `hemilineage`: the developmental hemilineage of the neuron (Ito-Lee nomenclature for the brain, Truman nomenclature for the ventral nerve cord); empty if not assigned.
+- `soma_neuromere`: the neuromere (segment) of the neuron's soma; empty if not assigned.
+- `entry_nerve`, `exit_nerve`: the nerve through which the neuron enters or exits the nervous system; empty if none.
+- `dimorphism`: whether the neuron is `male-specific` or `sexually dimorphic` (possibly with the qualifier `potentially`); empty otherwise.
+- `fru_dsx`: the expression of the sex-determination genes *fruitless* and *doublesex* in the neuron, from matches to genetic lines; empty if not known.
+- `status_label`: the detailed proofreading status of the neuron (e.g. `Roughly traced`, `Reviewed`).
+- `status` (only in `v1_0_segments_all`): the status of the segment (`Traced`, `Anchor`, `Assign`, `Orphan`, `Glia`, `Unimportant`); empty if not annotated.
+- `neurotransmitter`: the consensus neurotransmitter of the neuron, from the predictions for the neuron and its cell type (`unclear` if ambiguous); empty if not available. Not available in the `v0_13_*` networks.
+- `predicted_nt`, `predicted_nt_confidence`: the neurotransmitter predicted from the neuron's own synapses, and the confidence of that prediction (empty and NaN if not available). Not available in the `v0_13_*` networks.
+- `weight` (edges): the number of synapses from $i$ to $j$."""
+tags = ['Biological', 'Connectome', 'Weighted', 'Metadata']
+url = 'https://male-cns.janelia.org/download/'
+citation = [('S. Berg et al., "Sexual dimorphism in the complete Drosophila male central nervous system connectome." Cell 189, 5504-5526 (2026)', 'https://doi.org/10.1016/j.cell.2026.08.015')]
+icon_hash = None
+upstream_license = ("CC BY 4.0", "https://creativecommons.org/licenses/by/4.0/")
+upstream_prefix = 'https://storage.googleapis.com/flyem-male-cns'
+# the public releases v1.0 (June 2026) and v0.9 (October 2025), and the
+# unannounced intermediate version v0.13 (April 2026)
+_dirs = {"v1_0": "v1.0", "v0_13": "v0.13", "v0_9": "v0.9"}
+def _f(version, kind, suffix="-minconf-0.5"):
+    v = _dirs[version]
+    return f"{kind}-male-cns-{v}{suffix}.feather"
+_weights = {
+    "v1_0_traced": (_f("v1_0", "connectome-weights", "-minconf-0.5-traced-only"),
+                    _f("v1_0", "body-annotations"),
+                    _f("v1_0", "body-neurotransmitters", "")),
+    "v1_0_significant": (_f("v1_0", "connectome-weights", "-minconf-0.5-significant-only"),
+                         _f("v1_0", "body-annotations"),
+                         _f("v1_0", "body-neurotransmitters", "")),
+    # v0.13 has no neurotransmitter table
+    "v0_13_traced": (_f("v0_13", "connectome-weights", "-minconf-0.5-traced-only"),
+                     _f("v0_13", "body-annotations")),
+    "v0_13_significant": (_f("v0_13", "connectome-weights", "-minconf-0.5-significant-only"),
+                          _f("v0_13", "body-annotations")),
+    "v0_9_traced": (_f("v0_9", "connectome-weights"),
+                    _f("v0_9", "body-annotations"),
+                    _f("v0_9", "body-neurotransmitters", "")),
+}
+files = [(fnames, f"{net}_{thres}", None) for net, fnames in _weights.items()
+         for thres in ["min5", "all"]]
+# all segments of v1.0 (88 million), with all their connections
+files.append(((_f("v1_0", "connectome-weights"), _f("v1_0", "body-annotations")),
+              "v1_0_segments_all", None))
+
+# minimum number of synapses between two neurons for them to be connected
+min_synapses = {"min5": 5, "all": 0}
+
+def fetch_upstream(force=False):
+    name = __name__.split(".")[-1]
+    # the files of each version are in their own directory, but they are
+    # stored under their (distinct) base names
+    for version, d in _dirs.items():
+        fetch_upstream_files(name, f"{upstream_prefix}/{d}/connectome-data/flat-connectome",
+                             [x for x in files if x[1].startswith(version + "_")],
+                             force)
+
+vprops = ["type", "instance", ("flywireType", "flywire_type"),
+          ("hemibrainType", "hemibrain_type"), ("mancType", "manc_type"),
+          "superclass", "class", "subclass", ("somaSide", "soma_side"),
+          ("rootSide", "root_side"), ("somaNeuromere", "soma_neuromere"),
+          ("entryNerve", "entry_nerve"), ("exitNerve", "exit_nerve"),
+          "dimorphism", ("fruDsx", "fru_dsx"), ("statusLabel", "status_label")]
+
+@cache_network()
+@coerce_props()
+@annotate()
+def parse(alts=None):
+    name = __name__.split(".")[-1]
+    for fnames, alt, fmt in files:
+        if alts is not None and alt not in alts:
+            continue
+        fweights, fannot = fnames[:2]
+        fnt = fnames[2] if len(fnames) > 2 else None
+        with open_upstream_file(name, fannot, "rb", seekable=True) as f:
+            annot = pd.read_feather(f)
+        if "segments" in alt:
+            yield alt, parse_segments(name, fweights, annot)
+            continue
+        statuses = ["Traced", "Anchor"] if "significant" in alt else ["Traced"]
+        annot = annot[annot["status"].isin(statuses)].reset_index(drop=True)
+        if fnt is not None:
+            with open_upstream_file(name, fnt, "rb", seekable=True) as f:
+                nt = pd.read_feather(f, columns=["body", "predicted_nt",
+                                                 "predicted_nt_confidence",
+                                                 "consensus_nt"])
+            nt = nt.set_index("body").reindex(annot["bodyId"].to_numpy())
+
+        g = Graph()
+        g.add_vertex(len(annot))
+        g.vp.body_id = g.new_vp("int64_t", vals=annot["bodyId"].to_numpy())
+        for p in vprops:
+            col, pname = p if isinstance(p, tuple) else (p, p)
+            vals = annot[col].fillna("").astype(str)
+            g.vp[pname] = g.new_vp("string", vals=vals.tolist())
+        # Ito-Lee hemilineages in the brain, Truman hemilineages in the VNC
+        hl = annot["itoleeHl"].fillna(annot["trumanHl"]).fillna("").astype(str)
+        g.vp.hemilineage = g.new_vp("string", vals=hl.tolist())
+        if fnt is not None:
+            g.vp.neurotransmitter = g.new_vp("string", vals=nt["consensus_nt"].fillna("").astype(str).tolist())
+            g.vp.predicted_nt = g.new_vp("string", vals=nt["predicted_nt"].fillna("").astype(str).tolist())
+            g.vp.predicted_nt_confidence = \
+                g.new_vp("double", vals=nt["predicted_nt_confidence"].astype(float).to_numpy())
+
+        # The weights are read in batches, keeping only the connections
+        # between the nodes (the v0.9 table has all 152 million connections
+        # between the 88 million segments)
+        ids = pyarrow.array(annot["bodyId"].to_numpy())
+        minw = min_synapses[alt.split("_")[-1]]
+        ws = []
+        with open_upstream_file(name, fweights, "rb", seekable=True) as f:
+            reader = pyarrow.ipc.open_file(f)
+            for i in range(reader.num_record_batches):
+                b = reader.get_batch(i).select(["body_pre", "body_post", "weight"])
+                mask = pc.and_(pc.and_(pc.is_in(b["body_pre"], value_set=ids),
+                                       pc.is_in(b["body_post"], value_set=ids)),
+                               pc.greater_equal(b["weight"], minw))
+                ws.append(b.filter(mask))
+        w = pyarrow.Table.from_batches(ws).to_pandas()
+        del ws
+        idx = pd.Series(np.arange(len(annot)), index=annot["bodyId"].to_numpy())
+        s = idx.loc[w["body_pre"].to_numpy()].to_numpy()
+        t = idx.loc[w["body_post"].to_numpy()].to_numpy()
+        g.add_edge_list(np.column_stack((s, t)))
+        g.ep.weight = g.new_ep("int", vals=w["weight"].to_numpy())
+        yield alt, g
+
+def parse_segments(name, fweights, annot):
+    """The network of all segments: the connection table is read in batches,
+    into numpy arrays (the body IDs fit in 32 bits)."""
+    pre, post, weight = [], [], []
+    with open_upstream_file(name, fweights, "rb", seekable=True) as f:
+        reader = pyarrow.ipc.open_file(f)
+        for i in range(reader.num_record_batches):
+            b = reader.get_batch(i)
+            pre.append(b["body_pre"].to_numpy().astype("uint32"))
+            post.append(b["body_post"].to_numpy().astype("uint32"))
+            weight.append(b["weight"].to_numpy().astype("int32"))
+    pre = np.concatenate(pre)
+    post = np.concatenate(post)
+    weight = np.concatenate(weight)
+
+    ids = np.unique(np.concatenate([np.unique(pre), np.unique(post),
+                                    annot["bodyId"].to_numpy().astype("uint32")]))
+    g = Graph()
+    g.add_vertex(len(ids))
+    g.vp.body_id = g.new_vp("int64_t", vals=ids)
+    edges = np.empty((len(pre), 2), dtype="int64")
+    edges[:, 0] = np.searchsorted(ids, pre)
+    del pre
+    edges[:, 1] = np.searchsorted(ids, post)
+    del post
+    g.add_edge_list(edges)
+    del edges
+    g.ep.weight = g.new_ep("int", vals=weight)
+    del weight
+
+    # the status and type of the annotated segments; empty for the others
+    vs = np.searchsorted(ids, annot["bodyId"].to_numpy().astype("uint32"))
+    for p, col in [("status", "status"), ("status_label", "statusLabel"),
+                   ("type", "type")]:
+        g.vp[p] = g.new_vp("string")
+        vp = g.vp[p]
+        for v, x in zip(vs, annot[col].fillna("").astype(str)):
+            vp[v] = x
+    return g