CRN#

Chemical reaction network construction, structure handling, querying, symmetry, Petri-net analysis, and visualization utilities.

Construct#

class synkit.CRN.Construct.abstract.AbstractReactionExtractor[source]#

Bases: object

build(reactions: Sequence[str] | None = None, *, data: Mapping[str, Any] | None = None, drop_missing_smiles_reactions: bool = True, deduplicate: bool = False, templates: Mapping[str, str] | None = None, order: str = 'appearance', reactant_join: str = '+', product_join: str = '+', prefix_module_in_reaction_id: bool = True, reaction_id_keys: Sequence[str] | None = None, reaction_smiles_keys: Sequence[str] | None = None, template_keys: Sequence[str] | None = None, save_as: str | Path | None = None) AbstractReactionNetwork[source]#
build_molecule_pool(parsed_reactions: Sequence[Tuple[List[str], List[str]]], *, order: str = 'appearance') List[str][source]#
extract_reactions_and_templates(reactions: Sequence[str] | None = None, *, data: Mapping[str, Any] | None = None, templates: Mapping[str, str] | None = None, drop_missing_smiles_reactions: bool = True, prefix_module_in_reaction_id: bool = True, reaction_id_keys: Sequence[str] | None = None, reaction_smiles_keys: Sequence[str] | None = None, template_keys: Sequence[str] | None = None) Tuple[List[str], Dict[str, str]][source]#
iter_reaction_records(data: Mapping[str, Any]) Iterable[Tuple[Mapping[str, Any], str]][source]#
class synkit.CRN.Construct.abstract.AbstractReactionNetwork(molecule_pool: ~typing.List[str], reactions: ~typing.List[str], templates: ~typing.Dict[str, str] = <factory>, label_to_molecule: ~typing.Dict[str, str] = <factory>)[source]#

Bases: object

label_to_molecule: Dict[str, str]#
molecule_pool: List[str]#
reactions: List[str]#
save_json(path: str | Path, *, name: str | None = None) None[source]#
templates: Dict[str, str]#
to_dict() Dict[str, Any][source]#
to_json_payload(name: str = 'abstract_reaction_network') Dict[str, Any][source]#
synkit.CRN.Construct.abstract.deduplicate_abstract_reactions(reactions: Sequence[str]) List[str][source]#
synkit.CRN.Construct.arity.count_lhs_components(text: str) int | None[source]#
synkit.CRN.Construct.arity.infer_rule_arity(rule: Any) int[source]#
class synkit.CRN.Construct.builder.CRNExpand(rules: 'List[Any]', repeats: 'int' = 50, explicit_h: 'bool' = False, implicit_temp: 'bool' = False, strategy: 'Optional[str]' = None, keep_aam: 'bool' = True, max_components: 'int' = 3, use_frontier: 'bool' = True, max_mixtures_per_rule_step: 'int' = 50000, max_tasks_per_step: 'int' = 200000, allow_self_mixtures: 'bool' = False, skip_no_change: 'bool' = True, allow_empty_side: 'bool' = False, dedup_delta: 'bool' = True, dedup_across_rules: 'bool' = False)[source]#

Bases: object

allow_empty_side: bool = False#
allow_self_mixtures: bool = False#
build(seeds: Iterable[str], *, parallel: bool = False, max_workers: int | None = None, reset: bool = True) DiGraph[source]#
dedup_across_rules: bool = False#
dedup_delta: bool = True#
property derivation_records: List[Dict[str, object]]#
derivations: DerivationLog#
explicit_h: bool = False#
graph: DiGraph#
implicit_temp: bool = False#
keep_aam: bool = True#
max_components: int = 3#
max_mixtures_per_rule_step: int = 50000#
max_tasks_per_step: int = 200000#
repeats: int = 50#
reset() None[source]#
rules: List[Any]#
property rxn_nodes: List[int]#
skip_no_change: bool = True#
property species_nodes: List[int]#
state: DerivationState#
strategy: str | None = None#
strategy_engine: FrontierStrategy#
use_frontier: bool = True#
synkit.CRN.Construct.builder.build_crn_from_smarts(rules: List[str], seeds: List[str], *, repeats: int = 50, explicit_h: bool = False, implicit_temp: bool = False, strategy: str | None = None, keep_aam: bool = True, parallel: bool = False, max_workers: int | None = None, max_components: int = 3, use_frontier: bool = True, max_mixtures_per_rule_step: int = 50000, max_tasks_per_step: int = 200000, allow_self_mixtures: bool = False, skip_no_change: bool = True, allow_empty_side: bool = False, dedup_delta: bool = True, dedup_across_rules: bool = False) DiGraph[source]#
class synkit.CRN.Construct.derivation.DerivationLog(records: 'List[DerivationRecord]' = <factory>)[source]#

Bases: object

append(*, event_id: int, label: str, step: int, rule_index: int, reactants: Tuple[str, ...], products: Tuple[str, ...]) None[source]#
as_dicts() List[Dict[str, object]][source]#
clear() None[source]#
records: List[DerivationRecord]#
class synkit.CRN.Construct.derivation.DerivationRecord(event_id: int, label: str, step: int, rule_index: int, reactants: Tuple[str, ...], products: Tuple[str, ...])[source]#

Bases: object

event_id: int#
label: str#
products: Tuple[str, ...]#
reactants: Tuple[str, ...]#
rule_index: int#
step: int#
class synkit.CRN.Construct.flattener.ReactionDeltaFlattener(graph: 'nx.DiGraph', skip_no_change: 'bool' = True, allow_empty_side: 'bool' = False, deduplicate: 'bool' = True)[source]#

Bases: object

allow_empty_side: bool = False#
build() ReactionDeltaFlattener[source]#
deduplicate: bool = True#
graph: DiGraph#
property reactions: List[Dict[str, Any]]#
skip_no_change: bool = True#
synkit.CRN.Construct.keys.make_dedup_key(*, dedup_across_rules: bool, rule_index: int, r_keep_keys: Tuple[str, ...], p_keep_keys: Tuple[str, ...]) Tuple[int | None, Tuple[str, ...], Tuple[str, ...]][source]#
synkit.CRN.Construct.mixtures.iter_mixtures_arity1(pool_keys: List[str], frontier_keys: List[str], *, use_frontier: bool, cap: int) Iterator[Tuple[str, ...]][source]#
synkit.CRN.Construct.mixtures.iter_mixtures_arity2(pool_keys: List[str], frontier_keys: List[str], *, use_frontier: bool, allow_self_mixtures: bool, cap: int) Iterator[Tuple[str, ...]][source]#
synkit.CRN.Construct.mixtures.iter_mixtures_arityk(pool_keys: List[str], frontier_keys: List[str], *, use_frontier: bool, allow_self_mixtures: bool, arity: int, cap: int) Iterator[Tuple[str, ...]][source]#
synkit.CRN.Construct.smiles.assign_deterministic_maps_and_canonical(nomap_smiles: str) str | None[source]#
synkit.CRN.Construct.smiles.canonical_from_mol(mol: Any) str | None[source]#
synkit.CRN.Construct.smiles.has_atom_maps(mol: Any) bool[source]#
synkit.CRN.Construct.smiles.mol_from_smiles_safe(smiles: str) Any | None[source]#
synkit.CRN.Construct.smiles.sanitize_safe(mol: Any) bool[source]#
synkit.CRN.Construct.smiles.standardize_smiles_rdkit(smiles: str, *, keep_aam: bool) str | None[source]#
synkit.CRN.Construct.smiles.strip_maps_and_canonical_from_mol(mol: Any) str | None[source]#
class synkit.CRN.Construct.state.DerivationState(pool_keys: Set[str] = <factory>, frontier_keys: Set[str] = <factory>, step: int = 0)[source]#

