Skip to content

Commit

Permalink
mass commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanu committed Apr 27, 2021
1 parent 156a5b6 commit c79cc94
Show file tree
Hide file tree
Showing 21 changed files with 20,386 additions and 1,841 deletions.
6,001 changes: 5,999 additions & 2 deletions .ipynb_checkpoints/Biomass data - wheat-checkpoint.ipynb

Large diffs are not rendered by default.

944 changes: 384 additions & 560 deletions .ipynb_checkpoints/Generate SOY tissue specific models 3-checkpoint.ipynb

Large diffs are not rendered by default.

1,071 changes: 1,071 additions & 0 deletions .ipynb_checkpoints/Generate WHEAT tissue specific models-checkpoint.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Biomass data - maize.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5125,7 +5125,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.8.3"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion Biomass data - sorghum2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3111,7 +3111,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.8.3"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion Biomass data - soy 2-Backup.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4985,7 +4985,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.8.3"
}
},
"nbformat": 4,
Expand Down
142 changes: 35 additions & 107 deletions Biomass data - soy 2.ipynb

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions Biomass data - soy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3411,21 +3411,21 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"display_name": "Python 3",
"language": "python",
"name": "python2"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.16"
"pygments_lexer": "ipython3",
"version": "3.8.3"
}
},
"nbformat": 4,
Expand Down
8,794 changes: 8,259 additions & 535 deletions Biomass data - wheat.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Data/biomass_soy.csv
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FRU_c,,0.0006015901340550196,0.0008781839371548684,0.0009546732529629342,0.0
Starch_b,,3.582082710816877,2.7407527792043203,1.827811330942959,0.2553344359340367
Cellulose_b,,0.5047557720569543,0.6624127272448725,0.6480437957395563,0.0
Xylan_b,,3.3572798301959312,12.522273984514358,13.015276386519526,0.0
L_PHOSPHATIDATE_p,,1.3124363568611965e-05,5.675545815562533e-06,3.5567809884531068e-06,20.2578950603197
L_PHOSPHATIDATE_p,,1.350785104237711e-05,5.8405384723826616e-06,3.6883513405790286e-06,20.79990852520246
PHOSPHATIDYL_CHOLINE_r,,0.0,0.0,0.0,0.0
L_1_PHOSPHATIDYL_ETHANOLAMINE_r,,0.0,0.0,0.0,0.0
DIACYLGLYCEROL_p,,0.0,0.0,0.0,0.0
Expand Down
81 changes: 81 additions & 0 deletions Data/biomass_wheat.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
,type,leaf,stem,root,seed
sSUCROSE_b,,0.0,0.0,0.0,0.05927437193334587
GLC_c,,0.02407193144241361,0.0035305090321695945,0.02715949112000632,0.0
FRU_c,,0.04151419375094672,0.01452716541492162,0.03668049046448853,0.0
Starch_b,,0.1668216440640929,0.06840456905445502,0.07856489121170145,0.3462448673919929
Cellulose_b,,0.04265927817621051,0.12741311942661077,0.032648689995147966,0.0
Xylan_b,,0.22007422610643818,0.7830595917975792,0.4439907747704811,0.0
L_PHOSPHATIDATE_p,,0.0013008020731031399,0.0018968172951671735,0.0007457570332604895,0.0
PHOSPHATIDYL_CHOLINE_r,,0.0,0.0,0.0,0.0
L_1_PHOSPHATIDYL_ETHANOLAMINE_r,,0.0,0.0,0.0,0.0
DIACYLGLYCEROL_p,,0.0,0.0,0.0,0.0
Galactosyl_galactosyl_diacyl_glycerols_p,,0.0,0.0,0.0,0.0
D_Galactosyl_12_diacyl_glycerols_p,,0.0,0.0,0.0,0.0
2_Lysophosphatidylcholines_r,,0.0,0.0,0.0,0.0
Lysophosphatidylglycerols_r,,0.0,0.0,0.0,0.0
Triacylglycerols_p,,0.0,0.0,0.0,0.0
L_1_PHOSPHATIDYL_GLYCEROL_p,,0.0,0.0,0.0,0.0
L_1_phosphatidyl_inositols_r,,0.0,0.0,0.0,0.0
SULFOQUINOVOSYLDIACYLGLYCEROL_p,,0.0,0.0,0.0,0.0
Protein_b,,0.0,0.0,0.0,0.0
sMAL_b,,0.0,0.0,0.0,0.0
sCIT_b,,0.0,0.0,0.0,0.0
sFUM_b,,0.0,0.0,0.0,0.0
ARG_c,,0.0,0.0,0.0,0.0034969536934542065
HIS_c,,0.0,0.0,0.0,0.0022657902819705807
LYS_c,,0.0,0.0,0.0,0.002797728281543598
sASP_b,,0.0,0.0,0.0,0.004106051998215557
sGLU_b,,0.0,0.0,0.0,0.0
sSER_b,,0.0009756862573815953,0.0007074280270653427,0.0006593879168165082,0.005925647936484229
THR_c,,0.0,0.0,0.0,0.0035414725313854273
ASN_c,,0.0,0.0,0.0,0.0
sGLN_b,,0.0,0.0,0.0,0.0
CYS_c,,0.0,0.0,0.0,0.0018238375352502634
GLY_c,,0.0,0.0,0.0,0.005485968636729927
PRO_c,,0.0,0.0,0.0,0.017797382608338387
sALA_b,,0.00198931811529319,0.0003996552995241783,0.0008688547290514354,0.005524180099441843
VAL_c,,0.0004886284178338886,0.00023156257115935244,0.00019305045165008016,0.006516300103933013
ILE_c,,0.0,0.0,0.0,0.004747486217557739
LEU_c,,0.00011495495353062909,6.941958165427158e-05,8.308627444421632e-05,0.01026069601859253
MET_c,,0.0,0.0,0.0,0.0016155694068434579
PHE_c,,0.0,0.0,0.0,0.006992501329759411
TYR_c,,0.0,0.0,0.0,0.002106536946313967
TRP_c,,0.0,0.0,0.0,0.0
sGABA_b,,0.0,0.0,0.0,0.0
PALMITATE_p,fattyacid,0.035606935636637776,0.04994040969346369,0.04703257181127117,0.0
CPD_9245_p,fattyacid,0.007240792358424453,0.0004202926948608742,0.0020330291732018084,0.0
CPD_17412_p,fattyacid,0.0,0.0,0.0,0.0
CPD_17291_p,fattyacid,0.0,0.0,0.0,0.0
STEARIC_ACID_p,fattyacid,0.008976806317569213,0.01856870396737305,0.01767443125994189,0.0
OLEATE_CPD_p,fattyacid,0.0018277263373155618,0.004394446859229714,0.0016563336180513936,0.0
Octadecadienoate_p,fattyacid,0.011143781023617877,0.004740664196646318,0.0022189901253892976,0.0
LINOLENIC_ACID_p,fattyacid,0.0,0.0,0.0,0.0
ARACHIDIC_ACID_p,fattyacid,0.0005199821542438829,0.00042059753029586466,0.00033705568254890954,0.0
CPD_16709_p,fattyacid,4.37423129818684e-05,0.00013598128026874257,0.00016494406503906467,0.0
DOCOSANOATE_p,fattyacid,0.0010670824574418006,0.00037398827281942266,0.000507813899732124,0.0
SUC_c,,0.0,0.0,0.0,0.0
FUM_c,,0.0,0.0,0.0,0.0
MAL_c,,0.0,0.0,0.0,0.0
CIS_ACONITATE_c,,0.0,0.0,0.0,0.0
CIT_c,,0.0,0.0,0.0,0.0
MYO_INOSITOL_c,,0.0018655330808306327,0.00022634539514421534,0.0009605149034952827,0.0
pHIS_b,protein,0.0,0.0,0.0,0.0
pILE_b,protein,1.924072964221579,2.6556954862329825,0.6997559365981111,0.0
pTHR_b,protein,4.360934197403676,7.551510200625996,1.6677033573318136,0.0
pARG_b,protein,0.0,0.0,0.0,0.0
pASN_b,protein,0.009838920261536058,0.0757452078416009,0.006195311320784838,0.0
pGLU_b,protein,2.2858356864008615,8.138279053597381,1.8464484346419687,0.0
pPHE_b,protein,1.418759483765095,1.8548121187022342,0.5549038921521883,0.0
pGLN_b,protein,0.0,0.0,0.0,0.0
pTYR_b,protein,0.3176847980562126,0.4501670209937119,0.1990805787666864,0.0
pMET_b,protein,0.199553117142437,0.32420072368494246,0.012275439045657727,0.0
pASP_b,protein,2.7585171951585656,9.602418000747038,1.9274782797421137,0.0
pVAL_b,protein,2.4864803733518266,3.6620783609628775,0.9156443098901302,0.0
pLYS_b,protein,0.46836342612376053,0.8006863739040936,0.24910822100848554,0.0
pSER_b,protein,2.4193372050624316,7.470794810822991,1.3360654593571428,0.0
pGLY_b,protein,4.04763123972579,8.504696615538734,1.9022042381516737,0.0
pALA_b,protein,4.135099064148344,9.584720988071139,1.924930099536851,0.0
pLEU_b,protein,3.7055039932784912,5.498532182176017,1.422790606753007,0.0
pPRO_b,protein,2.24075030812871,8.606324346137416,0.513788535671146,0.0
pCYS_b,protein,0.004792980218091755,0.029342507868639164,0.003446197059384382,0.0
pTRP_b,protein,0.007357973292029906,0.17302423692318453,0.003627860099416644,0.0
163 changes: 162 additions & 1 deletion Functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,4 +336,165 @@ def generateMissingFormula(model,debug=False):
if former == latter:
break


