cowmunity1.0
Cowmunity Model: Community Metabolic Modeling with Molecular Docking Integration
Overview
The Cowmunity Model is a community metabolic model that simulates a three-species rumen microbial community using the OptCom (Optimal Community) bilevel optimization framework. The model integrates molecular docking predictions to mechanistically predict how small molecule treatments affect methane production in the rumen microbiome.
What We've Done
Community Metabolic Modeling: Built a bilevel optimization model that simulates three rumen bacteria:
- Methanobrevibacter gottschalkii (MGK): Methanogen that produces methane
- Prevotella ruminicola (PRM): Fibrolytic bacterium
- Ruminococcus flavefaciens (RFL): Fibrolytic bacterium
Molecular Docking Integration: Integrated structure-based molecular docking predictions directly into the metabolic model by:
- Converting binding affinities (Kd) to inhibition factors
- Accounting for drug-enzyme binding saturation
- Applying relaxation factors to bridge in silico predictions and in vivo reality
- Mapping docking results to metabolic reactions
Combined Approach: Simultaneously applies:
- Direct enzyme effects from docking (structure-based predictions)
- Indirect community effects from literature (community interactions, substrate availability)
Metabolite Exchange: Models inter-species metabolite sharing (Hβ, COβ, formate, amino acids, etc.) to create a true community model rather than three separate models.
Installation
Prerequisites
- Python 3.7 or higher
- GAMSpy Academic License (free for academic use)
Step 1: Install Python Packages
pip install pandas python-libsbml gamspy
Step 2: Register for GAMSpy License
- Register for a free academic license at: https://academic.gams.com/
- Install your license:
gamspy install license <your-gamspy-license>
Running the Model
Basic Usage
- Navigate to the project directory:
cd CowmunityModel
- Run the main script:
python main.py
- Select a treatment option when prompted:
0: No treatment (baseline)1: Imidazole2: L-Carnitine3: Methyl Jasmonate4: Propylpyrazine
What Happens When You Run
The model will:
- Load and process the three SBML metabolic models
- Set up community exchange constraints
- Apply treatment-specific constraints (docking-based + literature-based)
- Solve the bilevel optimization problem
- Save results to
results/directory - Display key outputs (biomass, methane flux)
Output
Results are saved in results/variable_methane_{treatment}_treatment/:
mgk_records.csv- All reaction fluxes for M. Gottschalkiiprm_records.csv- All reaction fluxes for P. ruminicolarfl_records.csv- All reaction fluxes for R. flavefaciens
Project Structure
CowmunityModel/
βββ main.py # Main entry point
βββ Cowmunity.py # Core model implementation
βββ cow.txt # ASCII art (optional)
βββ model files/ # SBML metabolic models
β βββ M. gottschalkii.xml
β βββ P. ruminicola.xml
β βββ R. flavefaciens.xml
βββ docking_integration/ # Docking integration module
β βββ apply_docking_constraints.py
β βββ parse_docking_results.py
β βββ enzyme_reaction_mapper.py
βββ docking_data/ # Docking results
βββ cleaned_docking_results.csv
Key Features
- Bilevel Optimization: Outer problem maximizes community biomass; inner problems optimize individual species
- Structure-Based Predictions: Uses molecular docking data to predict enzyme inhibition
- Community Interactions: Models metabolite exchange between species
- Combined Constraints: Integrates docking predictions with literature-based effects
- Flexible Treatments: Test multiple small molecule treatments
Dependencies
pandas- Data manipulationpython-libsbml- SBML model parsinggamspy- Optimization framework (requires academic license)
litreture model
- To access litreture based model, simply use the model with litreture name on it.
Model Units
- Fluxes: mmol/gDCWΒ·hr (millimoles per gram dry cell weight per hour)
- Biomass: gDCW/gDCWΒ·hr (grams dry cell weight per gram dry cell weight per hour)
- Methane: mmol/gDCWΒ·hr (can be converted to ml/gDCWΒ·hr)
Citation
If you use this model, please cite us:
Authors
Troubleshooting
GAMSpy License Issues
- Ensure you have registered for an academic license
- Check that your license is properly installed:
gamspy license status
Missing Files
- Ensure all SBML model files are in the
model files/directory - Check that
docking_data/cleaned_docking_results.csvexists for docking-based treatments
Solver Issues
- Default solver is IPOPT. If issues occur, ensure IPOPT is properly installed with GAMSpy
- Model solve time is limited to 20 seconds by default (can be modified in
Cowmunity.py)
Contact
For questions or issues, please contact [email protected]