Bases: object

advance(next_frontier: Set[str]) None[source]#
begin_step(step: int) None[source]#
frontier_keys: Set[str]#
pool_keys: Set[str]#
set_initial(*, pool_keys: Set[str], frontier_keys: Set[str]) None[source]#
step: int = 0#
class synkit.CRN.Construct.strategy.ConstructionStrategy(*args, **kwargs)[source]#

Bases: Protocol

iter_mixtures(*, pool_keys: List[str], frontier_keys: List[str], arity: int, use_frontier: bool, allow_self_mixtures: bool, cap: int, max_components: int) Iterator[Tuple[str, ...]][source]#
class synkit.CRN.Construct.strategy.FrontierStrategy[source]#

Bases: object

iter_mixtures(*, pool_keys: List[str], frontier_keys: List[str], arity: int, use_frontier: bool, allow_self_mixtures: bool, cap: int, max_components: int) Iterator[Tuple[str, ...]][source]#
synkit.CRN.Construct.worker.apply_rule_worker(args: Tuple[int, Any, str, bool, bool, str | None, Tuple[str, ...]]) Tuple[int, Tuple[str, ...], List[str]][source]#
class synkit.CRN.Construct.DAG.crn.CRN(rule_list: List[Dict[str, Any]], smiles_list: str | Sequence[str], *, n_repeats: int = 3, prune: bool = True, strategy: str | Strategy = Strategy.BACKTRACK, verbosity: int = 0)[source]#

Bases: object

get_reaction_smiles() Dict[str, List[str]][source]#
help() None[source]#
property product_sets: Dict[str, List[str]]#
property rule_count: int#
run() CRN[source]#
class synkit.CRN.Construct.DAG.mod_crn.MODCRN(rule_db_path: str | List[str], initial_smiles: List[str], n_repeats: int = 2)[source]#

Bases: object

build() None[source]#
property derivation_graph: None#
export_report() None[source]#
property graphs: List[None]#
help() None[source]#
property num_edges: int#
property num_vertices: int#
print_summary() None[source]#
property rules: List[None]#
class synkit.CRN.Construct.DAG.syncrn.ReactionDeltaFlattener(graph: 'nx.DiGraph', skip_no_change: 'bool' = True, allow_empty_side: 'bool' = False, deduplicate: 'bool' = True)[source]#

Bases: object

allow_empty_side: bool = False#
build() ReactionDeltaFlattener[source]#
deduplicate: bool = True#
graph: DiGraph#
property reactions: List[Dict[str, Any]]#
skip_no_change: bool = True#
class synkit.CRN.Construct.DAG.syncrn.SynCRN(rules: 'List[Any]', repeats: 'int' = 50, explicit_h: 'bool' = False, implicit_temp: 'bool' = False, strategy: 'Optional[str]' = None, keep_aam: 'bool' = True, max_components: 'int' = 3, use_frontier: 'bool' = True, max_mixtures_per_rule_step: 'int' = 50000, max_tasks_per_step: 'int' = 200000, skip_no_change: 'bool' = True, allow_empty_side: 'bool' = False, dedup_delta: 'bool' = True, dedup_across_rules: 'bool' = False)[source]#

Bases: object

allow_empty_side: bool = False#
build(seeds: Iterable[str], *, parallel: bool = False, max_workers: int | None = None) DiGraph[source]#
dedup_across_rules: bool = False#
dedup_delta: bool = True#
explicit_h: bool = False#
graph: DiGraph#
implicit_temp: bool = False#
keep_aam: bool = True#
max_components: int = 3#
max_mixtures_per_rule_step: int = 50000#
max_tasks_per_step: int = 200000#
repeats: int = 50#
rules: List[Any]#
property rxn_nodes: List[int]#
skip_no_change: bool = True#
property species_nodes: List[int]#
strategy: str | None = None#
use_frontier: bool = True#
synkit.CRN.Construct.DAG.syncrn.build_syncrn_from_smarts(rules: List[str], seeds: List[str], *, repeats: int = 50, explicit_h: bool = False, implicit_temp: bool = False, strategy: str | None = None, keep_aam: bool = True, parallel: bool = False, max_workers: int | None = None, max_components: int = 3, use_frontier: bool = True, max_mixtures_per_rule_step: int = 50000, max_tasks_per_step: int = 200000, skip_no_change: bool = True, allow_empty_side: bool = False, dedup_delta: bool = True, dedup_across_rules: bool = False) DiGraph[source]#

Structure#

class synkit.CRN.Structure.reaction.RXNSide(counts: Dict[str, int]=<factory>)[source]#

Bases: object

counts: Dict[str, int]#
get(species_id: str, default: int = 0) int[source]#
items() List[Tuple[str, int]][source]#
to_dict() Dict[str, int][source]#
class synkit.CRN.Structure.reaction.Reaction(id: str, source_node_id: Hashable, source_kind: str, lhs: RXNSide, rhs: RXNSide, label: str | None = None, step: int | None = None, rule_index: int | None = None, app_index: int | None = None, rule_repr: str | None = None, rule_id: str | None = None, source_attrs: Dict[str, ~typing.Any]=<factory>, metadata: Dict[str, ~typing.Any]=<factory>, reactant_edge_attrs: Dict[str, ~typing.Dict[str, ~typing.Any]]=<factory>, product_edge_attrs: Dict[str, ~typing.Dict[str, ~typing.Any]]=<factory>)[source]#

Bases: object

app_index: int | None = None#
format(species_token: Callable[[str], str], *, include_id: bool = True, include_rule: bool = False, include_step: bool = False, arrow: str = '>>') str[source]#
format_side(side: RXNSide, species_token: Callable[[str], str]) str[source]#
id: str#
label: str | None = None#
lhs: RXNSide#
metadata: Dict[str, Any]#
product_edge_attrs: Dict[str, Dict[str, Any]]#
reactant_edge_attrs: Dict[str, Dict[str, Any]]#
rhs: RXNSide#
rule_id: str | None = None#
rule_index: int | None = None#
rule_repr: str | None = None#
source_attrs: Dict[str, Any]#
source_kind: str#
source_node_id: Hashable#
step: int | None = None#
to_dict() Dict[str, Any][source]#
class synkit.CRN.Structure.rule.Rule(id: str, rule_index: int | None = None, rule_repr: str | None = None, label: str | None = None, metadata: Dict[str, ~typing.Any]=<factory>)[source]#

