from pathlib import Path
from pandas import DataFrame
from biodivine_aeon import *
model = BooleanNetwork.from_sbml(Path('interferon-pathway.sbml').read_text())
graph = SymbolicAsyncGraph(model)
attractors = find_attractors(graph)
print("Attractor set count:", len(attractors))
attrStates = graph.empty_colored_vertices();
for attr in attractors:
attrStates = attrStates.union(attr)
print("Unique attr. states:", attrStates.vertices().cardinality())
IIR = graph.fix_variable("ISG_expression_antiviral_response_phenotype", True)
INFL = graph.fix_variable("Proinflammatory_cytokine_expression_Inflammation_phenotype", True)
IFN = graph.fix_variable("type_I_IFN_response_phenotype", True)
attrIIR = attrStates.intersect(IIR)
attrINFL = attrStates.intersect(INFL)
attrIFN = attrStates.intersect(IFN)
print("IIR phenotype colors:", attrIIR.colors().cardinality())
print("INFL phenotype colors:", attrINFL.colors().cardinality())
print("IFN phenotype colors:", attrIFN.colors().cardinality())
Attractor set count: 4
Unique attr. states: 1.6886299569553408e+16
IIR phenotype colors: 6756498952683520.0
INFL phenotype colors: 2251947990056960.0
IFN phenotype colors: 0.0
def phenotype_ratio(attr, phenotype):
return attr.intersect(phenotype).colors().cardinality() / attr.colors().cardinality()
def check_impact(attr, param, phenotype):
attr_param_on = attr.intersect(param)
attr_param_off = attr.minus(param)
ratio_on = phenotype_ratio(attr_param_on, phenotype)
ratio_off = phenotype_ratio(attr_param_off, phenotype)
return (ratio_on - ratio_off) * 100.0
rg = model.graph()
table = []
for var in model.variables():
if len(rg.regulators(var)) == 0:
iir_impact = check_impact(attrStates, graph.fix_variable(var, True), IIR)
infl_impact = check_impact(attrStates, graph.fix_variable(var, True), INFL)
print("Impact of", rg.get_variable_name(var)+":", iir_impact, "(IIR)", infl_impact, "(INFL)")
table.append([rg.get_variable_name(var), iir_impact, infl_impact])
DataFrame(table, columns=["Variable", "IIR gain", "INFL gain"])
Impact of Azithromycin_drug: 49.9755859375 (IIR) 0.0010013580322265625 (INFL)
Impact of E: 0.0 (IIR) 49.99890327453613 (INFL)
Impact of FOS: 0.0 (IIR) 0.0 (INFL)
Impact of GRL0617_drug: 0.0 (IIR) 0.0 (INFL)
Impact of IFNAR_complex: 0.0 (IIR) 0.0 (INFL)
Impact of IKKa: 0.0 (IIR) 0.0032901763916015625 (INFL)
Impact of IKKb: 0.0 (IIR) 0.0032901763916015625 (INFL)
Impact of IRAK1_4: 0.0 (IIR) 0.0032901763916015625 (INFL)
Impact of IRF9: 0.0244140625 (IIR) 0.0 (INFL)
Impact of IkB: 0.0 (IIR) 0.0032901763916015625 (INFL)
Impact of JAK1: 0.0 (IIR) 0.0 (INFL)
Impact of JUN: 0.0 (IIR) 0.0 (INFL)
Impact of M: -0.0244140625 (IIR) 0.0 (INFL)
Impact of MAPK14: 0.0 (IIR) 0.0 (INFL)
Impact of MAPK8: 0.0 (IIR) 0.0 (INFL)
Impact of MNS_drug: 0.0 (IIR) -49.99890327453613 (INFL)
Impact of MYD88: 0.0 (IIR) 0.0032901763916015625 (INFL)
Impact of N: 0.0 (IIR) 0.0 (INFL)
Impact of NEMO: 0.0 (IIR) 0.0032901763916015625 (INFL)
Impact of NFKB1: 0.0 (IIR) 0.0032901763916015625 (INFL)
Impact of Nsp1: -0.0244140625 (IIR) 0.0 (INFL)
Impact of Nsp10: 0.0 (IIR) 0.0 (INFL)
Impact of Nsp13: -0.0244140625 (IIR) 0.0 (INFL)
Impact of Nsp14: 0.0 (IIR) 0.0 (INFL)
Impact of Nsp15: 0.0 (IIR) 0.0 (INFL)
Impact of Nsp16: 0.0 (IIR) 0.0 (INFL)
Impact of Nsp3: -49.9755859375 (IIR) -0.0032901763916015625 (INFL)
Impact of Nsp5: -0.0244140625 (IIR) 0.0 (INFL)
Impact of Nsp6: -0.0244140625 (IIR) 0.0 (INFL)
Impact of Orf3a: -0.0244140625 (IIR) 0.0 (INFL)
Impact of Orf6: -0.0244140625 (IIR) 0.0 (INFL)
Impact of Orf7a: -0.0244140625 (IIR) 0.0 (INFL)
Impact of Orf7b: -0.0244140625 (IIR) 0.0 (INFL)
Impact of Orf8_complex: 0.0 (IIR) 0.0 (INFL)
Impact of Orf9b: 0.0 (IIR) -0.0032901763916015625 (INFL)
Impact of RELA: 0.0 (IIR) 0.0032901763916015625 (INFL)
Impact of RIP1: 0.0 (IIR) 0.0032901763916015625 (INFL)
Impact of RNF135: 0.0 (IIR) 0.0 (INFL)
Impact of TAB1: 0.0 (IIR) 0.0032901763916015625 (INFL)
Impact of TAB2: 0.0 (IIR) 0.0032901763916015625 (INFL)
Impact of TAK1: 0.0 (IIR) 0.0032901763916015625 (INFL)
Impact of TANK: 0.0 (IIR) 0.0 (INFL)
Impact of TLR7: 0.0 (IIR) 0.0001430511474609375 (INFL)
Impact of TLR9: 0.0 (IIR) 0.0001430511474609375 (INFL)
Impact of TREML4: 0.0244140625 (IIR) 0.0001430511474609375 (INFL)
Impact of TRIF: 0.0 (IIR) 0.0032901763916015625 (INFL)
Impact of TRIM25: 0.0 (IIR) 0.0 (INFL)
Impact of TYK2: 0.0 (IIR) 0.0 (INFL)
Impact of Viral_dsRNA_rna_endosome: 0.0 (IIR) 0.0012874603271484375 (INFL)
Impact of Viral_replication_phenotype: 0.0 (IIR) 0.0 (INFL)
Impact of pp1ab: 0.0 (IIR) 0.0 (INFL)
Impact of sa3_IFNB1_extracellular_space: 0.0 (IIR) 0.0 (INFL)
Impact of sa5_IFNA1_extracellular_space: 0.0 (IIR) 0.0 (INFL)
Variableobject
Azithromycin_drug1.9%
E1.9%
51 others96.2%
IIR gainfloat64
-49.9755859375 - 49.9755859375
0
Azithromycin_drug
49.97558594
1
E
0
2
FOS
0
3
GRL0617_drug
0
4
IFNAR_complex
0
5
IKKa
0
6
IKKb
0
7
IRAK1_4
0
8
IRF9
0.0244140625
9
IkB
0
virus_detected = graph.fix_variable("Viral_replication_phenotype", True)
states_virus_on = attrStates.intersect(virus_detected)
table2 = []
for var in model.variables():
if rg.get_variable_name(var) == 'Viral_replication_phenotype':
continue
if len(rg.regulators(var)) == 0:
iir_impact = check_impact(states_virus_on, graph.fix_variable(var, True), IIR)
infl_impact = check_impact(states_virus_on, graph.fix_variable(var, True), INFL)
print("Impact of", rg.get_variable_name(var)+":", iir_impact, "(IIR)", infl_impact, "(INFL)")
table2.append([rg.get_variable_name(var), iir_impact, infl_impact])
DataFrame(table2, columns=["Variable", "IIR gain", "INFL gain"])
Impact of Azithromycin_drug: 49.9755859375 (IIR) 0.0010013580322265625 (INFL)
Impact of E: 0.0 (IIR) 49.99890327453613 (INFL)
Impact of FOS: 0.0 (IIR) 0.0 (INFL)
Impact of GRL0617_drug: 0.0 (IIR) 0.0 (INFL)
Impact of IFNAR_complex: 0.0 (IIR) 0.0 (INFL)
Impact of IKKa: 0.0 (IIR) 0.0032901763916015625 (INFL)
Impact of IKKb: 0.0 (IIR) 0.0032901763916015625 (INFL)
Impact of IRAK1_4: 0.0 (IIR) 0.0032901763916015625 (INFL)
Impact of IRF9: 0.0244140625 (IIR) 0.0 (INFL)
Impact of IkB: 0.0 (IIR) 0.0032901763916015625 (INFL)
Impact of JAK1: 0.0 (IIR) 0.0 (INFL)
Impact of JUN: 0.0 (IIR) 0.0 (INFL)
Impact of M: -0.0244140625 (IIR) 0.0 (INFL)
Impact of MAPK14: 0.0 (IIR) 0.0 (INFL)
Impact of MAPK8: 0.0 (IIR) 0.0 (INFL)
Impact of MNS_drug: 0.0 (IIR) -49.99890327453613 (INFL)
Impact of MYD88: 0.0 (IIR) 0.0032901763916015625 (INFL)
Impact of N: 0.0 (IIR) 0.0 (INFL)
Impact of NEMO: 0.0 (IIR) 0.0032901763916015625 (INFL)
Impact of NFKB1: 0.0 (IIR) 0.0032901763916015625 (INFL)
Impact of Nsp1: -0.0244140625 (IIR) 0.0 (INFL)
Impact of Nsp10: 0.0 (IIR) 0.0 (INFL)
Impact of Nsp13: -0.0244140625 (IIR) 0.0 (INFL)
Impact of Nsp14: 0.0 (IIR) 0.0 (INFL)
Impact of Nsp15: 0.0 (IIR) 0.0 (INFL)
Impact of Nsp16: 0.0 (IIR) 0.0 (INFL)
Impact of Nsp3: -49.9755859375 (IIR) -0.0032901763916015625 (INFL)
Impact of Nsp5: -0.0244140625 (IIR) 0.0 (INFL)
Impact of Nsp6: -0.0244140625 (IIR) 0.0 (INFL)
Impact of Orf3a: -0.0244140625 (IIR) 0.0 (INFL)
Impact of Orf6: -0.0244140625 (IIR) 0.0 (INFL)
Impact of Orf7a: -0.0244140625 (IIR) 0.0 (INFL)
Impact of Orf7b: -0.0244140625 (IIR) 0.0 (INFL)
Impact of Orf8_complex: 0.0 (IIR) 0.0 (INFL)
Impact of Orf9b: 0.0 (IIR) -0.0032901763916015625 (INFL)
Impact of RELA: 0.0 (IIR) 0.0032901763916015625 (INFL)
Impact of RIP1: 0.0 (IIR) 0.0032901763916015625 (INFL)
Impact of RNF135: 0.0 (IIR) 0.0 (INFL)
Impact of TAB1: 0.0 (IIR) 0.0032901763916015625 (INFL)
Impact of TAB2: 0.0 (IIR) 0.0032901763916015625 (INFL)
Impact of TAK1: 0.0 (IIR) 0.0032901763916015625 (INFL)
Impact of TANK: 0.0 (IIR) 0.0 (INFL)
Impact of TLR7: 0.0 (IIR) 0.0001430511474609375 (INFL)
Impact of TLR9: 0.0 (IIR) 0.0001430511474609375 (INFL)
Impact of TREML4: 0.0244140625 (IIR) 0.0001430511474609375 (INFL)
Impact of TRIF: 0.0 (IIR) 0.0032901763916015625 (INFL)
Impact of TRIM25: 0.0 (IIR) 0.0 (INFL)
Impact of TYK2: 0.0 (IIR) 0.0 (INFL)
Impact of Viral_dsRNA_rna_endosome: 0.0 (IIR) 0.0012874603271484375 (INFL)
Impact of pp1ab: 0.0 (IIR) 0.0 (INFL)
Impact of sa3_IFNB1_extracellular_space: 0.0 (IIR) 0.0 (INFL)
Impact of sa5_IFNA1_extracellular_space: 0.0 (IIR) 0.0 (INFL)
Variableobject
Azithromycin_drug1.9%
E1.9%
50 others96.2%
IIR gainfloat64
-49.9755859375 - 49.9755859375
0
Azithromycin_drug
49.97558594
1
E
0
2
FOS
0
3
GRL0617_drug
0
4
IFNAR_complex
0
5
IKKa
0
6
IKKb
0
7
IRAK1_4
0
8
IRF9
0.0244140625
9
IkB
0
drug_on = graph.fix_variable("Azithromycin_drug", True)
states = states_virus_on.intersect(drug_on)
table2 = []
for var in model.variables():
if rg.get_variable_name(var) == 'Viral_replication_phenotype':
continue
if rg.get_variable_name(var) == 'Azithromycin_drug':
continue
if len(rg.regulators(var)) == 0:
iir_impact = check_impact(states, graph.fix_variable(var, True), IIR)
infl_impact = check_impact(states, graph.fix_variable(var, True), INFL)
print("Impact of", rg.get_variable_name(var)+":", iir_impact, "(IIR)", infl_impact, "(INFL)")
table2.append([rg.get_variable_name(var), iir_impact, infl_impact])
DataFrame(table2, columns=["Variable", "IIR gain", "INFL gain"])
Impact of E: 0.0 (IIR) 49.99856948852539 (INFL)
Impact of FOS: 0.0 (IIR) 0.0 (INFL)
Impact of GRL0617_drug: 0.0 (IIR) 0.0 (INFL)
Impact of IFNAR_complex: 0.0 (IIR) 0.0 (INFL)
Impact of IKKa: 0.0 (IIR) 0.004291534423828125 (INFL)
Impact of IKKb: 0.0 (IIR) 0.004291534423828125 (INFL)
Impact of IRAK1_4: 0.0 (IIR) 0.004291534423828125 (INFL)
Impact of IRF9: 0.0 (IIR) 0.0 (INFL)
Impact of IkB: 0.0 (IIR) 0.004291534423828125 (INFL)
Impact of JAK1: 0.0 (IIR) 0.0 (INFL)
Impact of JUN: 0.0 (IIR) 0.0 (INFL)
Impact of M: 0.0 (IIR) 0.0 (INFL)
Impact of MAPK14: 0.0 (IIR) 0.0 (INFL)
Impact of MAPK8: 0.0 (IIR) 0.0 (INFL)
Impact of MNS_drug: 0.0 (IIR) -49.99856948852539 (INFL)
Impact of MYD88: 0.0 (IIR) 0.004291534423828125 (INFL)
Impact of N: 0.0 (IIR) 0.0 (INFL)
Impact of NEMO: 0.0 (IIR) 0.004291534423828125 (INFL)
Impact of NFKB1: 0.0 (IIR) 0.004291534423828125 (INFL)
Impact of Nsp1: 0.0 (IIR) 0.0 (INFL)
Impact of Nsp10: 0.0 (IIR) 0.0 (INFL)
Impact of Nsp13: 0.0 (IIR) 0.0 (INFL)
Impact of Nsp14: 0.0 (IIR) 0.0 (INFL)
Impact of Nsp15: 0.0 (IIR) 0.0 (INFL)
Impact of Nsp16: 0.0 (IIR) 0.0 (INFL)
Impact of Nsp3: 0.0 (IIR) -0.004291534423828125 (INFL)
Impact of Nsp5: 0.0 (IIR) 0.0 (INFL)
Impact of Nsp6: 0.0 (IIR) 0.0 (INFL)
Impact of Orf3a: 0.0 (IIR) 0.0 (INFL)
Impact of Orf6: 0.0 (IIR) 0.0 (INFL)
Impact of Orf7a: 0.0 (IIR) 0.0 (INFL)
Impact of Orf7b: 0.0 (IIR) 0.0 (INFL)
Impact of Orf8_complex: 0.0 (IIR) 0.0 (INFL)
Impact of Orf9b: 0.0 (IIR) -0.004291534423828125 (INFL)
Impact of RELA: 0.0 (IIR) 0.004291534423828125 (INFL)
Impact of RIP1: 0.0 (IIR) 0.004291534423828125 (INFL)
Impact of RNF135: 0.0 (IIR) 0.0 (INFL)
Impact of TAB1: 0.0 (IIR) 0.004291534423828125 (INFL)
Impact of TAB2: 0.0 (IIR) 0.004291534423828125 (INFL)
Impact of TAK1: 0.0 (IIR) 0.004291534423828125 (INFL)
Impact of TANK: 0.0 (IIR) 0.0 (INFL)
Impact of TLR7: 0.0 (IIR) 0.000286102294921875 (INFL)
Impact of TLR9: 0.0 (IIR) 0.000286102294921875 (INFL)
Impact of TREML4: 0.0 (IIR) 0.000286102294921875 (INFL)
Impact of TRIF: 0.0 (IIR) 0.004291534423828125 (INFL)
Impact of TRIM25: 0.0 (IIR) 0.0 (INFL)
Impact of TYK2: 0.0 (IIR) 0.0 (INFL)
Impact of Viral_dsRNA_rna_endosome: 0.0 (IIR) 0.000286102294921875 (INFL)
Impact of pp1ab: 0.0 (IIR) 0.0 (INFL)
Impact of sa3_IFNB1_extracellular_space: 0.0 (IIR) 0.0 (INFL)
Impact of sa5_IFNA1_extracellular_space: 0.0 (IIR) 0.0 (INFL)
Variableobject
E2%
FOS2%
49 others96.1%
IIR gainfloat64
0.0 - 0.0
40
TANK
0
41
TLR7
0
42
TLR9
0
43
TREML4
0
44
TRIF
0
45
TRIM25
0
46
TYK2
0
47
Viral_dsRNA_rna_endosome
0
48
pp1ab
0
49
sa3_IFNB1_extracellular_space
0
mns_drug_on = graph.fix_variable("MNS_drug", True)
states2 = states.intersect(mns_drug_on)
table3 = []
for var in model.variables():
if rg.get_variable_name(var) == 'MNS_drug':
continue
if rg.get_variable_name(var) == 'Viral_replication_phenotype':
continue
if rg.get_variable_name(var) == 'Azithromycin_drug':
continue
if len(rg.regulators(var)) == 0:
iir_impact = check_impact(states2, graph.fix_variable(var, True), IIR)
infl_impact = check_impact(states2, graph.fix_variable(var, True), INFL)
print("Impact of", rg.get_variable_name(var)+":", iir_impact, "(IIR)", infl_impact, "(INFL)")
table3.append([rg.get_variable_name(var), iir_impact, infl_impact])
DataFrame(table3, columns=["Variable", "IIR gain", "INFL gain"])
Impact of E: 0.0 (IIR) 0.0 (INFL)
Impact of FOS: 0.0 (IIR) 0.0 (INFL)
Impact of GRL0617_drug: 0.0 (IIR) 0.0 (INFL)
Impact of IFNAR_complex: 0.0 (IIR) 0.0 (INFL)
Impact of IKKa: 0.0 (IIR) 0.0057220458984375 (INFL)
Impact of IKKb: 0.0 (IIR) 0.0057220458984375 (INFL)
Impact of IRAK1_4: 0.0 (IIR) 0.0057220458984375 (INFL)
Impact of IRF9: 0.0 (IIR) 0.0 (INFL)
Impact of IkB: 0.0 (IIR) 0.0057220458984375 (INFL)
Impact of JAK1: 0.0 (IIR) 0.0 (INFL)
Impact of JUN: 0.0 (IIR) 0.0 (INFL)
Impact of M: 0.0 (IIR) 0.0 (INFL)
Impact of MAPK14: 0.0 (IIR) 0.0 (INFL)
Impact of MAPK8: 0.0 (IIR) 0.0 (INFL)
Impact of MYD88: 0.0 (IIR) 0.0057220458984375 (INFL)
Impact of N: 0.0 (IIR) 0.0 (INFL)
Impact of NEMO: 0.0 (IIR) 0.0057220458984375 (INFL)
Impact of NFKB1: 0.0 (IIR) 0.0057220458984375 (INFL)
Impact of Nsp1: 0.0 (IIR) 0.0 (INFL)
Impact of Nsp10: 0.0 (IIR) 0.0 (INFL)
Impact of Nsp13: 0.0 (IIR) 0.0 (INFL)
Impact of Nsp14: 0.0 (IIR) 0.0 (INFL)
Impact of Nsp15: 0.0 (IIR) 0.0 (INFL)
Impact of Nsp16: 0.0 (IIR) 0.0 (INFL)
Impact of Nsp3: 0.0 (IIR) -0.0057220458984375 (INFL)
Impact of Nsp5: 0.0 (IIR) 0.0 (INFL)
Impact of Nsp6: 0.0 (IIR) 0.0 (INFL)
Impact of Orf3a: 0.0 (IIR) 0.0 (INFL)
Impact of Orf6: 0.0 (IIR) 0.0 (INFL)
Impact of Orf7a: 0.0 (IIR) 0.0 (INFL)
Impact of Orf7b: 0.0 (IIR) 0.0 (INFL)
Impact of Orf8_complex: 0.0 (IIR) 0.0 (INFL)
Impact of Orf9b: 0.0 (IIR) -0.0057220458984375 (INFL)
Impact of RELA: 0.0 (IIR) 0.0057220458984375 (INFL)
Impact of RIP1: 0.0 (IIR) 0.0057220458984375 (INFL)
Impact of RNF135: 0.0 (IIR) 0.0 (INFL)
Impact of TAB1: 0.0 (IIR) 0.0057220458984375 (INFL)
Impact of TAB2: 0.0 (IIR) 0.0057220458984375 (INFL)
Impact of TAK1: 0.0 (IIR) 0.0057220458984375 (INFL)
Impact of TANK: 0.0 (IIR) 0.0 (INFL)
Impact of TLR7: 0.0 (IIR) 0.0003814697265625 (INFL)
Impact of TLR9: 0.0 (IIR) 0.0003814697265625 (INFL)
Impact of TREML4: 0.0 (IIR) 0.0003814697265625 (INFL)
Impact of TRIF: 0.0 (IIR) 0.0057220458984375 (INFL)
Impact of TRIM25: 0.0 (IIR) 0.0 (INFL)
Impact of TYK2: 0.0 (IIR) 0.0 (INFL)
Impact of Viral_dsRNA_rna_endosome: 0.0 (IIR) 0.0003814697265625 (INFL)
Impact of pp1ab: 0.0 (IIR) 0.0 (INFL)
Impact of sa3_IFNB1_extracellular_space: 0.0 (IIR) 0.0 (INFL)
Impact of sa5_IFNA1_extracellular_space: 0.0 (IIR) 0.0 (INFL)
Variableobject
E2%
FOS2%
48 others96%
IIR gainfloat64
0.0 - 0.0
40
TLR7
0
41
TLR9
0
42
TREML4
0
43
TRIF
0
44
TRIM25
0
45
TYK2
0
46
Viral_dsRNA_rna_endosome
0
47
pp1ab
0
48
sa3_IFNB1_extracellular_space
0
49
sa5_IFNA1_extracellular_space
0