Last active
July 19, 2017 06:54
-
-
Save BhushanDhamale/858f0ca4ebd1d41c89d66279d3a90b7f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cobra.test | |
from cobra.flux_analysis import pfba | |
stm = cobra.test.create_test_model("salmonella") | |
stm_fba = stm.optimize() | |
stm_pfba = pfba(stm) | |
pfk_stm = stm.reactions.get_by_id("PFK") | |
with stm: | |
print ("STM PFK before KO: ", pfk_stm.lower_bound, "< pfk <", pfk_stm.upper_bound) | |
print ("""# Absolute predicted flux before PFK KO | |
1. By FBA : """, stm_fba.fluxes.abs().sum()) | |
print ("2. By pFBA : ", stm_pfba.objective_value) | |
print ("Diff. betn FBA and pFBA : ", stm_fba.fluxes.abs().sum() - | |
stm_pfba.objective_value) | |
stm.reactions.PFK.knock_out() | |
stm_fba = stm.optimize() | |
stm_pfba = pfba(stm) | |
print ("\nSTM PFK after KO: ", pfk_stm.lower_bound, "< pfk <", pfk_stm.upper_bound) | |
print ("""# Absolute predicted flux after PFK KO | |
1. By FBA : """, stm_fba.fluxes.abs().sum()) | |
print ("2. By pFBA : ", stm_pfba.objective_value) | |
print ("Diff. betn FBA and pFBA : ", stm_fba.fluxes.abs().sum() - | |
stm_pfba.objective_value) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment