Skip to content

API Reference

NeKo's documented API is organized by the role each surface plays in a network-construction workflow:

Module Description
neko.core.network.Network Core class – build, manipulate, and query a signalling network
neko.core.strategies High-level connection and enrichment strategies exposed by Network
neko._visual.visualize_network.NetworkVisualizer Render networks with Graphviz or the yFiles widget
neko._methods.enrichment_methods.Connections Low-level indexed graph searches used by connection strategies
neko.inputs Universe plus OmniPath, SIGNOR, HuRI, and PhosphoSitePlus adapters
Identifier mapping Cached UniProt/gene-symbol translation and batched translation
compare_networks Shared and unique topology across two networks
neko._annotations.gene_ontology.Ontology Gene Ontology utilities and phenotype mapping
neko._outputs.exports Implemented BNet and SIF export helpers
History and states Branching Network history, snapshots, and renderers
Core objects and tools Node, Edge, and public graph utilities

Design philosophy

NeKo follows a Network-centric design:

  1. Start with a list of gene/protein identifiers.
  2. Attach an interaction Universe from OmniPath (or custom CSV/DataFrame).
  3. Use Network methods to connect, expand, and annotate nodes.
  4. Visualise or export the result.

Decorated mutation methods on Network automatically create snapshots in its branching history tree, so intermediate states are recoverable. History is a facility of Network plus NetworkState, not a separate NetworkHistory class.


Import conventions

# Core
from neko.core.network import Network

# Visualisation
from neko._visual.visualize_network import NetworkVisualizer

# Interaction universe
from neko.inputs import Universe

# Ontology
from neko._annotations.gene_ontology import Ontology

SIGNOR entities

neko.inputs.signor() normalizes SIGNOR-specific nodes automatically. It uses NeKo's validated local cache for the interaction table and the complex, protein-family, phenotype, and stimulus dictionaries, downloading only the missing resources. It expands complexes recursively into OmniPath-compatible COMPLEX: identifiers and assigns readable typed identifiers to the other entity classes.

from neko.inputs import signor

resources = signor()

After the first successful load, the cached release is available offline. Set NEKO_CACHE_DIR to choose the cache root. Use normalize_entities=False only when raw identifiers such as SIGNOR-C1 are explicitly needed. Preloaded DataFrames can also be supplied as entity_dictionaries.

ChEBI accessions are preserved as canonical non-protein identifiers rather than being sent to UniProt. NeKo lazily caches the official compressed compounds.tsv.gz table and extracts only the names required by the current resource. Name enrichment is best-effort; offline or failed downloads fall back to displaying the accession without blocking network construction. ChEBI data are provided by EMBL-EBI under CC BY 4.0.

PhosphoSitePlus identifiers

neko.inputs.phosphosite() preserves phosphorylation sites in the native GENE_RESIDUE form, for example MAP3K4_T1494. Serine, threonine, and tyrosine sites are recognized before protein identifier translation, so site nodes are never submitted to UniProt. When a resource uses gene symbols as edge identifiers, NeKo also keeps those symbols as the graph identifiers to ensure kinase-to-site and site-to-protein paths remain searchable.