|
1 | 1 | #!/usr/bin/env python
|
2 | 2 | from BiochemPy import Reactions
|
3 | 3 | from math import log
|
| 4 | +import sys |
4 | 5 | reactions_helper = Reactions()
|
5 | 6 | reactions_dict = reactions_helper.loadReactions()
|
6 | 7 |
|
| 8 | +DB_Level = '' |
| 9 | +if(len(sys.argv)>1 and (sys.argv[1] == 'EQ' or sys.argv[1] == 'GF')): |
| 10 | + DB_Level = sys.argv[1] |
| 11 | + |
7 | 12 | #Constants
|
8 | 13 | TEMPERATURE=298.15
|
9 | 14 | GAS_CONSTANT=0.0019858775
|
|
48 | 53 | rxn_dg = reactions_dict[rxn]['deltag']
|
49 | 54 | rxn_dge = reactions_dict[rxn]['deltagerr']
|
50 | 55 |
|
51 |
| - if(rxn_dg == 10000000 or rxn_dg is None or "GFC" not in reactions_dict[rxn]["notes"]): |
| 56 | + # Here, if I'm specifying either GF or EQ, |
| 57 | + # Then I want to check that I should estimate for this reaction |
| 58 | + # (I.e. either "GFC" or "EQC") |
| 59 | + # Otherwise its labeled as incomplete |
| 60 | + DB_Rxn=True |
| 61 | + if(len(DB_Level)>0): |
| 62 | + DB_Rxn=False |
| 63 | + for entry in reactions_dict[rxn]["notes"]: |
| 64 | + if(DB_Level in entry and entry == DB_Level+"C"): |
| 65 | + DB_Rxn=True |
| 66 | + |
| 67 | + if(rxn_dg == 10000000 or rxn_dg is None or DB_Level is False): |
52 | 68 |
|
53 | 69 | thermoreversibility = "?"
|
54 | 70 | reversibility_report[rxn]=["Incomplete",reactions_dict[rxn]["reversibility"],thermoreversibility]
|
|
237 | 253 | reversibility_report[rxn]=["default",reactions_dict[rxn]["reversibility"],thermoreversibility]
|
238 | 254 | reactions_dict[rxn]['reversibility']=thermoreversibility
|
239 | 255 |
|
240 |
| -with open("Estimated_Reaction_Reversibility_Report.txt","w") as fh: |
| 256 | +file_name="Estimated_Reaction_Reversibility_Report" |
| 257 | +if(len(DB_Level)>0): |
| 258 | + file_name+="_"+DB_Level |
| 259 | +file_name+=".txt" |
| 260 | +with open(file_name,"w") as fh: |
241 | 261 | for rxn in sorted(reversibility_report):
|
242 | 262 | fh.write(rxn+"\t"+"\t".join(reversibility_report[rxn])+"\n")
|
243 | 263 | fh.close()
|
|
0 commit comments