@@ -0,0 +1,994 @@
+import cobra%0Afrom cameo.network_analysis.networkx_based import model_to_network%0A%0Afrom reaction_finder import detect_ffl%0A%0A%0Adef main():%0A    # load model%0A    model = cobra.io.read_sbml_model('data/HMRdatabase2_00_Cobra.xml')%0A    graph = model_to_network(model)%0A%0A    # extract motifs%0A    motifs = %5B%5D%0A    for cs in detect_ffl(graph):%0A        if None in cs: continue%0A        if cs in motifs: continue%0A        motifs.append(cs)%0A    motifs_n = %5Btuple(map(lambda x: x.name, mot)) for mot in motifs%5D%0A%0A    # output sensible ones%0A    marker = %5B%0A        'cofactors', 'pool',%0A        'Na', 'Pi', 'CoA', 'apo',%0A        'H2O', 'O2_O2', 'CO2_CO2', 'H+_H',%0A        'AMP', 'ADP', 'ATP', 'UMP', 'UDP', 'UTP', 'GMP', 'GDP', 'GTP',%0A        'NAD', 'NAD'%0A    %5D%0A    match = lambda x: all(not w in x for w in marker)%0A%0A    with open('results/metabolite_list.txt', 'w') as fd:%0A        for m in motifs_n:%0A            if not all(map(match, m)): continue%0A            fd.write(f'%7Bm%7D%5Cn')%0A%0Aif __name__ == '__main__':%0A    main()%0A

Add metabolic FFL finder