Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Graph Analysis

In-memory graph analysis on connectome datasets. SynDB constructs a directed graph from synapse data in ClickHouse (up to 10M edges) and runs network algorithms using petgraph.

Requires Academic verification.

Graph Metrics

Basic network statistics:

curl -H "Authorization: Bearer $TOKEN" \
  https://api.syndb.xyz/v1/graph/{dataset_id}/metrics

Returns current graph metrics including node count, edge count, density, reciprocity, average in and out degree, maximum in and out degree, and strongly connected component counts.

Motif Analysis (Triadic Census)

Count all 16 three-node subgraph patterns (triadic census):

curl -X POST -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  https://api.syndb.xyz/v1/graph/{dataset_id}/motifs \
  -d '{}'

Compare by Synapse Type

Compare motif distributions across synapse types within the same dataset:

curl -X POST -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  https://api.syndb.xyz/v1/graph/{dataset_id}/motifs/compare-synapse-types \
  -d '{"sample_size": 500}'

Shortest Path

Find the shortest path between two neurons:

curl -X POST -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  https://api.syndb.xyz/v1/graph/{dataset_id}/shortest-path \
  -d '{
    "source_neuron_id": "11111111-1111-1111-1111-111111111111",
    "target_neuron_id": "22222222-2222-2222-2222-222222222222",
    "weight_mode": "hops"
  }'

Uses Dijkstra’s algorithm. Supports configurable edge weight modes.

Reachability

Find all neurons reachable within N hops:

curl -X POST -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  https://api.syndb.xyz/v1/graph/{dataset_id}/reachability \
  -d '{"source_neuron_id": "11111111-1111-1111-1111-111111111111", "max_hops": 3}'

BFS traversal, maximum 100 hops.

Reachability Curve

Sample how reachability grows with hop count:

curl -X POST -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  https://api.syndb.xyz/v1/graph/{dataset_id}/reachability-curve \
  -d '{"sample_size": 100, "max_hops": 20, "seed": 42}'

Returns the mean and standard deviation of the reachable fraction at each hop distance. Current limits are max 500 samples and max 20 hops.

Full Analysis

Run metrics + motifs + hub neuron detection in one call:

curl -X POST -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  https://api.syndb.xyz/v1/graph/{dataset_id}/full-analysis \
  -d '{"max_edges": 5000000, "top_hubs": 20}'

Cross-Dataset Comparison

Compare graph properties across multiple datasets:

curl -H "Authorization: Bearer $TOKEN" \
  "https://api.syndb.xyz/v1/graph/compare?dataset_ids=uuid-1,uuid-2,uuid-3"

Graph Precompute (CLI)

For large datasets, precompute graph metrics and store results in ClickHouse materialized tables:

syndb graph-precompute --dataset flywire

--dataset accepts current dataset keys such as flywire, manc, or h01. This is a batch operation typically run as part of the ETL pipeline or as a Kubernetes job.