Text manipulation in Python [on hold]
I have the following list in Python :
['{"coefficient": -1.0, "compartment": "c", "molecule": "A", "evidence": []',
'{"coefficient": -1.0, "compartment": "c", "molecule": "B", "evidence": []',
'{"coefficient": -1.0, "compartment": "c", "molecule": "C", "evidence": []',
'{"coefficient": 1.0, "compartment": "c", "molecule": "D", "evidence": []',
'{"coefficient": 1.0, "compartment": "c", "molecule": "E", "evidence": []',
'{"coefficient": 1.0, "compartment": "c", "molecule": "F", "evidence": []}']
I want to convert this into :
A + B + C --> D + E + F
Which is the easiest way to do this in python?
If the coefficient is -ve, I want to convert the corresponding molecule as
reactant. If the coefficient is +ve, I want to convert the corresponding
molecule as product.
No comments:
Post a Comment