Bases: object

id: str#
label: str | None = None#
metadata: Dict[str, Any]#
rule_index: int | None = None#
rule_repr: str | None = None#
property signature: Tuple[int | None, str | None]#
to_dict() Dict[str, Any][source]#
class synkit.CRN.Structure.species.Species(id: str, source_node_id: Hashable, label: str, smiles: str | None = None, source_attrs: Dict[str, ~typing.Any]=<factory>, metadata: Dict[str, ~typing.Any]=<factory>)[source]#

Bases: object

id: str#
label: str#
metadata: Dict[str, Any]#
smiles: str | None = None#
source_attrs: Dict[str, Any]#
source_node_id: Hashable#
to_dict() Dict[str, Any][source]#
class synkit.CRN.Structure.syncrn.SynCRN(species: Dict[str, ~synkit.CRN.Structure.species.Species]=<factory>, reactions: Dict[str, ~synkit.CRN.Structure.reaction.Reaction]=<factory>, rules: Dict[str, ~synkit.CRN.Structure.rule.Rule]=<factory>, graph_attrs: Dict[str, ~typing.Any]=<factory>, metadata: Dict[str, ~typing.Any]=<factory>)[source]#

Bases: object

describe(*, include_species: bool = False, species: str = 'label') str[source]#
format_reaction(reaction_id: str, *, species: str = 'label', include_id: bool = True, include_rule: bool = False, include_step: bool = False, arrow: str = '>>') str[source]#
classmethod from_digraph(crn: DiGraph, *, species_kind: str = 'species', reaction_kinds: Tuple[str, ...] = ('reaction', 'rule'), species_prefix: str = 's_', reaction_prefix: str = 'r_', rule_prefix: str = 'rule_', strict: bool = True) SynCRN[source]#
classmethod from_reaction_strings(rxns: List[str], rules: List[str | None] | None = None, *, parser: Callable[[str], Any] | None = None, strict: bool = True) SynCRN[source]#
graph_attrs: Dict[str, Any]#
metadata: Dict[str, Any]#
property n_reactions: int#
property n_rules: int#
property n_species: int#
property reaction_ids: List[str]#
reactions: Dict[str, Reaction]#
property rule_ids: List[str]#
rules: Dict[str, Rule]#
species: Dict[str, Species]#
property species_ids: List[str]#
to_dict() Dict[str, Any][source]#
to_digraph(*, node_ids: str = 'source', reaction_kind: str | None = None, include_internal_ids: bool = True) DiGraph[source]#
to_equations(*, species: str = 'label', include_id: bool = True, include_rule: bool = False, include_step: bool = False, arrow: str = '>>') List[str][source]#
to_petrinet() Dict[str, Any][source]#
to_stoichiometric_matrices() Dict[str, Any][source]#

Pathway#

class synkit.CRN.Pathway.pathfinder.PathFinderConfig(max_depth: int = 12, max_paths: int = 20, stop_after_first: bool = False, deduplicate_by_flow: bool = True)[source]#

Bases: object

deduplicate_by_flow: bool = True#
max_depth: int = 12#
max_paths: int = 20#
stop_after_first: bool = False#
class synkit.CRN.Pathway.pathfinder.PathwayCandidate(reactions: List[str], flow: Dict[str, int], reached_species: List[str], depth: int, realizable: bool | None = None, certificate: List[str] | None = None)[source]#

Bases: object

certificate: List[str] | None = None#
depth: int#
flow: Dict[str, int]#
reached_species: List[str]#
reactions: List[str]#
realizable: bool | None = None#
class synkit.CRN.Pathway.pathfinder.PathwayFinder(config: PathFinderConfig | None = None)[source]#

Bases: object

edges: Dict[str, Tuple[Dict[str, int], Dict[str, int]]]#
find_paths_set(*, source_species: Iterable[str], target_species: Iterable[str], max_depth: int | None = None, max_paths: int | None = None, stop_after_first: bool | None = None, deduplicate_by_flow: bool | None = None) List[PathwayCandidate][source]#
load_hypergraph(vertices: Iterable[str], edges: Mapping[str, Tuple[Mapping[str, int], Mapping[str, int]]]) PathwayFinder[source]#
load_syncrn(crn: object, *, species: str = 'label', reaction: str = 'id') PathwayFinder[source]#
reaction_id_to_token: Dict[str, str]#
reaction_token_to_id: Dict[str, str]#
species_id_to_token: Dict[str, str]#
species_token_to_id: Dict[str, str]#
validate_candidates(crn: object, candidates: List[PathwayCandidate], *, initial_marking: Mapping[str, int], species: str = 'label', reaction: str = 'id') List[PathwayCandidate][source]#
vertices: Set[str]#
synkit.CRN.Pathway.pathfinder.run_pathfinder_from_syncrn(crn: object, *, source_species: Iterable[str], target_species: Iterable[str], initial_marking: Mapping[str, int] | None = None, species: str = 'label', reaction: str = 'id', max_depth: int = 12, max_paths: int = 20, validate: bool = False, verbose: bool = True) List[PathwayCandidate][source]#
class synkit.CRN.Pathway.reachability.PathwayReachability(config: ReachabilityConfig | None = None)[source]#

Bases: object

compute_layers_multiset(initial_marking: Mapping[str, int], max_layers: int | None = None) ReachabilityResult[source]#
compute_layers_set(initial_species: Iterable[str], max_layers: int | None = None) ReachabilityResult[source]#
export_layers_json(result: ReachabilityResult, fn: str) PathwayReachability[source]#
load_hypergraph(vertices: Iterable[str], edges: Mapping[str, Tuple[Mapping[str, int], Mapping[str, int]]]) PathwayReachability[source]#
load_syncrn(crn: object, *, species: str = 'label', reaction: str = 'id') PathwayReachability[source]#
class synkit.CRN.Pathway.reachability.ReachabilityConfig(max_layers: int = 10000, stop_when_no_new_species: bool = True)[source]#

Bases: object

max_layers: int = 10000#
stop_when_no_new_species: bool = True#
class synkit.CRN.Pathway.reachability.ReachabilityLayer(depth: int, newly_enabled_reactions: List[str], newly_reachable_species: List[str], all_reachable_species: List[str])[source]#

Bases: object

all_reachable_species: List[str]#
depth: int#
newly_enabled_reactions: List[str]#
newly_reachable_species: List[str]#
class synkit.CRN.Pathway.reachability.ReachabilityResult(initial_species: List[str], layers: List[ReachabilityLayer], species_first_depth: Dict[str, int], reaction_first_depth: Dict[str, int])[source]#

