pydruglogics.model.BooleanModel module
- class pydruglogics.model.BooleanModel.BooleanModel(model=None, file=None, attractor_tool='mpbn', attractor_type='stable_states', mutation_type='topology', model_name='', cloned_equations=None, cloned_binary_equations=None)
Bases:
object
Initializes the BooleanModel instance. :param model: An InteractionModel instance. :param file: The path to the file containing Boolean Equations in ‘.bnet’ format. :param attractor_tool: The tool to be used for attractor calculation. Possible values: ‘mpbn’, ‘pyboolnet’. :param attractor_type: The type of the attractor calculation. Possible values: ‘stable_states’, ‘trapspaces’. :param mutation_type: The type of mutation to be performed. Possible values: ‘topology’, ‘binary’, ‘balanced’. :param model_name: Name for the model. :param cloned_equations: Boolean Equations representing the model’s interactions. (only for cloning) :param cloned_binary_equations: A list representing the Mutate Boolean Model in binary representation. (only for cloning)
- add_perturbations(perturbations)
Adds perturbations to the Boolean Model. :param perturbations: A list of Perturbations. :return: None
- property attractor_tool: str
- property attractor_type: str
- property attractors: object
- property binary_boolean_equations
- property boolean_equations
- calculate_attractors(attractor_tool, attractor_type) None
Calculate attractors based on the chosen attractor_tool and attractor_type. :param attractor_tool: Tool for attractor calculation. Possible values: ‘mpbn’, ‘pyboolnet’. :param attractor_type: Type of attractor. Possible values: ‘stable_states’, ‘trapspaces’. :return: None
- calculate_global_output(model_outputs, normalized=True)
Calculates the (normalized) global output of the model. :param model_outputs: An instance containing node weights defined in the ModelOutputs class. :param normalized: Whether to normalize the global output. :return: float
- clone()
- from_binary(binary_representation, mutation_type: str)
Updates the Boolean Equations from a binary representation based on the mutation type. :param binary_representation: The binary representation of the Boolean Equations as a list. :param mutation_type: The type of mutation can be: ‘topology’, ‘balanced’, ‘mixed’. :return: Updated Boolean Equations as a list.
- get_stable_states() object
- property global_output
- has_attractors() bool
- has_global_output() bool
- has_stable_states() bool
- property model_name: str
- property mutation_type: str
- print()
- reset_attractors() None
- to_binary(mutation_type: str)
Converts the Boolean Equations to a binary representation. The representation is based on the mutation type. :param mutation_type: The type of mutation can be: ‘topology’, ‘balanced’, ‘mixed’ :return: The binary representation of the Boolean Equations as a list.