def generateStemModel(model):
from cobra.core import Reaction
for met in model.reactions.Phloem_output_tx.metabolites.keys():
met2 = met.copy()
if met.id=="sSUCROSE_b":
met2.id = "SUCROSE_ph"
met = model.metabolites.get_by_id("SUCROSE_c")
elif "PROTON" in met.id:
continue
else:
met2.id = met.id.replace("_c","_ph")
met2.compartment = "ph"
model.add_metabolites(met2)
rxn = Reaction(met2.id+"_exchange")
rxn.add_metabolites({met2:1})
model.add_reaction(rxn)
rxn = Reaction(met2.id.replace("_ph","_phloem_uptake"),name=met2.id.replace("_ph","_phloem_uptake"))
rxn.add_metabolites({met2:-1,model.metabolites.get_by_id("PROTON_e"):-1,
met:1,model.metabolites.get_by_id("PROTON_c"):1})
rxn.lower_bound = 0
rxn.upper_bound = 1000
model.add_reaction(rxn)
#print(rxn.reaction)
return model

def generateRootModel(model,symbiont=None):
from cobra.core import Reaction
for met in model.reactions.Phloem_output_tx.metabolites.keys():
met2 = met.copy()
if met.id=="sSUCROSE_b":
met2.id = "SUCROSE_ph"
met = model.metabolites.get_by_id("SUCROSE_c")
elif "PROTON" in met.id:
continue
else:
met2.id = met.id.replace("_c","_ph")
met2.compartment = "ph"
model.add_metabolites(met2)
rxn = Reaction(met2.id+"_exchange")
rxn.add_metabolites({met2:1})
model.add_reaction(rxn)