Bases: object

initial_species: List[str]#
layers: List[ReachabilityLayer]#
reaction_first_depth: Dict[str, int]#
species_first_depth: Dict[str, int]#
synkit.CRN.Pathway.reachability.run_reachability_from_syncrn(crn: object, initial_species: Iterable[str], *, species: str = 'label', reaction: str = 'id', verbose: bool = True) Tuple[PathwayReachability, ReachabilityResult][source]#
synkit.CRN.Pathway.reachability.syncrn_to_reachability_inputs(crn: object, *, species: str = 'label', reaction: str = 'id') Tuple[List[str], Dict[str, Tuple[Dict[str, int], Dict[str, int]]]][source]#
class synkit.CRN.Pathway.realizability.PathwayRealizability(config: RealizabilityConfig | None = None)[source]#

Bases: object

build_petri_net_from_flow() PathwayRealizability[source]#
property certificate: List[str] | None#
export_pnml(fn: str) PathwayRealizability[source]#
property goal_atleast: Dict[str, int]#
property goal_exact: Dict[str, int]#
property initial_marking: Dict[str, int]#
is_borrow_realizable(max_borrow_each: int = 2) Tuple[bool, Mapping[str, int] | None][source]#
is_realizable(max_states: int | None = None, max_depth: int | None = None) Tuple[bool, List[str] | None][source]#
is_realizable_via_konig() bool[source]#
is_scaled_realizable(k_max: int = 4) Tuple[bool, int | None][source]#
load_hypergraph_and_flow(vertices: Iterable[str], edges: Mapping[str, Tuple[Mapping[str, int], Mapping[str, int]]], flow: Mapping[str, int], *, initial_marking: Mapping[str, int] | None = None) PathwayRealizability[source]#
load_syncrn_and_flow(crn: object, flow: Mapping[str, int] | None = None, *, initial_marking: Mapping[str, int] | None = None, species: str = 'label', reaction: str = 'id') PathwayRealizability[source]#
property petri: PetriNet#
set_initial_marking(marking: Mapping[str, int]) PathwayRealizability[source]#
summary() RealizabilitySummary[source]#
class synkit.CRN.Pathway.realizability.RealizabilityConfig(max_states: int = 100000, max_depth: int = 10000)[source]#

Bases: object

max_depth: int = 10000#
max_states: int = 100000#
class synkit.CRN.Pathway.realizability.RealizabilitySummary(n_species: int, n_reactions: int, active_flow: Dict[str, int]=<factory>, initial_marking: Dict[str, int]=<factory>, goal_exact: Dict[str, int]=<factory>, goal_atleast: Dict[str, int]=<factory>)[source]#

Bases: object

active_flow: Dict[str, int]#
goal_atleast: Dict[str, int]#
goal_exact: Dict[str, int]#
initial_marking: Dict[str, int]#
n_reactions: int#
n_species: int#
synkit.CRN.Pathway.realizability.run_realizability_from_syncrn(crn: object, flow: Mapping[str, int] | None = None, *, initial_marking: Mapping[str, int] | None = None, species: str = 'label', reaction: str = 'id', verbose: bool = True) Tuple[PathwayRealizability, Dict[str, object]][source]#
synkit.CRN.Pathway.realizability.syncrn_to_pr_inputs(crn: object, flow: Mapping[str, int] | None = None, *, initial_marking: Mapping[str, int] | None = None, species: str = 'label', reaction: str = 'id') Tuple[List[str], Dict[str, Tuple[Dict[str, int], Dict[str, int]]], Dict[str, int], Dict[str, int]][source]#

Petri net#

class synkit.CRN.Petrinet.analyzer.PetriAnalyzer(crn: Any, *, rtol: float = 1e-12, max_siphon_size: int | None = None)[source]#

Bases: object

as_dict() Dict[str, Any][source]#
check_persistence() PetriAnalyzer[source]#
compute_all() PetriAnalyzer[source]#
compute_semiflows() PetriAnalyzer[source]#
compute_siphons_traps() PetriAnalyzer[source]#
explain() str[source]#
property p_semiflows: ndarray | None#
property persistence_details: PersistenceCheckResult | None#
property persistence_ok: bool | None#
property petri: PetriNet#
property siphons: List[Set[str]] | None#
property summary: PetriSummary | None#
property t_semiflows: ndarray | None#
property traps: List[Set[str]] | None#
class synkit.CRN.Petrinet.analyzer.PetriSummary(p_semiflows: ndarray, t_semiflows: ndarray, siphons: List[Set[str]], traps: List[Set[str]], persistence_ok: bool, place_order: List[str], transition_order: List[str])[source]#

Bases: object

p_semiflows: ndarray#
persistence_ok: bool#
place_order: List[str]#
siphons: List[Set[str]]#
t_semiflows: ndarray#
transition_order: List[str]#
traps: List[Set[str]]#
class synkit.CRN.Petrinet.net.PetriNet[source]#

Bases: object

add_place(p: str, *, label: str | None = None, source_node_id: Hashable | None = None) None[source]#
add_transition(tid: str, pre: Mapping[str, int], post: Mapping[str, int], *, label: str | None = None, source_reaction_id: str | None = None, metadata: MutableMapping[str, Any] | None = None) None[source]#
enabled(marking: Mapping[str, int], tid: str) bool[source]#
fire(marking: Mapping[str, int], tid: str) Dict[str, int][source]#
classmethod from_syncrn(crn: Any) PetriNet[source]#
marking_to_tuple(m: Mapping[str, int]) Tuple[int, ...][source]#
place_name(p: str) str[source]#
property place_order: List[str]#
to_pre_post() Dict[str, Any][source]#
transition_name(tid: str) str[source]#
property transition_order: List[str]#
tuple_to_marking(values: Iterable[int]) Dict[str, int][source]#
class synkit.CRN.Petrinet.net.SynCRNIncidence(species_order: ~typing.List[str], reaction_order: ~typing.List[str], species_labels: ~typing.Dict[str, str], reaction_labels: ~typing.Dict[str, str], pre: ~typing.Dict[str, ~typing.Dict[str, int]], post: ~typing.Dict[str, ~typing.Dict[str, int]], species_source_node_ids: ~typing.Dict[str, ~typing.Hashable] = <factory>, reaction_source_node_ids: ~typing.Dict[str, ~typing.Hashable] = <factory>, graph_attrs: ~typing.Dict[str, ~typing.Any] = <factory>, metadata: ~typing.Dict[str, ~typing.Any] = <factory>)[source]#

Bases: object

graph_attrs: Dict[str, Any]#
metadata: Dict[str, Any]#
post: Dict[str, Dict[str, int]]#
pre: Dict[str, Dict[str, int]]#
reaction_labels: Dict[str, str]#
reaction_order: List[str]#
reaction_source_node_ids: Dict[str, Hashable]#
species_labels: Dict[str, str]#
species_order: List[str]#
species_source_node_ids: Dict[str, Hashable]#
class synkit.CRN.Petrinet.net.Transition(tid: str, pre: ~typing.Dict[str, int], post: ~typing.Dict[str, int], label: str | None = None, source_reaction_id: str | None = None, metadata: ~typing.Dict[str, ~typing.Any] = <factory>)[source]#

