Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 03 14:54

    phantomas1234 on gh-pages

    Deploy cameo.bio to github.com/… (compare)

  • Dec 03 13:43
    mcampodonico added as member
  • Dec 03 13:43
    mcampodonico added as member
  • Dec 02 10:40

    phantomas1234 on gh-pages

    Deploy cameo.bio to github.com/… (compare)

  • Nov 26 14:51

    phantomas1234 on gh-pages

    Deploy cameo.bio to github.com/… (compare)

  • Nov 25 10:39

    phantomas1234 on gh-pages

    Deploy cameo.bio to github.com/… (compare)

  • Nov 19 14:53

    phantomas1234 on gh-pages

    Deploy cameo.bio to github.com/… (compare)

  • Nov 18 10:38

    phantomas1234 on gh-pages

    Deploy cameo.bio to github.com/… (compare)

  • Nov 12 14:50

    phantomas1234 on gh-pages

    Deploy cameo.bio to github.com/… (compare)

  • Nov 11 10:37

    phantomas1234 on gh-pages

    Deploy cameo.bio to github.com/… (compare)

  • Nov 05 15:38

    phantomas1234 on gh-pages

    Deploy cameo.bio to github.com/… (compare)

  • Nov 04 10:38

    phantomas1234 on gh-pages

    Deploy cameo.bio to github.com/… (compare)

  • Oct 29 14:50

    phantomas1234 on gh-pages

    Deploy cameo.bio to github.com/… (compare)

  • Oct 28 10:37

    phantomas1234 on gh-pages

    Deploy cameo.bio to github.com/… (compare)

  • Oct 22 14:48

    phantomas1234 on gh-pages

    Deploy cameo.bio to github.com/… (compare)

  • Oct 21 10:36

    phantomas1234 on gh-pages

    Deploy cameo.bio to github.com/… (compare)

  • Oct 15 14:50

    phantomas1234 on gh-pages

    Deploy cameo.bio to github.com/… (compare)

  • Oct 14 10:35

    phantomas1234 on gh-pages

    Deploy cameo.bio to github.com/… (compare)

  • Oct 08 14:50

    phantomas1234 on gh-pages

    Deploy cameo.bio to github.com/… (compare)

  • Oct 08 12:11
    kvikshaug opened #249
