<jupyter_start><jupyter_text>2-member Zahmeeth model  sans kinetic constraints<jupyter_code>modelInfo_2 = ["CMM_iAH991V2_iML1515.kb",40576]
mediaInfo_2 = ["Btheta_Ecoli_minimal_media",40576]
model = kbase.get_from_ws(modelInfo_2[0],modelInfo_2[1])
media = kbase.get_from_ws(mediaInfo_2[0],mediaInfo_2[1])

# simulate and visualize the model
cfba = MSCommunity(model)
cfba.drain_fluxes(media)
cfba.gapfill(media)
cfba.constrain(media)#, kinetic_coeff=2100, abundances={"1":0.5,"2":0.5})
solution = cfba.run()
cfba.compute_interactions(solution)
cfba.visualize()<jupyter_output>Making biomass drain: cpd11416_c1
Making biomass drain: cpd11416_c2
species 1 drain-flux objective value: 0.1743969883599168
species 2 drain-flux objective value: 0.16925387417839677

Model objective value: 0.17375024029002192



Production matrix:
                1          2
Donor                       
1        0.000000  18.264719
2      426.862401   0.000000


Consumption matrix:
                  1           2
Receiver                       
1          0.000000  426.862401
2         18.264719    0.000000<jupyter_text>variable kinetic coefficients<jupyter_code>modelInfo_2 = ["CMM_iAH991V2_iML1515.kb",40576]
mediaInfo_2 = ["Btheta_Ecoli_minimal_media",40576]

model = kbase.get_from_ws(modelInfo_2[0],modelInfo_2[1])
media = kbase.get_from_ws(mediaInfo_2[0],mediaInfo_2[1])
abundances = {"1":0.5,"2":0.5}

# evaluate the influence of kinetic constraints over a range of coefficients
plots = []
for kinetic_coeff in range(800,1400,50):
    banner = '\n{}\nKinetic coefficient: {}'.format('='*50, kinetic_coeff)
    print(banner)
    
    model = kbase.get_from_ws(modelInfo_2[0],modelInfo_2[1])
    media = kbase.get_from_ws(mediaInfo_2[0],mediaInfo_2[1])
    cfba = MSCommunity(model)
    cfba.drain_fluxes(media)
    cfba.gapfill(media)

    cfba.constrain(media, kinetic_coeff = kinetic_coeff, abundances = abundances)
    solution = cfba.run()
    cfba.compute_interactions(solution)
    graph, pos, labels = cfba.visualize()
    plots.append((graph, pos, labels, banner))<jupyter_output>==================================================
Kinetic coefficient: 800
Making biomass drain: cpd11416_c1
Making biomass drain: cpd11416_c2
species 1 drain-flux objective value: 0.1743969883599168
species 2 drain-flux objective value: 0.16925387417839677
Warning:Community biomass reaction is being altered with input abundances
1:bio2
2:bio4

Model objective value: 0.0



Production matrix:
         1    2
Donor          
1      0.0  0.0
2      0.0  0.0


Consumption matrix:
            1    2
Receiver          
1         0.0  0.0
2         0.0  0.0<jupyter_text>variable abundances<jupyter_code>modelInfo_2 = ["CMM_iAH991V2_iML1515.kb",40576]
mediaInfo_2 = ["Btheta_Ecoli_minimal_media",40576]
model = kbase.get_from_ws(modelInfo_2[0],modelInfo_2[1])
media = kbase.get_from_ws(mediaInfo_2[0],mediaInfo_2[1])
kinetic_coeff = 2000

# evaluate the influence of kinetic constraints over a range of coefficients
plots = []
for abundance in range(0, 10):
    species_1 = abundance/10
    species_2 = 1-species_1
    banner = '\n{}\nAbundance\nspecies 1:{}\tspecies 2:{}'.format('='*30, species_1, species_2)
    print(banner)
    model = kbase.get_from_ws(modelInfo_2[0],modelInfo_2[1])
    media = kbase.get_from_ws(mediaInfo_2[0],mediaInfo_2[1])
    cfba = MSCommunity(model)
    cfba.drain_fluxes(media)
    cfba.gapfill(media)

    cfba.constrain(media, kinetic_coeff = kinetic_coeff, abundances = {"1":species_1,"2":species_2})
    solution = cfba.run()
    cfba.compute_interactions(solution)
    graph, pos, labels = cfba.visualize()
    plots.append((graph, pos, labels, banner))<jupyter_output>==============================
Abundance
species 1:0.0	species 2:1.0
Making biomass drain: cpd11416_c1
Making biomass drain: cpd11416_c2
species 1 drain-flux objective value: 0.1743969883599168
species 2 drain-flux objective value: 0.16925387417839677
Warning:Community biomass reaction is being altered with input abundances
1:bio2
2:bio4

Model objective value: 0.16324578220864486



Production matrix:
              1         2
Donor                    
1      0.000000  0.295723
2      0.273455  0.000000


Consumption matrix:
                 1         2
Receiver                    
1         0.000000  0.273455
2         0.295723  0.000000<jupyter_text>3-member Electrosynth model  sans kinetic constraints<jupyter_code>import networkx

%run ../../modelseedpy/core/mscommunity.py
modelInfo = ["electro.community.edited.v2",93204]
mediaInfo = ["CO2_minimal",93204]
model = kbase.get_from_ws(modelInfo[0],modelInfo[1])
media = kbase.get_from_ws(mediaInfo[0],mediaInfo[1])

