pydruglogics.model.BooleanModel
A Boolean network model with support for mutation, attractor calculation, perturbations, and input/output conversion.
- BooleanModel.calculate_attractors(attractor_tool, attractor_type)
Calculate attractors based on the chosen attractor_tool and attractor_type.
Parameters
attractor_tool (str)
: Tool for attractor calculation. Possible values:'mpbn'
,'pyboolnet'
.attractor_type (str)
: Type of attractor. Possible values:'stable_states'
,'trapspaces'
.
- BooleanModel.calculate_global_output(model_outputs, normalized=True)
Calculates the (normalized) global output of the model.
Parameters
model_outputs (ModelOutputs)
: Node weights.normalized (bool, optional)
: Whether to normalize. Default: True.
Returns
float: The (normalized) global output.
- BooleanModel.from_binary(binary_representation, mutation_type)
Updates the Boolean Equations from a binary representation.
Parameters
binary_representation (list)
: The binary representation of the Boolean Equations.mutation_type (str)
: Mutation type:'topology'
,'balanced'
, or'mixed'
.
Returns
list: Updated Boolean Equations.
- BooleanModel.to_binary(mutation_type)
Converts the Boolean Equations to a binary representation.
Parameters
mutation_type (str)
: The type of mutation.
Returns
list: Binary representation of Boolean Equations.
- BooleanModel.add_perturbations(perturbations)
Adds perturbations to the Boolean Model.
Parameters
perturbations (list)
: List of perturbations.
- BooleanModel.print()
Print all Boolean equations as readable logic statements.
- BooleanModel.clone()
Return a deep copy of the BooleanModel instance.
- BooleanModel.reset_attractors()
Reset the attractor list.
- BooleanModel.has_attractors()
Return True if attractors have been found.
- BooleanModel.has_stable_states()
Return True if stable states exist.
- BooleanModel.has_global_output()
Return True if the model has a computed global output.
- BooleanModel.get_stable_states()
Return only the stable states from the attractors.
- BooleanModel.model_name
Get or set the model name.
- BooleanModel.boolean_equations
Get or set the model’s Boolean equations.
- BooleanModel.binary_boolean_equations
Get or set the model’s binary Boolean equations.
- BooleanModel.mutation_type
The type of mutation used for the model.
- BooleanModel.global_output
The current global output value.
- BooleanModel.attractors
The current list of attractors.
- BooleanModel.attractor_tool
The tool used for attractor calculation.
- BooleanModel.attractor_type
The type of attractor calculation.