corneto.methods.signaling.CellNOptDAG#

class corneto.methods.signaling.CellNOptDAG(lambda_reg=0.001, max_flow=None, epsilon=1.0, backend=None)#

Bases: FlowMethod

Infer a shared acyclic Boolean model from multiple conditions.

The method selects reactions globally and evaluates their Boolean truth in every condition. A single nonnegative flow has exactly the selected reaction dependencies as its internal support. Conservation, positive support, and acyclicity therefore require every selected dependency to lie on a path from a controlled input or inhibitor to a measured output.

Dummy vertices named AND<number> are compiled into one reaction per product. All operands of such a reaction share one selection variable and are evaluated conjunctively.

Parameters:
  • lambda_reg (float) – Penalty for every selected reaction.

  • max_flow (Optional[float]) – Upper bound for structural flow. By default, the number of compiled dependency edges is used.

  • epsilon (float) – Minimum flow on every selected dependency edge.

  • backend (Optional[Backend]) – Optimization backend.

__init__(lambda_reg=0.001, max_flow=None, epsilon=1.0, backend=None)#
Parameters:

Methods

__init__([lambda_reg, max_flow, epsilon, ...])

build(pkn, *, inputs, measurements[, inhibitors])

Build a single-condition CellNOpt problem.

build_from_data(graph[, data])

Build the complete optimization problem.

build_many(pkn, *, inputs, measurements[, ...])

Build a problem for multiple named experimental conditions.

create_flow_based_problem(flow_problem, ...)

Add vectorized Boolean propagation and shared-flow selection.

create_problem(graph, data)

Create the optimization problem using a flow-based formulation.

description()

Return a short method description.

evaluate(*, inputs, measurements[, inhibitors])

Compare fixed-model predictions with supplied Boolean measurements.

fit(pkn, *, inputs, measurements[, ...])

Build and solve a shared Boolean model, returning self.

get_flow_bounds(graph, data)

Return bounds for the single shared structural flow.

get_selected_reaction_indices([threshold])

Return indices of reactions in the fixed solved model.

name()

Return the method name.

predict(*, inputs[, inhibitors])

Predict conditions from the fixed selected reactions.

preprocess(graph, data)

Compile reactions, validate condition data, and add flow boundaries.

references()

Returns citation keys for this method.

show_bibtex()

Display raw BibTeX entries in a formatted block for easy copying.

show_references()

Display formatted citations in a Jupyter notebook.

Attributes

backend

Return the optimization backend being used.

build(pkn, *, inputs, measurements, inhibitors=None)#

Build a single-condition CellNOpt problem.

Parameters:

pkn (BaseGraph)

Return type:

ProblemDef

build_many(pkn, *, inputs, measurements, inhibitors=None)#

Build a problem for multiple named experimental conditions.

Parameters:

pkn (BaseGraph)

Return type:

ProblemDef

fit(pkn, *, inputs, measurements, inhibitors=None, solve_options=None, **solver_options)#

Build and solve a shared Boolean model, returning self.

Scientific arguments intentionally mirror build_many; backend options belong in solve_options (or can be supplied as solver keyword arguments). The solved problem remains available for adding constraints and inspecting expressions. Time-limited incumbents are accepted when they include finite reaction selections.

Parameters:
Return type:

CellNOptDAG

preprocess(graph, data)#

Compile reactions, validate condition data, and add flow boundaries.

Parameters:
get_flow_bounds(graph, data)#

Return bounds for the single shared structural flow.

Parameters:
create_flow_based_problem(flow_problem, graph, data)#

Add vectorized Boolean propagation and shared-flow selection.

Parameters:
Return type:

ProblemDef

get_selected_reaction_indices(threshold=0.5)#

Return indices of reactions in the fixed solved model.

Parameters:

threshold (float)

Return type:

ndarray

predict(*, inputs, inhibitors=None)#

Predict conditions from the fixed selected reactions.

Inputs and active inhibitors are clamped exactly as during training; every other species is the OR of its active selected reactions, whose literals are evaluated in a topological order. Held-out measurements are not accepted or consulted, and prediction never invokes a solver.

Return type:

Data

evaluate(*, inputs, measurements, inhibitors=None)#

Compare fixed-model predictions with supplied Boolean measurements.

Return type:

dict[str, Any]

static name()#

Return the method name.

Return type:

str

static description()#

Return a short method description.

Return type:

str