corneto.methods.future.CarnivalFlow#

class corneto.methods.future.CarnivalFlow(lambda_reg=0.0, exclusive_signal_paths=True, vertex_lb_dist=None, max_flow=1000, enable_bfs_heuristic=True, data_type_key='role', data_input_key='input', data_output_key='output', backend=None)#

Bases: FlowMethod

Flow-base, multi-sample CARNIVAL method for intracellular signaling.

Implements multi-sample intracellular network inference using an extension of the CARNIVAL method to model signal propagation.

Parameters:
  • exclusive_signal_paths – Whether proteins cannot be simultaneously activated/inhibited through different paths. Default: True

  • lambda_reg – Regularization for edge signals across samples. Higher values give sparser solutions. Default: 0.0

  • max_flow – Upper limit on the flow. It relates to the maximum number of branches in the signaling tree. Minimum value is 1. Reducing this number decreases the size of the solutions. Decrease it to reduce the solution space size and increase optimization speed. Default: 1000.

  • enable_bfs_heuristic – Use BFS heuristic to strengthen acyclicity constraints. Default: True

  • backend (Backend | None) – Optimization backend to use. Default: None

__init__(lambda_reg=0.0, exclusive_signal_paths=True, vertex_lb_dist=None, max_flow=1000, enable_bfs_heuristic=True, data_type_key='role', data_input_key='input', data_output_key='output', backend=None)#
Parameters:

backend (Backend | None)

Methods

__init__([lambda_reg, ...])

build(graph, data)

Build the complete optimization problem.

create_flow_based_problem(flow_problem, ...)

Create the optimization problem with flow-based constraints.

create_problem(graph, data)

Create the optimization problem using a flow-based formulation.

get_citations()

Returns citation keys for this method.

get_flow_bounds(graph, data)

Get the flow bounds and parameters for creating a flow problem.

preprocess(graph, data)

Preprocess the input graph and dataset before optimization.

show_bibtex()

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

show_citations()

Display formatted citations in a Jupyter notebook.

Attributes

backend

Return the optimization backend being used.

preprocess(graph, data)#

Preprocess the input graph and dataset before optimization.

This method performs two main preprocessing steps: 1. Prunes the graph based on the input conditions to remove irrelevant vertices 2. Expands the graph to accommodate flow-based constraints

Parameters:
  • graph (BaseGraph) – The input network graph to be processed

  • data (Dataset) – The experimental dataset containing input and output measurements

Returns:

A tuple containing:
  • The preprocessed graph with expanded flow capabilities

  • The preprocessed dataset with standardized format

Return type:

Tuple[BaseGraph, Dataset]

create_flow_based_problem(flow_problem, graph, data)#

Create the optimization problem with flow-based constraints.

Sets up an integer linear programming problem by: 1. Creating binary variables for edge activations and inhibitions. 2. Defining signal propagation constraints. 3. Enforcing acyclic signal flow. 4. Incorporating experimental measurements into the objective.

Parameters:
  • flow_problem – The base optimization problem to build upon.

  • graph (BaseGraph) – The preprocessed network graph.

  • data (Data) – The experimental dataset.

Returns:

The configured optimization problem.

static get_citations()#

Returns citation keys for this method.

Returns:

A list of citation keys that can be used to lookup BibTeX entries.