Bases: object

label: str | None = None#
metadata: Dict[str, Any]#
post: Dict[str, int]#
pre: Dict[str, int]#
source_reaction_id: str | None = None#
tid: str#
synkit.CRN.Petrinet.net.extract_syncrn_incidence(crn: Any) SynCRNIncidence[source]#
class synkit.CRN.Petrinet.persistence.PersistenceCheckResult(persistence_ok: bool, siphons: List[Set[str]], semiflow_supports: List[Set[str]], uncovered_siphons: List[Set[str]])[source]#

Bases: object

persistence_ok: bool#
semiflow_supports: List[Set[str]]#
siphons: List[Set[str]]#
uncovered_siphons: List[Set[str]]#
synkit.CRN.Petrinet.persistence.siphon_persistence_condition(crn: Any, *, rtol: float = 1e-12, max_siphon_size: int | None = None) bool[source]#
synkit.CRN.Petrinet.persistence.siphon_persistence_details(crn: Any, *, rtol: float = 1e-12, max_siphon_size: int | None = None, support_tol: float = 1e-08) PersistenceCheckResult[source]#
synkit.CRN.Petrinet.semiflows.find_p_semiflows(crn: Any, *, rtol: float = 1e-12) ndarray[source]#
synkit.CRN.Petrinet.semiflows.find_t_semiflows(crn: Any, *, rtol: float = 1e-12) ndarray[source]#
synkit.CRN.Petrinet.semiflows.semiflow_supports(crn: Any, *, kind: str = 'p', rtol: float = 1e-12, support_tol: float = 1e-08) List[Dict[str, float]][source]#
synkit.CRN.Petrinet.semiflows.stoichiometric_matrix(crn: Any) Tuple[List[str], List[str], ndarray][source]#
synkit.CRN.Petrinet.structure.find_siphons(crn: Any, *, max_size: int | None = None, names: str = 'label') List[Set[str]][source]#
synkit.CRN.Petrinet.structure.find_traps(crn: Any, *, max_size: int | None = None, names: str = 'label') List[Set[str]][source]#
synkit.CRN.Petrinet.structure.species_transition_neighborhoods(crn: Any) Dict[str, Dict[str, List[str]]][source]#

Properties#

class synkit.CRN.Props.dynamics.StructuralSingularitySummary(n_species: int, structural_rank: int, has_perfect_matching: bool, pattern_singular: bool, determinant_checked: bool, determinant_expr: Any | None = None, determinant_is_zero: bool | None = None)[source]#

Bases: object

property classification: str#
determinant_checked: bool#
determinant_expr: Any | None = None#
determinant_is_zero: bool | None = None#
has_perfect_matching: bool#
n_species: int#
pattern_singular: bool#
structural_rank: int#
to_dict() Dict[str, Any][source]#
synkit.CRN.Props.dynamics.jacobian_sign_pattern(crn: Any, *, tol: float = 1e-12) Tuple[List[Any], ndarray][source]#
synkit.CRN.Props.dynamics.jacobian_sparsity(crn: Any, *, tol: float = 1e-12) Tuple[List[Any], ndarray][source]#
synkit.CRN.Props.dynamics.species_influence_graph(crn: Any, *, tol: float = 1e-12, use_labels: bool = False) DiGraph[source]#
synkit.CRN.Props.dynamics.structural_singularity_summary(crn: Any, *, tol: float = 1e-12, max_exact_size: int = 7, symbol_prefix: str = 'rprime') StructuralSingularitySummary[source]#
synkit.CRN.Props.dynamics.symbolic_jacobian(crn: Any, *, symbol_prefix: str = 'rprime', tol: float = 1e-12) Tuple[List[Any], List[Any], 'sp.Matrix'][source]#
synkit.CRN.Props.dynamics.symbolic_reactivity_matrix(crn: Any, *, symbol_prefix: str = 'rprime', tol: float = 1e-12) Tuple[List[Any], List[Any], 'sp.Matrix'][source]#
class synkit.CRN.Props.stoich.StoichSummary(n_species: int, n_reactions: int, rank: int)[source]#

Bases: object

dim_left_kernel: int#
dim_right_kernel: int#
classmethod from_crn(crn: Any) StoichSummary[source]#
property is_full_rank: bool#
property is_underdetermined: bool#
n_reactions: int#
n_species: int#
rank: int#
to_dict() Dict[str, Any][source]#
synkit.CRN.Props.stoich.build_S(crn: Any) Tuple[List[Any], List[Any], ndarray][source]#
synkit.CRN.Props.stoich.build_S_minus_plus(crn: Any) Tuple[List[Any], List[Any], ndarray, ndarray][source]#
synkit.CRN.Props.stoich.integer_conservation_laws(crn: Any, *, rtol: float = 1e-12) List[List[int]][source]#
synkit.CRN.Props.stoich.left_nullspace(crn: Any, *, rtol: float = 1e-12) ndarray[source]#
synkit.CRN.Props.stoich.left_right_kernels(crn: Any, *, rtol: float = 1e-12) Tuple[ndarray, ndarray][source]#
synkit.CRN.Props.stoich.right_nullspace(crn: Any, *, rtol: float = 1e-12) ndarray[source]#
synkit.CRN.Props.stoich.stoichiometric_matrix(crn: Any) ndarray[source]#
synkit.CRN.Props.stoich.stoichiometric_rank(crn: Any, *, tol: float = 1e-10) int[source]#
synkit.CRN.Props.stoich.summary(crn: Any) StoichSummary[source]#
class synkit.CRN.Props.thermo.ThermoSummary(conservative: bool | None, consistent: bool | None, example_conservation_law: ndarray | None, irreversible_futile_cycles: bool)[source]#

Bases: object

conservative: bool | None#
consistent: bool | None#
example_conservation_law: ndarray | None#
irreversible_futile_cycles: bool#
synkit.CRN.Props.thermo.compute_conservativity(crn: Any, *, rtol: float = 1e-12, eps: float = 1e-08) tuple[bool | None, ndarray | None][source]#
synkit.CRN.Props.thermo.compute_thermo_summary(crn: Any, *, rtol: float = 1e-12, eps: float = 1e-08) ThermoSummary[source]#
synkit.CRN.Props.thermo.has_irreversible_futile_cycles(crn: Any, *, rtol: float = 1e-12) bool[source]#
synkit.CRN.Props.thermo.is_conservative(crn: Any, *, eps: float = 1e-08, rtol: float = 1e-12) bool | None[source]#
synkit.CRN.Props.thermo.is_consistent(crn: Any, *, eps: float = 1e-08) bool | None[source]#
synkit.CRN.Props.thermo.left_nullspace_from_matrix(S: ndarray, *, rtol: float = 1e-12) ndarray[source]#