rxn = Reaction(met2.id.replace("_ph","_phloem_uptake"),name=met2.id.replace("_ph","_phloem_uptake"))
rxn.add_metabolites({met2:-1,model.metabolites.get_by_id("PROTON_e"):-1,
met:1,model.metabolites.get_by_id("PROTON_c"):1})
rxn.lower_bound = 0
rxn.upper_bound = 1000
model.add_reaction(rxn)
#add xylem reactions
for met in ["CAII","MGII","KI","NITRATE","SULFATE","AMMONIUM","WATER","GLT","L_ASPARTATE","ASN","GLN"]:
met2 = model.metabolites.get_by_id(met+"_c").copy()
met2.id = met+"_xy"
met2.compartment = "xy"

rxn = Reaction(met+"_exchange")
rxn.add_metabolites({met2:-1})
rxn.lower_bound = 0
rxn.upper_bound = 1000
model.add_reaction(rxn)

rxn = Reaction(met+"_xylem_export")
rxn.add_metabolites({model.metabolites.get_by_id(met+"_c"):-1,met2:1})
model.add_reaction(rxn)

if symbiont == None:
return model
else:
model.reactions.Nitrate_tx.upper_bound = 0
model.reactions.Nitrate_tx.lower_bound = 0

#adding symbiont compartment
from cobra import io
rhizo = io.read_sbml_model(symbiont["path"])
for met in rhizo.metabolites:
met.compartment = met.compartment+"_rhizo"
rhizo.compartments={"c_rhizo":"rhizobe cytosol","e_rhizo":"rhizobe extracellular"}
model = model+rhizo

