Giter VIP home page Giter VIP logo

mewpy's People

Contributors

cruz-f avatar vmspereira avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mewpy's Issues

problem in optimization

Hi, I encountered this error while trying to define a new reaction over/under expression problem instance.

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

Error in loading GECKO Model

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.

ROU optimization

Hi,

I wanted to ask what the numbers in front of reactions in the modification part actually mean?
image

GKOProblem problem

For the GKOProblem problem, it takes too long to calculate essential genes ( for iML1515 model), so why not just use the find_essential_genes function in the COBRApy, which gets results in seconds.
image

Error in (from mewpy.problems import GeckoROUProblem)

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.

Issues with Community Modeling and SteadyCom Function in MEWpy

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!

Error in (from mewpy.regulation.optram import OptRamProblem, load_optram)

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.

gene/reaction essential function problem

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!

The modules cannot be imported

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.

Convert Omics Solution to Cobra Model

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

Build model Gimme

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?

Kbase ModelSeed

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

image

Simplify solutions

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

error with visualizer=True

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'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.