Query#

class synkit.CRN.Query.kegg_api.KEGGClient(base_url: str = 'https://rest.kegg.jp', timeout: float = 60.0)[source]#

Bases: object

base_url: str#
get_optional_text(path: str) str | None[source]#
get_text(path: str) str[source]#
timeout: float#
class synkit.CRN.Query.kegg_extract.KEGGExtractor(client: KEGGClient | None = None, mapper_cls: type[Any] | None = None)[source]#

Bases: object

atom_map_reactions(reaction_smiles_by_id: Mapping[str, str]) dict[str, str | None][source]#
build_compound_table(compound_ids: list[str]) dict[str, dict[str, Any]][source]#
build_kegg_json(equations_by_rid: dict[str, str | None], *, smiles_by_rid: Mapping[str, str] | None = None, rules_by_rid: Mapping[str, str | None] | None = None, molecules_by_cid: Mapping[str, Mapping[str, Any]] | None = None) dict[str, Any][source]#
build_missing_compound_report(equations_by_rid: dict[str, str | None], compounds_by_cid: Mapping[str, Mapping[str, Any]]) dict[str, Any][source]#
build_module_json(module_id: str, *, with_compounds: bool = True, with_atom_maps: bool = True, save_as: str | None = None) dict[str, Any][source]#
build_pathway_json(pathway_id: str, *, with_compounds: bool = True, with_atom_maps: bool = True, save_as: str | None = None) dict[str, Any][source]#
build_reaction_smiles_dict(parsed_by_rid: Mapping[str, Any], compounds_by_cid: Mapping[str, Mapping[str, Any]]) tuple[dict[str, str], dict[str, dict[str, list[str]]]][source]#
client: KEGGClient | None#
get_compound_molblock(compound_id: str) str | None[source]#
get_compound_name(compound_id: str) str | None[source]#
get_equation_for_reaction(reaction_id: str) str | None[source]#
get_module_equations(module_id: str) dict[str, str | None][source]#
get_modules_from_pathway(pathway_id: str) list[str][source]#
get_pathway_equations(pathway_id: str) dict[str, dict[str, str | None]][source]#
get_reaction_ids_from_module(module_id: str) list[str][source]#
mapper_cls: type[Any] | None#
static save_json(data: Mapping[str, Any], save_as: str | None) None[source]#
class synkit.CRN.Query.kegg_impute.KEGGImputer(extractor: KEGGExtractor | None = None)[source]#

Bases: object

extractor: KEGGExtractor | None = None#
impute_module(module_data: Dict[str, Any], fixes: List[Dict[str, str]], save_as: str | None = None, *, molecule_id_key: str = 'id', reaction_id_key: str = 'id', equation_key: str = 'reaction', reaction_smiles_key: str = 'smiles', reaction_rule_key: str = 'rule') Dict[str, Any][source]#
impute_pathway(pathway_data: Dict[str, Any], fixes: List[Dict[str, str]], save_as: str | None = None, *, molecule_id_key: str = 'id', reaction_id_key: str = 'id', equation_key: str = 'reaction', reaction_smiles_key: str = 'smiles', reaction_rule_key: str = 'rule') Dict[str, Any][source]#
class synkit.CRN.Query.kegg_parse.KEGGEquation(reactants: list[tuple[str, int]], products: list[tuple[str, int]], reversible: bool)[source]#

Bases: object

products: list[tuple[str, int]]#
reactants: list[tuple[str, int]]#
reversible: bool#
synkit.CRN.Query.kegg_parse.equation_to_text(parsed: KEGGEquation, arrow: str | None = None) str[source]#
synkit.CRN.Query.kegg_parse.expand_stoichiometry(items: Sequence[tuple[str, int]]) list[str][source]#
synkit.CRN.Query.kegg_parse.get_compound_ids_from_equations(equations_by_rid: Mapping[str, str | None]) tuple[list[str], dict[str, KEGGEquation]][source]#
synkit.CRN.Query.kegg_parse.get_compound_ids_from_text(text: str) list[str][source]#
synkit.CRN.Query.kegg_parse.molblock_to_smiles(molblock: str | None) str | None[source]#
synkit.CRN.Query.kegg_parse.normalize_module_id(module_id: str) str | None[source]#
synkit.CRN.Query.kegg_parse.orient_equation_to_module(parsed: KEGGEquation, left_ids: list[str], right_ids: list[str]) KEGGEquation[source]#
synkit.CRN.Query.kegg_parse.parse_equation(equation: str) KEGGEquation[source]#
synkit.CRN.Query.kegg_parse.parse_kegg_field_blocks(text: str, field: str) list[str][source]#
synkit.CRN.Query.kegg_parse.parse_module_reaction_directions(text: str) dict[str, tuple[list[str], list[str], str]][source]#
synkit.CRN.Query.kegg_parse.parse_side(side: str) list[tuple[str, int]][source]#
synkit.CRN.Query.kegg_parse.reaction_smiles_from_equation(parsed_equation: KEGGEquation, compounds_by_cid: Mapping[str, Mapping[str, Any]]) tuple[str, dict[str, list[str]]][source]#

Symmetry#

class synkit.CRN.Symmetry.automorphism.CRNAutomorphism(source: Any, *, include_rule: bool = True, include_stoich: bool = True, wl_iters: int = 20, wl_digest_size: int = 16, config: SymmetryConfig | None = None)[source]#

Bases: object

property G: DiGraph#
automorphisms_iter(*, max_count: int | None = None, timeout_sec: float | None = None) Iterator[Dict[Any, Any]][source]#
property graph_type: str#
has_nontrivial_automorphism(*, timeout_sec: float | None = 5.0) bool[source]#
orbits(*, max_count: int = 1000, timeout_sec: float | None = 5.0) List[Set[Any]][source]#
summary(*, max_count: int = 100, timeout_sec: float | None = 5.0) AutomorphismResult[source]#
wl_orbits() List[Set[Any]][source]#
synkit.CRN.Symmetry.automorphism.detect_automorphisms(source: Any, *, max_count: int = 100, timeout_sec: float | None = 5.0, **kwargs: Any) AutomorphismResult[source]#
class synkit.CRN.Symmetry.canon.CRNCanonicalizer(source: Any, *, include_rule: bool = True, include_stoich: bool = True, wl_iters: int = 20, wl_digest_size: int = 16, config: SymmetryConfig | None = None)[source]#

Bases: object