Astrid-42
@Astrid-42
@phantomas1234 Many thanks! @sgalkina I created an issue with the name 'OptKnock error' and attached both model and code. Thanks a lot for your help!
João Gonçalo Rocha Cardoso
@joaocardoso
@Astrid-42: regarding your problem with OptGene. One thing you did was to set the biomass as a metabolite. In COBRA models (like iJO1366 or iMM904) there is no biomass metabolite. The variables of the model are reactions. You can set the 'r_2111' as biomass given the constitution of the model, it will serve it's purpose.
Regarding OptKnock, I am still trying to reproduce your error
A few notes on that model
it has 3493 reactions, of which 1513 are coupled.
if you run OptKnock without the null space simplification it will take a very long time, it it works at all
João Gonçalo Rocha Cardoso
@joaocardoso
the null space simplification will reduce those 1513 reactions to ~500 variables
I left OptKnock building the problem on my computer, I'll update you when I have news
Astrid-42
@Astrid-42
@joaocardoso Many many thanks for having a look!
-for OptGene: I tried with the biomass reaction first, then tried with the metabolite (I understood that both is possible). But it didn't solve the problem.
-for OptKnock: I tried with the simplification at first of course, but it seemed to abort with an error in the middle of doing some simplifications of the model. Therefore we tried to switch that off, but both didn't work sadly.
Many thanks, please keep me in the loop! It would be great if you could understand the problem.
João Gonçalo Rocha Cardoso
@joaocardoso
@Astrid-42 I managed to reproduce your error. I’ll explore a solution soon. I am attending a conference today and tomorrow and I’ll try a few different things on Monday when I am back in the office
Astrid-42
@Astrid-42
@joaocardoso Thanks a lot, good to know you get the same error and I would be very happy to hear back from you next week. Much fun at the conference!
Astrid-42
@Astrid-42
@joaocardoso Any solution yet? My deadline is actually Thursday, do you think there is a chance to get cameo to run by then? I would be really happy to know why OptKnock/-Gene don't work. Many thanks!
João Gonçalo Rocha Cardoso
@joaocardoso
Hi @Astrid-42! Unfortunately I have been sick in bed for the past few days. I gave some though and I think your fraction_of_optimum can be the problem. I’ll test it myself, but you are setting the model objective to be a number below the solver precision and that’s usually recipe for disaster. I’ll be back in the office tomorrow and I will try to assess that myself.
Astrid-42
@Astrid-42
Hey @joaocardoso , I am sorry to hear you were sick, hopefully you feel totally fit again soon! I set the fraction_of_optimum very low to see if with very very low requirements I could avoid the "unfeasible solution" error, but as you see it didn't help. I did not think of disaster-associated below-solver-precision issues, very good advice :smile: But unfortunately, also with fraction_of_optimum=0.1 or = 0.01 I still get an error, "solver status is 'infeasible'".
João Gonçalo Rocha Cardoso
@joaocardoso
Hi @Astrid-42. I already verified that. I am trying to find out where things changed. So far I can run the find_essential_reactionsmethod outside of OptKnock and it does not crash.
João Gonçalo Rocha Cardoso
@joaocardoso
I think I finally found the problem. The biomass reaction contains metabolites with stoichiometric coefficients at the solver precision s_0509 and s_3714
when you use OptKnock it increases the solver precision to 1e-8 (1e-6 is the default precision) and the biomass r_4041 becomes invalid
Two solutions: 1. remove those from the biomass, 2. use an alternative biomass (r_2133 or r_2110)
Astrid-42
@Astrid-42
@joaocardoso Thanks a lot! Sounds promising! Stupid question for solution two: How can I change the biomass reaction for the OptKnock( ...) command? I can not find an argument for that?
João Gonçalo Rocha Cardoso
@joaocardoso
You change the bounds of the original biomass equation r_4041 to zero and the upper bound of one of this (r_2133 or r_2110) to 1000
Astrid-42
@Astrid-42
Hi @joaocardoso ! I tried what you suggested, but with r_4041 and r_2133 set to zero and only using r_2110 (no boundaries) ...
optknock = OptKnock(model, fraction_of_optimum=0.1, use_nullspace_simplification=False)
works fine, but when running ...
result = optknock.run(max_knockouts=3,
target='r_4054',
biomass='r_2110')
I get the error KeyError: 'r_2110'. Same if I replace biomass='r_2110' with biomass='r_2111' or biomass='s_0450'.
João Gonçalo Rocha Cardoso
@joaocardoso
ok, I'll check that quickly
Nikolaus Sonnenschein
@phantomas1234
@Astrid-42 what version of CPLEX are you using? Working on a different model that lead to an infeasibility, I discovered that after upgrading to CPLEX 12.7.1 the problem disappeared.
Snorre Sulheim
@sulheim
Is it possible to parallelize optknock in Cameo?
Kristian Jensen
@KristianJensen
Some solvers (e.g. cplex) will be able to run the MILP optimization multithreaded, but apart from that the algorithm is not parallelizable
Snorre Sulheim
@sulheim
okey, so as long as I use cplex all available cores will be utilized, or how do I soecify this for CPLEX?
Kristian Jensen
@KristianJensen
Snorre Sulheim
@sulheim
Thanks, @KristianJensen . It is just that I try to run it on one node of a HPC-platform, and I am not impressed by the speed :(
Snorre Sulheim
@sulheim
Is it a bug in OptKnock? the default value is 'exclude_non_gene_reactions=True', however it still suggests to knock out some exchange reactions
Kristian Jensen
@KristianJensen
That should not happen. Can you paste the output you get?
Snorre Sulheim
@sulheim
Among other suggested knockouts I get EX_nh4_e
Snorre Sulheim
@sulheim
When I run OptKnock with Cameo I results where the minimal flux of the target reaction is 0, but I only want the non-zero results. Any Ideas? Matlab provide these results
Kristian Jensen
@KristianJensen
@sulheim OptKnock optimizes the maximum flux of the target reaction under optimal growth, without regard to the minimum flux of the target. If you generate many different designs with OptKnock it might be that some of them have a non-zero minimal flux. If this is not the case you can have a look a RobustKnock which specifically optimizes the minimal flux of the target. However this is not implemented in cameo
ACab
@ACabbia
Hi all, I am trying to compute Elementary Flux Modes (EFMs) with the function MinimalCutSetsEnumerator from cameo.flux_analysis.structural , but I still can't understand what's the correct input for the targets argument, can anyone clarify? Thanks!
Nikolaus Sonnenschein
@phantomas1234
@Andr3aCbb, the MinimalCutSetsEnumeratorstill needs a lot work and testing. @KristianJensen probably knows more but he is also writing his thesis right now. As far as I can see from the code it can be a constraint (which you could construct with model.solver.interface.Constraint etc.) to describe the desired behavior. If you want to calculate EFMs, wouldn't you want to use ShortestElementaryFluxModes actually?
@/all please upgrade to 0.11.7 in case you upgraded cobrapy recently and ran into problems with the recently deprecated solution.f and solution.x_dict attributes in cobrapy
Reza Hafidz Sukamto
@Rezhafs_twitter
Hi everyone, I am really a beginner in python and also cameo, but I want to try on optknock and optgene analysis. So I was trying to load a model from website, but it returned <Model iMM904 at 0x7fc6323e74d0>, instead of model's details. How it could happen, and how to solve it? Thanks!
Nikolaus Sonnenschein
@phantomas1234
@Rezhafs_twitter you would only see the model details if you're running this in a Jupyter notebook. Did you maybe run the commands in script or IPython shell?
hongzhonglu
@hongzhonglu
Hi Everyone, recently I run the tutorial of optGene from cameo. For the solver, I use gurobi method. Then I find that the result I obtained is different from that shown in the tutorial (http://cameo.bio/05-predict-gene-knockout-strategies.html#optknock). This is my code:

prepare model

model = models.bigg.iJO1366
model.solver = 'gurobi'

optimization

wt_solution = model.optimize()
model.summary()
growth = wt_solution.fluxes["BIOMASS_Ec_iJO1366_core_53p95M"]
acetate_production = wt_solution.fluxes["EX_ac_e"]
p = phenotypic_phase_plane(model, variables=['BIOMASS_Ec_iJO1366_core_53p95M'], objective='EX_ac_e')

result = p.data_frame
g_range = result['BIOMASS_Ec_iJO1366_core_53p95M']
p_range = result['objective_upper_bound']
plt.plot(g_range, p_range, 'k', color='blue')

optgene = OptGene(model)

result = optgene.run(target=model.reactions.EX_ac_e,
biomass=model.reactions.BIOMASS_Ec_iJO1366_core_53p95M,
substrate=model.metabolites.glc__D_e,
max_evaluations=5000,
plot=False)

This is my result:
reactions    genes    size    fva_min    fva_max    target_flux    biomass_flux    yield    fitness
0 ('ATPS4rpp', 'PSP_L') (('b4388', 'b3735'),) 2 0 14.97629611 12.80217508 0.388364968 1.280217508 0.497191669
1 ('MTHFC', 'ATPS4rpp', 'MTHFD') (('b0529', 'b3735'), ('b0529', 'b3731')) 2 0 14.55261929 14.19717907 0.394890711 1.419717907 0.560633821
2 ('PGCD', 'ATPS4rpp') (('b2913', 'b3735'),) 2 0 14.97629611 13.94679654 0.388364968 1.394679654 0.541644782
Do you know the reason? Thanks very much.
Nikolaus Sonnenschein
@phantomas1234
@hongzhonglu optgene is not deterministic since it uses heuristic optimization, so everytime you run it you will very likely obtain a different solution. Unfortunately, we never managed to allow the user to seed the random number generator to make it deterministic due to technical problems.
hongzhonglu
@hongzhonglu
Great thanks for you help!
Baudoin Delépine
@bdelepine
Hello! I have a question about FSEOF from ameo.strain_design.deterministic.flux_variability_based. The last step of the FESOF.run() is to filter the results (line 977). This is used obviously to remove the reactions from the exclude parameter, but there are two other criteria to keep the reaction:
  • min(fluxes) * max(fluxes) >= 0
  • and max(abs(max(fluxes)), abs(min(fluxes))) > abs(reference[reaction_id])
    I do not understand why those tests are legit. Could someone help me on that?