biosystemsum / mewpy Goto Github PK
View Code? Open in Web Editor NEWMetabolic Engineering Workbench
Home Page: https://mewpy.readthedocs.io
License: GNU General Public License v3.0
Metabolic Engineering Workbench
Home Page: https://mewpy.readthedocs.io
License: GNU General Public License v3.0
TypeError Traceback (most recent call last)
Cell In [162], line 2
1 # run the optimization
----> 2 ea = EA(problem, max_generations= 100, visualizer=True)
3 final_pop = ea.run()
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\mewpy\optimization_init_.py:154, in EA(problem, initial_population, max_generations, mp, visualizer, algorithm, **kwargs)
151 else:
152 engine = engines[engs[0]]
--> 154 return engine(problem, initial_population=initial_population, max_generations=max_generations, mp=mp,
155 visualizer=visualizer, algorithm=algorithm, **kwargs)
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\mewpy\optimization\jmetal\ea.py:71, in EA.init(self, problem, initial_population, max_generations, mp, visualizer, algorithm, **kwargs)
69 self.ea_problem = JMetalKOProblem(self.problem, self.initial_population)
70 else:
---> 71 self.ea_problem = JMetalOUProblem(self.problem, self.initial_population)
72 self.crossover, self.mutation = self.ea_problem.build_operators()
73 self.population_size = kwargs.get('population_size', get_population_size())
TypeError: Can't instantiate abstract class JMetalOUProblem with abstract methods name, number_of_constraints, number_of_objectives, number_of_variables
Hi,
Following your tutorial for enzymatic constraints, I get error for loading GECKO model: "KeyError: 'model name must be one of ", using either the provided model in the repository or an external model. The path to the .xml file is also correct.
Thanks.
I ran the example of OptRAM in the documentation (https://mewpy.readthedocs.io/en/latest/problems.html) and the examples in the code (the two codes are slightly different), both runs resulted in errors, what is the reason?
Hi, I see the following error message:
ImportError Traceback (most recent call last)
in
16
17 # build a new problem instance for enzymatic OU
---> 18 from mewpy.problems import GeckoROUProblem
19 problem = GeckoROUProblem(model, fevaluation=[
20 evaluator_1, evaluator_2], envcond=envcond)
ImportError: cannot import name 'GeckoROUProblem' from 'mewpy.problems' (C:\Users\anaconda3\lib\site-packages\mewpy\problems_init_.py)
Thanks.
Hello @vvvieira, @jorgemlferreira and the MEWpy team,
First, I'd like to express my appreciation for the tool your group has developed for in-silico metabolic modeling and engineering. It appears to be a fine tool for researchers in the field.
I have been following the tutorial to perform modeling analysis on a community of twelve microbes. However, I am encountering several issues that I hope you can help me resolve. Despite referring to the documentation, I find it limited for community analysis.
Issues Encountered:
Difficulty Constraining the Community Model:
After building a community model of the twelve GEMs, I am unable to effectively constrain the model. The new model seems to lack bounds or reaction IDs as seen in COBRA models. Consequently, the community model exhibits unrealistically high growth rates since virtually all reactions have infinite bounds. How can I properly set bounds and identify reactions within the community model?
AttributeError in SteadyCom Function:
When attempting to run the SteadyCom function, I encounter the following error:
AttributeError: 'Simulation' object has no attribute 'get_community_model'
I am unsure how to troubleshoot this issue. Any guidance on properly running SteadyCom would be greatly appreciated.
Here is the code I am using:
import mewpy
from cobra.io import read_sbml_model
from mewpy import get_simulator
# Load the twelve GEMs
models = []
model_paths = [
'~/Dehalobacter_restrictus_cur.xml',
'/~Dehalobacter_sp004343605_cur.xml',
'~/`Acetobacterium_sp003260995.xml',
'~/f__Cloacimonadaceae_g__Cloacimonas_s__.xml',
'~/g__Methanothrix_s__.xml',
'~/Methanobacterium_C_congolense.xml',
'~/o__Bacteroidales_f__TTA-H9_g__TTA-H9_s__TTA-H9_sp002418865.xml',
'~/o__Bacteroidales_f__VadinHA17_g__LD21_s__.xml',
'~/o__Bacteroidales_f__VadinHA17_g__SR-FBR-E99_s__.xml',
'~/Rectinema_sp002441395.xml',
'~/Rectinema_sp015657395.xml',
'~/Rectinema_subterraneum.xml'
]
for path in model_paths:
model = read_sbml_model(path)
models.append(get_simulator(model))
# Set medium composition
new_medium = {
'EX_cpd00001_e0': 1000.0,
'EX_cpd00011_e0': 50.0, # CO2
'EX_cpd11640_e0': 100.0,
'EX_cpd00009_e0': 100.0,
'EX_cpd00030_e0': 100.0,
'EX_cpd00034_e0': 100.0,
'EX_cpd00048_e0': 100.0,
'EX_cpd00058_e0': 100.0,
'EX_cpd00063_e0': 100.0,
'EX_cpd00067_e0': 0.1,
'EX_cpd00099_e0': 100.0,
'EX_cpd00149_e0': 100.0,
'EX_cpd00205_e0': 100.0,
'EX_cpd00254_e0': 100.0,
'EX_cpd00971_e0': 100.0,
'EX_cpd10515_e0': 100.0,
'EX_cpd10516_e0': 0.01,
'EX_cpd00013_e0': 100.0,
'EX_cpd00244_e0': 100.0,
'EX_cpd03998_e0': 25.0, # TCB
'EX_cpd00116_e0': 25.0, # Methanol
'EX_cpd00007_e0': 0.0, # O2
}
# Build community model
from mewpy.model import CommunityModel
community = CommunityModel([sim.model for sim in models], flavor='cobra')
# Set bounds for reactions in the community model
for reaction in sim.reactions:
if hasattr(reaction, 'lower_bound') and hasattr(reaction, 'upper_bound'):
lb = max(reaction.lower_bound, -1000)
ub = min(reaction.upper_bound, 1000)
# Using set_reaction_bounds method to set the bounds
sim.set_reaction_bounds(reaction.id, lb, ub, track=True)
else:
print(f"Skipping non-reaction object: {reaction}")
# Perform pFBA simulation
from mewpy.simulation import SimulationMethod
solution = sim.simulate(method=SimulationMethod.pFBA)
solution
# Run SteadyCom
from mewpy.cobra.com import SteadyCom
solution = SteadyCom(sim, constraints=new_medium)
print("Community growth rate:", solution.community_growth)
print("Species abundances:", solution.abundances)
Could you please provide guidance on how to properly constrain the community model and troubleshoot the AttributeError in the SteadyCom function? Any additional documentation or examples specific to community analysis would be greatly appreciated.
Thank you for your assistance!
Hi, I see the following error:
~\anaconda3\lib\site-packages\mewpy\simulation\cobra.py in
4 from cobra.core.model import Model
5 from cobra.core.solution import Solution
----> 6 from geckopy.gecko import GeckoModel
7 from cobra.flux_analysis import pfba, moma, room
8 from mewpy.simulation import SimulationMethod, SStatus
ModuleNotFoundError: No module named 'geckopy'
Thanks.
Hi, mewpy team! I have a problem running gene and reaction essentiality function. I used a GSM model with integrated transcriptomic data using RIPTiDe method. So, the analysis for initial model (without transcriptomics data) showes a list of essential genes and reactions but the list is blanked for the transcriptomics-guided model. Moreover, Cobrapy and Optflux functions for the same analysis returns non-zero list of genes/reactions for the last version of the model. In addition to that, the old mewpy version 0.1.11 found them too. Can you give a cue, where is a problem?
Thanks in advance for your reply!
Hello. I installed mewpy through pip install- it installed the dependencies like cobra, but the modules for mewpy cannot be imported:
ModuleNotFoundError: No module named 'mewpy'
It is in my pip list, so I assume the problem's somewhere else?
This applies to all its modules, I reinstalled this package github, too, but it is not working yet.
Hello @vmspereira,
Thanks for creating this tool! I have been able to generate GIMME and E-Flux solutions on my transcriptomic data, but was wondering if there was a way to convert these objects into a useable cobra model that retains the flux values + objective provided in the solution. I've tried to copy the original model, add in the solution-defined constraints, and remove reactions with zero flux, but the objective repeatedly remains unchanged. Additionally, in the case of E-Flux, when I execute the protocol above, I'm left with a model of objective 0.0, with all reactions having zero flux.
If you have any feedback regarding this, please let me know. Thanks again!
Best,
Rohak
Hello!
I'm trying to build a tissue-specific model using the Gimme algorithm, but the resulting model cannot grow. I was looking at the test of Gimme, and they are incomplete for the build model option.
Can you help me with this?
Boa tarde,
Envio em anexo o modelo metabólico obtido pela app modelSeed na kbase, o qual segundo o FBA da plataforma indica um fluxo de biomassa de cerca de 19 em meio completo. Contudo, o mewpy indica "None" quando o objetivo definido é a biomassa.
M_formicicum_complete_media.SBML (1).zip
Hi Vitor,
Is there an option to simplify the solution pool after optimization? In the final population I often see many solutions with same fitness value and different number of knockouts.
Best regards,
Daniel
Hi Vitor,
When I use the visualizer option I get the following error:
~/miniconda/miniconda3/envs/py36/lib/python3.6/site-packages/mewpy/optimization/ea.py in dominance_test(solution1, solution2, maximize)
176 best_is_two = 0
177
--> 178 for i in range(len(solution1.fitness)):
179 value1 = solution1.fitness[i]
180 value2 = solution2.fitness[i]
AttributeError: 'KOSolution' object has no attribute 'fitness'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.