# rxn = Reaction("Sucrose_exchange_symbiont")
# rxn.name = rxn.id.replace("_"," ")
# rxn.add_metabolites({model.metabolites.get_by_id("SUCROSE_c"):-1,model.metabolites.get_by_id("cpd00076[e0]"):1})
# rxn.lower_bound = -1000
# rxn.upper_bound = 1000
# model.add_reaction(rxn)

rxn = Reaction("Alanine_exchange_symbiont")
rxn.name = rxn.id.replace("_"," ")
rxn.add_metabolites({model.metabolites.get_by_id("L_ALPHA_ALANINE_c"):-1,
model.metabolites.get_by_id("ala__L[e]"):1})
rxn.lower_bound = -1000
rxn.upper_bound = 1000
model.add_reaction(rxn)

rxn = Reaction("Aspartate_exchange_symbiont")
rxn.name = rxn.id.replace("_"," ")
rxn.add_metabolites({model.metabolites.get_by_id("L_ASPARTATE_c"):-1,
model.metabolites.get_by_id("asp__L[e]"):1})
rxn.lower_bound = -1000
rxn.upper_bound = 1000
model.add_reaction(rxn)

rxn = Reaction("Glutamate_exchange_symbiont")
rxn.name = rxn.id.replace("_"," ")
rxn.add_metabolites({model.metabolites.get_by_id("GLT_c"):-1,
model.metabolites.get_by_id("glu__L[e]"):1})
rxn.lower_bound = -1000
rxn.upper_bound = 1000
model.add_reaction(rxn)

rxn = Reaction("Malate_exchange_symbiont")
rxn.name = rxn.id.replace("_"," ")
rxn.add_metabolites({model.metabolites.get_by_id("MAL_c"):-1,
model.metabolites.get_by_id("mal__L[e]"):1})
rxn.lower_bound = -1000
rxn.upper_bound = 1000
model.add_reaction(rxn)

rxn = Reaction("Succinate_exchange_symbiont")
rxn.name = rxn.id.replace("_"," ")
rxn.add_metabolites({model.metabolites.get_by_id("SUC_c"):-1,
model.metabolites.get_by_id("succ[e]"):1})
rxn.lower_bound = -1000
rxn.upper_bound = 1000
model.add_reaction(rxn)

rxn = Reaction("Ammonium_exchange_symbiont")
rxn.name = rxn.id.replace("_"," ")
rxn.add_metabolites({model.metabolites.get_by_id("AMMONIUM_c"):-1,
model.metabolites.get_by_id("fixedNH3[e]"):1})
rxn.lower_bound = -1000
rxn.upper_bound = 1000
model.add_reaction(rxn)

return model

def generateSeedModel(model):
from cobra.core import Reaction
for met in model.reactions.Phloem_output_tx.metabolites.keys():
met2 = met.copy()
if met.id=="sSUCROSE_b":
met2.id = "SUCROSE_ph"
met = model.metabolites.get_by_id("SUCROSE_c")
elif "PROTON" in met.id:
continue
else:
met2.id = met.id.replace("_c","_ph")
met2.compartment = "ph"
model.add_metabolites(met2)

rxn = Reaction(met2.id+"_exchange")
rxn.add_metabolites({met2:1})
model.add_reaction(rxn)

rxn = Reaction(met2.id.replace("_ph","_phloem_uptake"),name=met2.id.replace("_ph","_phloem_uptake"))
rxn.add_metabolites({met2:-1,model.metabolites.get_by_id("PROTON_e"):-1,
met:1,model.metabolites.get_by_id("PROTON_c"):1})
rxn.lower_bound = 0
rxn.upper_bound = 1000
model.add_reaction(rxn)

#print(rxn.reaction)
return model
Loading

0 comments on commit c79cc94

Please sign in to comment.