# simulate and visualize the model
cfba = MSCommunity(model)
cfba.drain_fluxes(media)
cfba.gapfill(media)
cfba.constrain(media)#, kinetic_coeff=2100, abundances={"1":0.5,"2":0.5})
solution = cfba.run()
cfba.compute_interactions(solution)
cfba.visualize()<jupyter_output>Making biomass drain: cpd11416_c1
Making biomass drain: cpd11416_c2
Making biomass drain: cpd11416_c3
species 1 drain-flux objective value: 0.1339023910178979
species 2 drain-flux objective value: 0.11304811462925872
species 3 drain-flux objective value: 0.12709584977365385

Model objective value: 0.12453728378574319



Production matrix:
              1         2         3
Donor                              
1      0.000000  0.110895  0.383884
2      1.257597  0.000000  0.253042
3      1.554671  2.139689  0.000000


Consumption matrix:
                 1         2         3
Receiver                              
1         0.000000  1.257597  1.554671
2         0.110895  0.000000  2.139689
3         0.383884  0.253042  0.000000<jupyter_text>variable kinetic coefficients<jupyter_code>modelInfo = ["electro.community.edited.v2",93204]
mediaInfo = ["CO2_minimal",93204]
model = kbase.get_from_ws(modelInfo[0],modelInfo[1])
media = kbase.get_from_ws(mediaInfo[0],mediaInfo[1])
abundances = {"1":0.5,"2":0.5}

# evaluate the influence of kinetic constraints over a range of coefficients
plots = []
for kinetic_coeff in range(800,1400,50):
    banner = '\n{}\nKinetic coefficient: {}'.format('='*50, kinetic_coeff)
    print(banner)
    
    model = kbase.get_from_ws(modelInfo[0],modelInfo[1])
    media = kbase.get_from_ws(mediaInfo[0],mediaInfo[1])
    cfba = MSCommunity(model)
    cfba.drain_fluxes(media)
    cfba.gapfill(media)
    
    cfba.constrain(media, kinetic_coeff = kinetic_coeff, abundances = abundances)
    solution = cfba.run()
    cfba.compute_interactions(solution)
    graph, pos, labels = cfba.visualize()
    plots.append((graph, pos, labels, banner))<jupyter_output>==================================================
Kinetic coefficient: 800
Making biomass drain: cpd11416_c1
Making biomass drain: cpd11416_c2
Making biomass drain: cpd11416_c3
species 1 drain-flux objective value: 0.1339023910178979
species 2 drain-flux objective value: 0.11304811462925872
species 3 drain-flux objective value: 0.12709584977365385
Warning:Community biomass reaction is being altered with input abundances
1:bio2
2:bio3
3:bio4

Model objective value: 0.07079560936880114



Production matrix:
              1         2         3
Donor                              
1      0.000000  0.326093  0.486814
2      1.695546  0.000000  0.826021
3      0.000157  2.310370  0.000000


Consumption matrix:
                 1         2         3
Receiver                              
1         0.000000  1.695546  0.000157
2         0.326093  0.000000  2.310370
3         0.486814  0.826021  0.000000<jupyter_text>variable abundances<jupyter_code>modelInfo = ["electro.community.edited.v2",93204]
mediaInfo = ["CO2_minimal",93204]
model = kbase.get_from_ws(modelInfo[0],modelInfo[1])
media = kbase.get_from_ws(mediaInfo[0],mediaInfo[1])
kinetic_coeff = 2000

# evaluate the influence of kinetic constraints over a range of coefficients
plots = []
for abundance in range(0, 10):
    species_1 = abundance/10
    species_2 = (1-species_1)/2
    species_3 = (1-species_1)/2
    banner = '\n{}\nAbundance\nspecies 1:{}\tspecies 2:{}\tspecies 3:{}'.format('='*50, species_1, species_2,species_3)
    print(banner)
    
    model = kbase.get_from_ws(modelInfo[0],modelInfo[1])
    media = kbase.get_from_ws(mediaInfo[0],mediaInfo[1])
    cfba = MSCommunity(model)
    cfba.drain_fluxes(media)
    cfba.gapfill(media)
    
    cfba.constrain(media, kinetic_coeff = kinetic_coeff, abundances = {"1":species_1,"2":species_2, '3':species_3})
    solution = cfba.run()
    cfba.compute_interactions(solution)
    graph, pos, labels = cfba.visualize()
    plots.append((graph, pos, labels, banner))<jupyter_output>==================================================
Abundance
species 1:0.0	species 2:0.5	species 3:0.5
Making biomass drain: cpd11416_c1
Making biomass drain: cpd11416_c2
Making biomass drain: cpd11416_c3
species 1 drain-flux objective value: 0.1339023910178979
species 2 drain-flux objective value: 0.11304811462925872
species 3 drain-flux objective value: 0.12709584977365385
Warning:Community biomass reaction is being altered with input abundances
1:bio2
2:bio3
3:bio4

Model objective value: 0.11953747828719627



Production matrix:
              1         2         3
Donor                              
1      0.000000  0.023278  0.028063
2      0.270149  0.000000  0.362348
3      0.049207  2.756893  0.000000


Consumption matrix:
                 1         2         3
Receiver                              
1         0.000000  0.270149  0.049207
2         0.023278  0.000000  2.756893
3         0.028063  0.362348  0.000000
{'fraction_non_alphanumeric': 0.11539264828738513, 'fraction_numerical': 0.1400375939849624, 'mean_word_length': 3.4215143120960296, 'pattern_counts': {'":': 12, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '385559', 'license': 'MIT', 'n_tokens_mistral': 4241, 'n_tokens_neox': 3308, 'n_words': 713, 'path': 'examples/Community Modeling/MSCommunity_kinetics.ipynb', 'repo_name': 'freiburgermsu/ModelSEEDpy', 'size': '9576'}