<jupyter_start><jupyter_text>Strong Edges Network VS ACDC Fully Connected Network<jupyter_code>import DSGRN
from DSGRN import *

import cProfile
import sys
sys.setrecursionlimit(10**8)
sys.path.insert(0,'../src')

import PhenotypeGraphFun
import CondensationGraph_iter
import ReducePhenotypeGraph
import PhenotypeGraphviz
import pickle
import Hb_Kni_high2low
database_s = Database("/home/elizabeth/Desktop/ACDC/ACDC_StrongEdges.db") 
network_s = Network("/home/elizabeth/Desktop/ACDC/ACDC_StrongEdges") 
parameter_graph_s = ParameterGraph(network_s)
database_f = Database("/home/elizabeth/Desktop/ACDC/ACDC_Fullconn.db") 
network_f = Network("/home/elizabeth/Desktop/ACDC/ACDC_Fullconn") 
parameter_graph_f = ParameterGraph(network_f)
Table(["Strong Edges", "Fully Connected"],
     [[DrawGraph(network_s),DrawGraph(network_f)],
      ["Parameter Graph size:", "Parameter Graph size:"],
      [parameter_graph_s.size(),parameter_graph_f.size()]])
with open('StrongEdges_edges_0.pkl','rb') as file:
    edges_s = pickle.load(file)
with open('Fullconn_edges_0.pkl','rb') as file:
    edges_f = pickle.load(file)
len(edges_s)
len(edges_f)
cond_s, redu_params_s, scc_s = condensation_graph_optimized(edges_s)
cond_f, redu_params_f, scc_f = condensation_graph_optimized(edges_f)
PGI = [(3,6), (3,6), (300, 2400), (300, 2400), (300, 2400), (36000, 48000), (36000, 48000),(36000, 48000), (138, 120) ]
Table(["Strong Edges", "Fully Connected"],
     [[PhenotypeGraphviz(database_s, network_s, cond_s, 'svg', 's'), PhenotypeGraphviz(database_f, network_f, cond_f, 'svg', 'f')]])
Table(["Strong Edges MG's from Cond", "Fully Connected MG's from Cond"], 
     [[DrawGraph(MorseGraph(DomainGraph(parameter_graph_s.parameter(i)))), DrawGraph(MorseGraph(DomainGraph(parameter_graph_f.parameter(j))))] for i,j in PGI])
Table(["Layer","Strong Edges scc size", "Fully Connected scc size", "Difference (s-f)"],
     [ [i , len(scc_s[i][0]), len(scc_f[i][0]), len(scc_s[i][0]) - len(scc_f[i][0]) ] for i in scc_s])
Table(["Layer","Strong Edges scc size %", "Fully Connected scc size %", "Difference (s-f)"],
     [ [i , round((len(scc_s[i][0])/parameter_graph_s.size())*100,2), round((len(scc_f[i][0])/parameter_graph_f.size())*100,2), round((len(scc_s[i][0])/parameter_graph_s.size())*100-(len(scc_f[i][0])/parameter_graph_f.size())*100,2) ] for i in scc_s])<jupyter_output><empty_output><jupyter_text>Looking at only Hb high in first layer and Kni low in last layer<jupyter_code>with open('StrongEdges_edges_0r.pkl','rb') as file:
    edges_sr = pickle.load(file)
with open('Fullconn_edges_0r.pkl','rb') as file:
    edges_fr = pickle.load(file)
cond_sr, redu_params_sr, scc_sr = condensation_graph_optimized(edges_sr)
cond_fr, redu_params_fr, scc_fr = condensation_graph_optimized(edges_fr)
Table(["Fully Connected with Constraints"],
     [[PhenotypeGraphviz(database_f, network_f, cond_fr, 'svg', 'f')]])
AP35 = {"Hb":[0,1], "Gt":3, "Kr":0, "Kni":0}
AP37 = {"Hb":1, "Gt":[0,3], "Kr":0, "Kni":0} 
AP40 = {"Hb":1, "Gt":0, "Kr":[0,1], "Kni":0} 
AP45 = {"Hb":[0,1], "Gt":0, "Kr":1, "Kni":0} 
AP47 = {"Hb":[0,1], "Gt":0, "Kr":1, "Kni":0} 
AP51 = {"Hb":0, "Gt":0, "Kr":1, "Kni":[0,3]} 
AP57 = {"Hb":0, "Gt":0, "Kr":[0,1], "Kni":3} 
AP61 = {"Hb":0, "Gt":0, "Kr":[0,1], "Kni":3}
AP63 = {"Hb":0, "Gt":[0,3], "Kr":0, "Kni":3} 
AP67 = {"Hb":0, "Gt":3, "Kr":0, "Kni":[0,3]}

D = [[AP37], [AP40], [AP45], [AP47], [AP51], [AP57], [AP61], [AP63], [AP67]]
paramslist = get_paramslist_optimized(database, D, '=')
len(paramslist[0])
len(scc_s[0][0])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.20439808288694672, 'fraction_numerical': 0.05187482379475613, 'mean_word_length': 7.270396270396271, 'pattern_counts': {'":': 40, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '143003', 'license': 'MIT', 'n_tokens_mistral': 1616, 'n_tokens_neox': 1485, 'n_words': 265, 'path': 'notebooks/StrongEdges_Network_VS_ACDC_Fullconn_Network.ipynb', 'repo_name': 'Eandreas1857/dsgrn_acdc', 'size': '3547'}