property G: DiGraph#
automorphism_result(*, max_count: int = 100, timeout_sec: float | None = 5.0)[source]#
canonical_graph(*, timeout_sec: float | None = None) DiGraph[source]#
canonical_key(*, timeout_sec: float | None = None)[source]#
canonical_order(*, timeout_sec: float | None = None) List[Any][source]#
canonical_result(*, timeout_sec: float | None = None) CanonicalResult[source]#
property engine: IRCanonicalEngine#
property graph_type: str#
has_nontrivial_automorphism(*, timeout_sec: float | None = 5.0) bool[source]#
orbits(*, max_count: int = 1000, timeout_sec: float | None = 5.0) List[Set[Any]][source]#
summary(*, max_count: int = 100, timeout_sec: float | None = 5.0, include_automorphisms: bool = True) Dict[str, Any][source]#
wl_orbits() List[Set[Any]][source]#
synkit.CRN.Symmetry.canon.canonical(source: Any, **kwargs: Any) DiGraph[source]#
class synkit.CRN.Symmetry.isomorphism.CRNIsomorphism(source: Any, *, include_rule: bool = True, include_stoich: bool = True, wl_iters: int = 20, wl_digest_size: int = 16, config: SymmetryConfig | None = None)[source]#

Bases: object

property G: DiGraph#
property graph_type: str#
isomorphic_to(other: CRNIsomorphism) IsomorphismResult[source]#
subgraph_isomorphic_to(host: CRNIsomorphism) IsomorphismResult[source]#
synkit.CRN.Symmetry.isomorphism.are_isomorphic(a: Any, b: Any, **kwargs: Any) bool[source]#
synkit.CRN.Symmetry.isomorphism.are_subhypergraph_isomorphic(pattern: Any, host: Any, **kwargs: Any) bool[source]#
class synkit.CRN.Symmetry.symmetry.CRNSymmetry(source: Any, *, include_rule: bool = True, include_stoich: bool = True, wl_iters: int = 20, wl_digest_size: int = 16, config: SymmetryConfig | None = None)[source]#

Bases: object

automorphism_summary(**kwargs: Any)[source]#
canonical_graph(**kwargs: Any)[source]#
canonical_result(**kwargs: Any)[source]#
has_nontrivial_automorphism(**kwargs: Any)[source]#
orbits(**kwargs: Any)[source]#
wl_orbits()[source]#
class synkit.CRN.Symmetry.wl_canon.WLCanonicalResult(canon_graph: DiGraph, graph_type: str, canonical_order: List[Any], canonical_key: Any, automorphism_count: int | None, orbits: List[Set[Any]], colors: Dict[Any, str], color_hist: Dict[str, int], iters_run: int, stabilized: bool, exact: bool, elapsed_seconds: float)[source]#

Bases: object

automorphism_count: int | None#
canon_graph: DiGraph#
canonical_key: Any#
canonical_order: List[Any]#
color_hist: Dict[str, int]#
colors: Dict[Any, str]#
elapsed_seconds: float#
exact: bool#
graph_type: str#
iters_run: int#
orbits: List[Set[Any]]#
stabilized: bool#
class synkit.CRN.Symmetry.wl_canon.WLCanonicalizer(source: Any, *, include_rule: bool = True, include_stoich: bool = True, n_iter: int = 20, digest_size: int = 16, include_in_neighbors: bool = True, include_out_neighbors: bool = True, estimate_automorphisms: bool = True, automorphism_cap: int = 1000000000000000000, config: SymmetryConfig | None = None)[source]#

Bases: object

property G: DiGraph#
canonical_graph() DiGraph[source]#
canonical_key() Any[source]#
canonical_order() List[Any][source]#
canonical_result() WLCanonicalResult[source]#
color_of(v: Any) str[source]#
colors() Dict[Any, str][source]#
fast_signature() Tuple[Any, ...][source]#
graph() DiGraph[source]#
property graph_type: str#
has_nontrivial_automorphism() bool[source]#
orbits() List[Set[Any]][source]#
summary() Dict[str, Any][source]#
wl_orbits() List[Set[Any]][source]#
synkit.CRN.Symmetry.wl_canon.wl_canonical(source: Any, **kwargs: Any) DiGraph[source]#

Visualization#

class synkit.CRN.Visualize.crn_vis.CRNVis(graph: DiGraph, layout: str = 'bipartite', species_label: str = 'index', rule_label: str = 'name', font_size: int = 6)[source]#

Bases: object

draw(ax: 'matplotlib.axes.Axes' | None = None, show: bool = False)[source]#
font_size: int = 6#
graph: DiGraph#
layout: str = 'bipartite'#
rule_label: str = 'name'#
species_label: str = 'index'#
synkit.CRN.Visualize.labels.build_edge_labels(graph: DiGraph, *, mode: str = 'none', max_chars: int | None = 20) Dict[tuple[Hashable, Hashable], str][source]#
synkit.CRN.Visualize.labels.build_node_labels(graph: DiGraph, *, species_nodes: Iterable[Hashable], rule_nodes: Iterable[Hashable], species_label: str = 'label', rule_label: str = 'label', show_species_labels: bool = True, show_rule_labels: bool = True, max_chars: int | None = 32, wrap_at: int | None = None) Dict[Hashable, str][source]#
synkit.CRN.Visualize.layout.available_layouts() List[str][source]#
synkit.CRN.Visualize.layout.bipartite_layout(graph: DiGraph, *, species_nodes: List[Hashable], rule_nodes: List[Hashable], node_spacing: float = 1.4, layer_spacing: float = 3.0, orientation: str = 'vertical') Dict[Hashable, Tuple[float, float]][source]#
synkit.CRN.Visualize.layout.choose_auto_layout(graph: DiGraph, *, species_nodes: List[Hashable], rule_nodes: List[Hashable]) str[source]#
synkit.CRN.Visualize.layout.circular_bipartite_layout(graph: DiGraph, *, species_nodes: List[Hashable], rule_nodes: List[Hashable], species_radius: float = 2.5, rule_radius: float = 4.0) Dict[Hashable, Tuple[float, float]][source]#
synkit.CRN.Visualize.layout.compute_layout(graph: DiGraph, *, species_nodes: List[Hashable], rule_nodes: List[Hashable], layout: str = 'step', node_spacing: float = 1.4, layer_spacing: float = 2.5, seed: int = 0, orientation: str = 'vertical') Dict[Hashable, Tuple[float, float]][source]#
synkit.CRN.Visualize.layout.degree_shell_layout(graph: DiGraph, *, species_nodes: List[Hashable], rule_nodes: List[Hashable]) Dict[Hashable, Tuple[float, float]][source]#
synkit.CRN.Visualize.layout.multipartite_step_layout(graph: DiGraph, *, species_nodes: List[Hashable], rule_nodes: List[Hashable]) Dict[Hashable, Tuple[float, float]][source]#
synkit.CRN.Visualize.layout.radial_step_layout(graph: DiGraph, *, species_nodes: List[Hashable], rule_nodes: List[Hashable], radius_step: float = 1.8) Dict[Hashable, Tuple[float, float]][source]#
synkit.CRN.Visualize.layout.step_layout(graph: DiGraph, *, species_nodes: List[Hashable], rule_nodes: List[Hashable], node_spacing: float = 1.4, layer_spacing: float = 2.5) Dict[Hashable, Tuple[float, float]][source]#
class synkit.CRN.Visualize.palette.ColorPalette(background: str, species_fill: str, species_edge: str, rule_fill: str, rule_edge: str, reactant_edge: str, product_edge: str, other_edge: str, highlight_node: str, highlight_edge: str, label_text: str, node_index_text: str, legend_text: str, title_text: str)[source]#

