BNMPy.BMatrix

Resources for loading boolean networks from files (strings)

BNMPy.BMatrix.get_equations(file)[source]
BNMPy.BMatrix.get_gene_dict(equations)[source]
BNMPy.BMatrix.get_upstream_genes(equations)[source]

Returns a string of gene names, space-separated, for each of the equations.

BNMPy.BMatrix.get_connectivity_matrix(equations, upstream_genes, gene_dict)[source]
BNMPy.BMatrix.get_truth_table(equations, upstream_genes, show_functions=None)[source]
BNMPy.BMatrix.get_mutation_dict(file)[source]
BNMPy.BMatrix.get_knocking_genes(profile, mutation_dict, connectivity_matrix, gene_dict, perturbed_genes=None, perturbed_dict=None)[source]
BNMPy.BMatrix.get_cal_upstream_genes(equations)[source]
BNMPy.BMatrix.get_cal_functions(equations)[source]
BNMPy.BMatrix.get_calculating_scores(network_traj, cal_functions, cal_upstream_genes, gene_dict, cal_range=None, scores_dict=None, title=None)[source]
BNMPy.BMatrix.load_network_from_file(filename, initial_state=None)[source]

Given a file representing a boolean network, this generates a BooleanNetwork object.

Formatting:

gene = equation

  • all genes must have their own equation in a line (sometimes the equation is just A = A)

  • each equation must have an equal sign and a space before and after it

  • If the equation is a constant value (0 or 1), meaning that the gene is set as mutated/perturbed

BNMPy.BMatrix.load_network_from_string(network_string, initial_state=None)[source]

Given a string representing a boolean network, this generates a BooleanNetwork object.

Formatting:

  • all genes must have their own equation (sometimes the equation is just A = A)

  • each equation must have an equal sign and a space before and after it

  • If the equation is a constant value (0 or 1), meaning that the gene is set as mutated/perturbed

BNMPy.BMatrix.load_pbn_from_file(filename, initial_state=None)[source]

Given a file representing a probabilistic boolean network, this generates a ProbabilisticBN object.

File format example:

x1 = (x1 | x2 | x3) & (!x1 | x2 | x3), 0.6
x1 = (x1 | x2 | x3) & (x1 | !x2 | !x3) & (!x1 | x2 | x3), 0.4
x2 = (x1 | x2 | x3) & (x1 | !x2 | !x3) & (!x1 | !x2 | x3)
x3 = (!x1 & x2 & x3) | (x1 & !x2 & x3) | (x1 & x2 & !x3) | (x1 & x2 & x3), 0.5
x3 = (x1 & x2 & x3), 0.5

Each line has format: node = boolean_function, probability The probability part can be omitted if there is only one function for that gene. The boolean_function can also be a constant value (0 or 1), meaning that the gene is set as mutated/perturbed

BNMPy.BMatrix.load_pbn_from_string(network_string, initial_state=None)[source]

Given a string representing a probabilistic boolean network, this generates a ProbabilisticBN object.

String format should match the file format expected by load_pbn_from_file.

BNMPy.BMatrix.rename_nodes(network, mapping, expand_complexes=False)[source]

Rename nodes in a boolean network based on a mapping.