Bases: object

background: str#
highlight_edge: str#
highlight_node: str#
label_text: str#
legend_text: str#
node_index_text: str#
other_edge: str#
product_edge: str#
reactant_edge: str#
rule_edge: str#
rule_fill: str#
species_edge: str#
species_fill: str#
title_text: str#
with_overrides(**kwargs) ColorPalette[source]#
synkit.CRN.Visualize.palette.get_palette(name: str = 'paper_sage', **overrides) ColorPalette[source]#
synkit.CRN.Visualize.palette.palette_names() list[str][source]#
class synkit.CRN.Visualize.validation.CRNGraphInfo(species_nodes: 'List[Hashable]', rule_nodes: 'List[Hashable]', is_dag: 'bool')[source]#

Bases: object

is_dag: bool#
rule_nodes: List[Hashable]#
species_nodes: List[Hashable]#
synkit.CRN.Visualize.validation.node_sort_key(graph: DiGraph, node: Hashable)[source]#
synkit.CRN.Visualize.validation.validate_crn_graph(graph: DiGraph, *, strict: bool = True) CRNGraphInfo[source]#
class synkit.CRN.Visualize.vis.CRNStyle(figsize: Tuple[float, float] = (12.0, 7.0), species_node_shape: str = 'o', rule_node_shape: str = 's', species_node_size: int = 760, rule_node_size: int = 540, edge_width: float = 1.2, highlight_edge_width: float = 2.1, reactant_style: str = 'dashed', product_style: str = 'solid', other_style: str = 'solid', arrows: bool = True, arrowstyle: str = '-|>', arrowsize: int = 12, font_size: int = 8, alpha: float = 0.98, margins: float = 0.12, show_label_boxes: bool = False, label_box_alpha: float = 0.0, curved_edges: bool = False, curve_radius: float = 0.0, scale_edge_width_by_stoich: bool = True, stoich_width_factor: float = 0.4, linewidths: float = 1.0, highlight_linewidths: float = 1.6, edge_alpha: float = 0.9, node_alpha: float = 1.0, show_node_outline: bool = True, label_fontweight: str = 'regular', auto_reduce_labels_when_dense: bool = True, dense_node_threshold: int = 45, dense_edge_threshold: int = 70, dense_font_size: int = 7)[source]#

Bases: object

alpha: float = 0.98#
arrows: bool = True#
arrowsize: int = 12#
arrowstyle: str = '-|>'#
auto_reduce_labels_when_dense: bool = True#
curve_radius: float = 0.0#
curved_edges: bool = False#
dense_edge_threshold: int = 70#
dense_font_size: int = 7#
dense_node_threshold: int = 45#
edge_alpha: float = 0.9#
edge_width: float = 1.2#
figsize: Tuple[float, float] = (12.0, 7.0)#
font_size: int = 8#
highlight_edge_width: float = 2.1#
highlight_linewidths: float = 1.6#
label_box_alpha: float = 0.0#
label_fontweight: str = 'regular'#
linewidths: float = 1.0#
margins: float = 0.12#
node_alpha: float = 1.0#
other_style: str = 'solid'#
product_style: str = 'solid'#
reactant_style: str = 'dashed'#
rule_node_shape: str = 's'#
rule_node_size: int = 540#
scale_edge_width_by_stoich: bool = True#
show_label_boxes: bool = False#
show_node_outline: bool = True#
species_node_shape: str = 'o'#
species_node_size: int = 760#
stoich_width_factor: float = 0.4#
class synkit.CRN.Visualize.vis.CRNVis(graph: DiGraph, layout: str = 'auto', species_label: str = 'label', rule_label: str = 'label', show_species_labels: bool = True, show_rule_labels: bool = True, font_size: int | None = None, max_label_chars: int | None = 28, wrap_label_at: int | None = None, style: CRNStyle = <factory>, palette: ColorPalette | str = 'nature_journal', palette_overrides: dict[str, str] | None=None, rule_color_mode: str = 'palette', rule_color_attr: str | None = None, rule_cmap: str = 'Greys', species_color_mode: str = 'palette', species_color_attr: str | None = None, species_cmap: str = 'Greys', node_color_overrides: Hashable, str] | None=None, node_spacing: float = 1.35, layer_spacing: float = 2.5, orientation: str = 'vertical', seed: int = 0, strict: bool = True)[source]#

Bases: object

dense_graph() bool[source]#
draw(ax: Any = None, *, title: str | None = None, show: bool = False, with_legend: bool = True, edge_label_mode: str = 'none', highlight_nodes: Iterable[Hashable] | None = None, highlight_edges: Iterable[Tuple[Hashable, Hashable]] | None = None, highlight_cycles: bool = False, hide_axis: bool = True, auto_align_dense: bool = False) tuple[Any, Any, dict[Hashable, tuple[float, float]]][source]#
edge_labels(*, mode: str = 'none') dict[tuple[Hashable, Hashable], str][source]#
font_size: int | None = None#
graph: DiGraph#
property is_dag: bool#
layer_spacing: float = 2.5#
layout: str = 'auto'#
max_label_chars: int | None = 28#
node_color_overrides: Mapping[Hashable, str] | None = None#
node_labels() dict[Hashable, str][source]#
node_spacing: float = 1.35#
orientation: str = 'vertical'#
palette: ColorPalette | str = 'nature_journal'#
palette_overrides: dict[str, str] | None = None#
positions() dict[Hashable, tuple[float, float]][source]#
rule_cmap: str = 'Greys'#
rule_color_attr: str | None = None#
rule_color_mode: str = 'palette'#
rule_label: str = 'label'#
property rule_nodes: list[Hashable]#
save(path: str | Path, *, dpi: int = 300, bbox_inches: str = 'tight', **draw_kwargs: Any) Path[source]#
seed: int = 0#
show_rule_labels: bool = True#
show_species_labels: bool = True#
species_cmap: str = 'Greys'#
species_color_attr: str | None = None#
species_color_mode: str = 'palette'#
species_label: str = 'label'#
property species_nodes: list[Hashable]#
strict: bool = True#
strongly_connected_species() list[set[Hashable]][source]#
style: CRNStyle#
subgraph(nodes: Iterable[Hashable]) CRNVis[source]#
wrap_label_at: int | None = None#
synkit.CRN.Visualize.vis.draw_crn(graph: DiGraph, **kwargs: Any) tuple[Any, Any, dict[Hashable, tuple[float, float]]][source]#