Recent Releases of cobra
cobra - 0.29.1
Release notes for cobrapy 0.29.1
New features
Fixes
- Fixes the incorrect bounds in the CycleFree loop removal.
- Fixes reduced costs and shadow prices not available when using non-convex models.
- Fixed a bug with SBML group parsing that affects the Debian package.
- Fixed a bug where loadmatlabmodel would not work with numpy 2.0.
Other
- Adding a duplicate boundary reaction (with
add_boundary) no longer errors, but instead just returns the existing reaction. - Automatic detection of the external compartment now recognizes CARVEME and GAPSEQ ids and will no longer show a warning for models generated with those tools.
Deprecated features
Backwards incompatible changes
- Python
Published by github-actions[bot] over 1 year ago
cobra - 0.29.0
Release notes for cobrapy 0.29.0
New features
- Added a new "hybrid" solver that exposes an HIGHS/OSQP combinations for large scale LPs, MILPs, and QPs.
Fixes
Repaired the broken Biomodels Web IO.
Other
Deprecated features
- The OSQP solver is deprecated in favor of the hybrid solver which also uses OSQP but
will not attempt to solve LPs with OSQP anymore. Setting the
model.solver = "osqp"will now use the hybrid interface and will raise an error in a future release.
Backwards incompatible changes
- Python
Published by github-actions[bot] over 2 years ago
cobra - 0.27.0
Release notes for cobrapy 0.27.0
New features
Fixes
COBRApy is now compatible with pydantic version 2.
COBRApy is now compatible with the latest numpy versions and pin to a lower version has been removed.
loopless_solution now fixes the objective to its optimum as in the
originally published method and returns the objective value in the solution object.
Repair a broken test for fix_objective_as_constraint.
Other
Backwards compatibility for pickled models has been improved.
Deprecated features
Backwards incompatible changes
- Python
Published by github-actions[bot] over 2 years ago
cobra - 0.26.3
Release notes for cobrapy 0.26.3
New features
Fixes
Fixed an issue where reaction bounds were being overwritten by global model min/max values when writing sbml model to file. See #1300.
Fix an issue where runfrog does
not work via github actions or local installation by removing the use of obsolete numpy
aliases for float and bool.
Fix a bug where installing httpx>=0.24 would break cobrapy IO.
Other
Deprecated features
Backwards incompatible changes
- Python
Published by github-actions[bot] about 3 years ago
cobra - 0.26.1
Release notes for cobrapy 0.26.1
New features
Fixes
Fix automatic building of the documentation.
Fix an issue where SBML models with a "created" date would break lots of the cobrapy functionality.
Temporary fix of restricting numpy to <1.24 as that release introduces breaking changes both in cobrapy and dependencies
Other
Deprecated features
Backwards incompatible changes
- Python
Published by github-actions[bot] over 3 years ago
cobra - 0.26.0
Release notes for cobrapy 0.26.0
New features
- View number of genes in model notebook representation.
- added support for Python 3.11
Fixes
- serializes GPRs to strings to avoid massive storage usage
- Reformatted example files (ecolicore.xml, mini_cobra.xml, mini.json, mini.yml, textbook.xml.gz) to be more compliant with identifiers.org.
- ncbigi is not a valid identifiers.org, so it was replaced with ncbiprotein.
- make sbml.py subsystem reading add partonomy, which matches the definition of SBO:0000633 (see https://sourceforge.net/p/sbo/term-request/113/)
- Correct reading and writing of subsystem in mat.
- General cleanup of code in mat.py
- fix the pandas deprecation warning in
find_external_compartment - fix an issue where creating a Formula object would give a recursion error
Other
- Resolve
flake8issues and add missing type annotations and docstrings insrc/cobra/ioandtests/test_io(#1212). - Updated model.py and test_model.py to Python 3.6+, including type annotations and docstrings.
- Resolve remaining
flake8issues and enable the check in GitHub Actions Lint workflow (#1272).
Deprecated features
- dropped support for Python 3.6
Backwards incompatible changes
- Removed
model.add_reaction()and replaced remaining usages of it withmodel.add_reactions() - Removed the following tests: testaddremovereactionbenchmark, testaddreaction, testaddreactioncontext, testaddreactionfromothermodel, testaddcobra_reaction
- Removed
model.__add__andmodel.__iadd__- usemodel.mergeto replace them. - Remove
Model().description(). - Remove
Model().get_metabolite_compartments().
- Python
Published by github-actions[bot] over 3 years ago
cobra - 0.25.0
Release notes for cobrapy 0.25.0
New features
- Add
knock_out_model_genesto simulate knock-outs, setting reaction bounds of affected reactions to zero and returning a list of reactions that were knocked-out. Replacesdelete_model_genesandundelete_model_genessince it is context sensitive. - Improve reading of matlab models which will include metabolite and reaction annotations.
Fixes
model.copy()will now correctly copy GPRs.- Fix an error where matlab models can not be read if their bounds exceed the configuration default in some cases.
- Fixed some bugs in
GPR().from_string()where it was using the unmodified string, leading to errors withGPRs that should work. MadeGPRs that have empty parenthesis fail more comprehensibly.
Other
- Move tests to a different directory, from
src/cobra/testtotests(#1191). - Add two tests for
GPRfixes:test_gpr_wrong_input()test_gpr_that_needs_two_replacements()
- Clean up Python syntax (#1152, #1153, #1171, #1173, #1182)
Deprecated features
- Deprecate
delete_model_genes,undelete_model_genes
Backwards incompatible changes
- Remove
find_gene_knockout_reactionsfromdelete.py - Remove
_find_gene_knockout_reactions_fast,_gene_knockout_computation,_get_removedfromtest_delete.py - Remove
pymatlibdirect transfer of models to matlab process. Please usesave_matlab_model()and then read the model in matlab.
- Python
Published by github-actions[bot] about 4 years ago
cobra -
Release notes for cobrapy 0.24.0
New features
- Gene-protein-reaction association rules are now represented by a structured object
GPR.Reaction.gene_reaction_rulestill returns a string and a string can be assigned to it that will modify the underlyingGPRinstance. - The
Reactionclass has gained another attributeReaction.gprwhich allows direct access to theGPRinstance (#1143).
Fixes
- Syntax update and type annotations (#1151).
- Python
Published by Midnighter about 4 years ago
cobra - 0.23.0
Release notes for cobrapy 0.23.0
Fixes
- Make compatible with Python 3.10
- Use the internal semantic GPR parser in the SBML module
- Setting a growth medium will not reset export flux bounds anymore
Other
- Clean up code (#1116, #1114, #1113, #1111, #1110, #1097)
- Python
Published by github-actions[bot] over 4 years ago
cobra - 0.22.1
Release notes for cobrapy 0.22.1
Fixes
- Fix an old bug with double gene deletion that was not knocking-out combinations (#1103).
- Lots of syntax, annotation, and docstring fixes (#1081, #1083, #1084, #1085, #1086, #1088, #1090, #1091, #1092, #1093, #1094, #1095, #1096).
Deprecated features
find_gene_knockout_reactionsis deprecated.
- Python
Published by github-actions[bot] almost 5 years ago
cobra - 0.22.0
Release notes for cobrapy 0.22.0
New features
- Add support for the OSQP and COIN-OR CBC solvers (#946)
Fixes
- Fix the
Reaction.compartmentsattribute not updating after metabolite changes (#1055) - Lots of syntax, annotation, and docstring fixes (#1058, #1059, #1060, #1063, #1065, #1066, #1076, #1077, #1080)
- Multiprocessing on windows now sends data to processes via a pickle file which should speed up any multiprocessing initialization (#1070)
- Upgrade optlang and fix some tolerance issues (#1011)
- Enable Python 3.9 (#1082)
Documentation
- Document boundary reactions (#1038)
- Documentation is now built again on each release (#1047)
- Clarify pfba in the documentation (#1049)
Other
- COBRApy source code releases are now deposited on Zenodo which provides a citeable DOI (#1061)
- COBRApy creates automatic releases to BioSimulators (#1064)
- Fix deployment of releases to the website (#1068)
- Improve the
pyproject.tomlconfig (#1067)
Backwards incompatible changes
- Remove some particular
cobra.Reaction.lower_boundand.upper_boundbehaviour that has been deprecated for a long time.
- Python
Published by github-actions[bot] about 5 years ago
cobra - 0.20.0
Release notes for cobrapy 0.20.0
New features
There is a new function inspired by cameo that can load models directly from BiGG or BioModels and by default will cache them locally (#995), for example,
```py from cobra.io import load_model
ecoli = loadmodel("iML1515") ylipo = loadmodel("MODEL1604280017") ```
Fixes
- Over a series of pull requests, @synchon has been modernizing parts of the codebase for Python 3.6+ (#993, #999, #1000, #1003)
- Upgrade the dependency python-libsbml-experimental to 5.18.3
- Python
Published by github-actions[bot] over 5 years ago
cobra - 0.18.0
Release notes for cobrapy 0.18.0
New features
- Support writing SBML notes on model objects
Fixes
- Test alternative solver
- Handle repeated infeasible optimizations in
minimal_medium - Allow newline characters in SBML notes
Backwards incompatible changes
- Change the container type of
groupsfromsettoDictList - Expect annotation attributes to be of type
dict
Internal
- Update Travis CI configuration
- Add Python 3.8 to PyPI classifiers
Contributors
- @BenjaSanchez
- @cdiener
- @ecederstrand
- @Hemant27031999
- Python
Published by Midnighter almost 6 years ago
cobra - 0.19.0
Release notes for cobrapy 0.19.0
We now have an official code of conduct and a committee of three people to handle reports! You can contact them at conduct@opencobra.org. You can also contact them individually at:
Many thanks to them for taking on this responsibility.
New features
- Deletion result DataFrames as returned by functions from
cobra.deletionsnow have a newknockoutaccessor. See the docs on usage examples. - All summaries are now persistent objects. The same summary can be displayed in multiple ways. The underlying data for the summary can also be accessed.
- The model summary now displays elementary (by default carbon) uptake and secretion.
- The JSON schema is now available as a stand-alone JSON file.
Fixes
- Remove the frozenset indexing in deletion DataFrames that is now unsupported in pandas.
- Summaries for models, metabolites, and reactions are now calculated instantaneously and thus also work with model contexts.
- JSON models can now contain infinity and NaN values as bounds.
- The Matlab bridge for reading Matlab models should be restored. Any testing or problem reports are greatly appreciated.
Deprecated features
- We are progressively updating our codebase. That means that more and more parts will require Python 3.6+.
Backwards incompatible changes
- Deletion result DataFrames have no frozenset index anymore but now carry the
deleted elements in the
idscolumn.
- Python
Published by Midnighter almost 6 years ago
cobra - https://github.com/opencobra/cobrapy/releases/tag/0.17.1
Please see https://github.com/opencobra/cobrapy/tree/0.17.1/release-notes/0.17.1.md for the full release notes.
- Python
Published by cobrapy-bot over 6 years ago
cobra - https://github.com/opencobra/cobrapy/releases/tag/0.17.0
Please see https://github.com/opencobra/cobrapy/tree/0.17.0/release-notes/0.17.0.md for the full release notes.
- Python
Published by cobrapy-bot over 6 years ago
cobra - https://github.com/opencobra/cobrapy/releases/tag/0.16.0
Please see https://github.com/opencobra/cobrapy/tree/0.16.0/release-notes/0.16.0.md for the full release notes.
- Python
Published by cobrapy-bot almost 7 years ago
cobra - https://github.com/opencobra/cobrapy/releases/tag/0.15.4
Please see https://github.com/opencobra/cobrapy/tree/0.15.4/release-notes/0.15.4.md for the full release notes.
- Python
Published by cobrapy-bot almost 7 years ago
cobra - https://github.com/opencobra/cobrapy/releases/tag/0.15.3
Please see https://github.com/opencobra/cobrapy/tree/0.15.3/release-notes/0.15.3.md for the full release notes.
- Python
Published by cobrapy-bot about 7 years ago
cobra - https://github.com/opencobra/cobrapy/releases/tag/0.15.2
Please see https://github.com/opencobra/cobrapy/tree/0.15.2/release-notes/0.15.2.md for the full release notes.
- Python
Published by cobrapy-bot about 7 years ago
cobra - https://github.com/opencobra/cobrapy/releases/tag/0.15.1
Please see https://github.com/opencobra/cobrapy/tree/0.15.1/release-notes/0.15.1.md for the full release notes.
- Python
Published by cobrapy-bot about 7 years ago
cobra - https://github.com/opencobra/cobrapy/releases/tag/0.14.2
Please see https://github.com/opencobra/cobrapy/tree/0.14.2/release-notes/0.14.2.md for the full release notes.
- Python
Published by cobrapy-bot over 7 years ago
cobra - https://github.com/opencobra/cobrapy/releases/tag/0.14.1
Please see https://github.com/opencobra/cobrapy/tree/0.14.1/release-notes/0.14.1.md for the full release notes.
- Python
Published by cobrapy-bot over 7 years ago
cobra - https://github.com/opencobra/cobrapy/releases/tag/0.14.0
Please see https://github.com/opencobra/cobrapy/tree/0.14.0/release-notes/0.14.0.md for the full release notes.
- Python
Published by cobrapy-bot over 7 years ago
cobra - https://github.com/opencobra/cobrapy/releases/tag/0.13.4
Please see https://github.com/opencobra/cobrapy/tree/0.13.4/release-notes/0.13.4.md for the full release notes.
- Python
Published by cobrapy-bot almost 8 years ago
cobra - https://github.com/opencobra/cobrapy/releases/tag/0.13.3
Please see https://github.com/opencobra/cobrapy/tree/0.13.3/release-notes/0.13.3.md for the full release notes.
- Python
Published by cobrapy-bot almost 8 years ago
cobra - https://github.com/opencobra/cobrapy/releases/tag/0.13.0
Please see https://github.com/opencobra/cobrapy/tree/0.13.0/release-notes/0.13.0.md for the full release notes.
- Python
Published by cobrapy-bot almost 8 years ago
cobra - https://github.com/opencobra/cobrapy/releases/tag/0.12.1
Please see https://github.com/opencobra/cobrapy/tree/0.12.1/release-notes/0.12.1.md for the full release notes.
- Python
Published by cobrapy-bot almost 8 years ago
cobra - https://github.com/opencobra/cobrapy/releases/tag/0.12.0
Please see https://github.com/opencobra/cobrapy/tree/0.12.0/release-notes/0.12.0.md for the full release notes.
- Python
Published by cobrapy-bot about 8 years ago
cobra - https://github.com/opencobra/cobrapy/releases/tag/0.11.3
Please see https://github.com/opencobra/cobrapy/tree/0.11.3/release-notes/0.11.3.md for the full release notes.
- Python
Published by cobrapy-bot about 8 years ago
cobra - https://github.com/opencobra/cobrapy/releases/tag/0.11.2
Please see https://github.com/opencobra/cobrapy/tree/0.11.2/release-notes/0.11.2.md for the full release notes.
- Python
Published by cobrapy-bot over 8 years ago
cobra - https://github.com/opencobra/cobrapy/releases/tag/0.11.1
Please see https://github.com/opencobra/cobrapy/tree/0.11.1/release-notes/0.11.1.md for the full release notes.
- Python
Published by cobrapy-bot over 8 years ago
cobra - https://github.com/opencobra/cobrapy/releases/tag/0.11.0
Please see https://github.com/opencobra/cobrapy/tree/0.11.0/release-notes/0.11.0.md for the full release notes.
- Python
Published by cobrapy-bot over 8 years ago
cobra - https://github.com/opencobra/cobrapy/releases/tag/0.10.1
Please see https://github.com/opencobra/cobrapy/tree/0.10.1/release-notes/0.10.1.md for the full release notes.
- Python
Published by cobrapy-bot over 8 years ago
cobra - https://github.com/opencobra/cobrapy/releases/tag/0.10.0
Please see https://github.com/opencobra/cobrapy/tree/0.10.0/release-notes/0.10.0.md for the full release notes.
- Python
Published by cobrapy-bot over 8 years ago
cobra - https://github.com/opencobra/cobrapy/releases/tag/0.9.1
Please see https://github.com/opencobra/cobrapy/tree/0.9.1/release-notes/0.9.1.md for the full release notes.
- Python
Published by cobrapy-bot over 8 years ago
cobra - 0.9.0
Release notes for cobrapy 0.9.0
Fixes
Model.compartmentis now a dynamic property fetching the compartments from all metabolites therefore always up-to-date. Assigning a dictionary to the same property updates the internal dictionary of compartment descriptions. This change removes the need for the check for missing compartments fromvalidation.check_metabolite_compartment_formula.- Excessively long output of html representations in jupyter notebooks are now abbreviated #577.
- Reaction forward and reverse variables are no longer cached with those object. No visible effect but simplifies the code.
- Fix bug in summary methods when used with exchange reaction sas objective. #595.
New features
Model.objective_directionis a new revertible property to set maximization / minimization using the context manager.- Change output of
production_envelopeto wide data frame format #587. Also allow multiple carbon source reactions and better handling of zero-division exceptions. - Enable summing lists of reactions, see #596
Deprecated features
Model.get_metabolite_compartmentsis deprecated (useModel.compartmentsinstead).Reaction.get_compartmentsis deprecated (useReaction.compartmentsinstead).
Backwards incompatible changes
- The format of the dataframe
production_envelopechanged listing max and min on different columns instead of the same.
- Python
Published by Midnighter over 8 years ago
cobra - 0.8.2
Release notes for cobrapy 0.8.2
Fixes
- Guarantee that sampler._reproject always returns a feasible point and will not attempt to reproject already feasible points. #564
Model.summaryno longer fails when calling after the model has changed. Fixed by letting the summary function re-compute a solution (default) or letting user supply a prior computed solution object. #566- Metabolites must now have valid identifiers before being added to a
model or
ValueErroris raised. - Fix use of underscores in key/value pairs in legacy sbml notes. #547
Backwards incompatible changes
- the Solution class no longer contains links progenitor model's
reactions and metabolites. Removed since it those can change after
the solution has been computed making them erroneous. This of course
implies that
Solutionconstructor changes to:def __init__(self, objective_value, status, fluxes, reduced_costs=None, shadow_prices=None, **kwargs):
- Python
Published by hredestig almost 9 years ago
cobra - 0.8.1
Release notes for cobrapy 0.8.1
Fixes
- Fix bug related to inhomogeneous sampling
#558. During
flux sampling, store the nullspace rather than the entire projection
(N * N.T) which reduces the memory footprint since it uses memory in
the order of
2 * n_reaction * n_metabolitesinstead of4 * n_reactions^2(no change in speed). PR #556
- Python
Published by hredestig almost 9 years ago
cobra - 0.8.0
Release notes for cobrapy 0.8.0
Fixes
- Tests no longer generates warnings about using deprecated functions.
- Gapfilling integrality thresholds now supported for all optlang solvers.
New features
Model.slim_optimize()can be used perform optimization without creating a solution. Can lead to significant speedup compared toModel.optimizewhen repeatedly doing optimizations and only making use of the objective value as avoiding the need to fetch all values from the solver object.- solution, model, metabolite and reaction now have html representation so they give more informative prints in jupyter notebooks.
- New convenience functions
cobra.flux_analysis.find_essential_genesandcobra.flux_analysis.find_essential_reactions. Model.optimizehas new parameterraise_errorto enable option to get trigger exception if no feasible solution could be found.str(reaction)now gives the more useful reaction id and the reaction string.
Deprecated features
str(reaction)no longer givesreaction.id.
- Python
Published by hredestig almost 9 years ago
cobra - 0.7.0
Release notes for cobrapy 0.7.0
Fixes
cobra.flux_analysis.reaction.assesswas broken following the release of 0.6.0 and has now been fixed (and now with unit tests).production_envelopefailed when model C-source was formulated as -> x instead of x <-. Fixed added option to guess the C-source by taking the medium reaction with the highest input C flux.model_to_pymatbridgeneeds scipy and that's correctly handled now.
New features
flux_variability_analysisnow has thepfba_factorparameter which enables the inclusion of a constraint on the max sum of absolute fluxes when doing FVA.
Deprecated features
cobra.flux_analysis.reaction.assess_{precursors,products}were essentially copies of each other and have been merged tocobra.flux_analysis.reaction.assess_component
- Python
Published by hredestig almost 9 years ago
cobra - 0.6.2
Release notes for cobrapy 0.6.2
Fixes
- Fix in the ordering and rounding of FVA summary #525
- Shared memory, improve speed during sampling #521
- Debug
model.remove_reactionsto properly work with context manager. This lead to the deprecation ofreaction.deleteas this was not compatible with the concept of being able to later revert the change. #506, #508. - Adding two models (
modela + modelb) again results in a model with the objective set to the sum of the two models objectives #505. - When adding reactions to a model, the reactions with identifiers identical to those in the model are ignored. #511
New features
model.mergecan be used to merge two models, more flexibly than the overloaded + and += operators.
Deprecated features
reaction.deletehas been deprecated in favor ofreaction.remove_from_model- overloaded
+and+=forcobra.Modelare deprecated in favor ofmodel.merge
- Python
Published by hredestig almost 9 years ago
cobra - 0.6.0
Highlights
In this release we have made major changes to pretty much all corners of cobrapy and we hope that you will enjoy the new features as much as we do, and that any negative impacts on existing workflows will be limited.
The major change is the ongoing move away from cobrapy's internal solver interfaces to those provided by optlang which provides a single unified interface to glpk, cplex and gurobi enhanced by the ability to deal with symbolic expressions. This means formulating complex constraints no longer implies defining the necessary matrix algebra, but instead simply writing the expression and assigning that as an objective to the model.
We feel that this, and the clarified scope and focus attained by separating the topic of linear programming (optlang) and metabolic flux analysis (cobrapy) to two packages is natural and makes both of these tasks less confusing and more fun. We hope that you after trying, feel the same and that in any case you let us know what you think by raising an issue or talking directly to us on gitter or google groups.
New features
The optlang solver interface
The main change is the addition of model.solver which is the optlang
interface to the chosen solver (cplex and glpk are currently well
supported, gurobi interface is at the time of writing mostly working
but improvements are still expected). The solver interface manages
variables, constraints and the objective of the model and the task of
turning these into a model formulation to be optimized by the
solver. From cobrapy's point-of-view, this means that all aspects
concerning generating problems, configuring solvers are handed over to
optlang and consequently the whole cobra.solver has been deprecated,
slated for removal in the next major release of cobrapy.
Importantly, configuring the solver by passing **solver_args or
solver='solver' is now instead done by assigning solver to
model.solver and then configuring via model.solver.configuration.
Creating new algorithms has been greatly facilitated as it no longer
requires formulating objectives and constraints by matrix algebra but
instead directly by expressions, e.g. see the implementation of
cobra.flux_analysis.moma.add_moma and
cobra.flux_analysis.loopless.loopless_solution.
Instead of having only reactions as variables and metabolites as
constraints, with optlang, cobrapy now supports arbitrary constraints
and variables and these can be added/removed by model.add_cons_vars
and model.remove_cons_vars which take care of adding these to
model.problem which is the optlang's mathematical model associated
with the cobra model.
Reactions are now modeled by two variables, forward and reverse, and
these can be seen by accessing reaction.{forward,reverse}_variable
and the combined reaction.flux_expression.
Objectives can now easily be made quite advanced by simply crafting
the right expression and assigning this as usual to model.objective,
see the
contraints and objectives notebook.
Temporary changes to a model
Models are large complex objects and copying such objects is
inevitably slow. To avoid that, cobrapy has drawn on the experience
from the development of cameo to introduce the HistoryManager class
and the concept of models as contexts. Now, most changes that can be
made to a model such as changing the objective, setting reaction
bounds, adding and removing reactions, is reversed upon exit when done
inside a context, see the updated
getting started notebook.
Improved solution handling
Previously, cobra models lugged around their latest solution to enable
providing reaction.{flux,reduced_cost} (formerly
reaction.{x,y}). This was problematic because if the model had
changed since last optimization, then this would effectively give the
wrong result. On top of that, it was not easy to make a change,
optimize and get values, and then undo that change to the model
without having to copy the whole model object. To solve this, and many
similar problem, we have completely refactored cobra.Solution so
that model.optimize() now returns a solution and it is the user's
responsibility to manage this object. reaction.flux gets its values
directly from the model.problem. To sugar the new solution class,
fluxes, reduced costs, and shadow prices are now pandas series! Fluxes
and reduced costs can be returned as a data frame directlt with the
to_frame method.
Sampling
Cobrapy now has flux sampling supported by
cobra.flux_analysis.sampling see
the sampling notebook.
Loopless models and solutions
Added implementations of CycleFreeFlux and the loopless model of Schellenberger et al.. See the notebook on loopless and simulating
DataFrames as return values
flux_variability_analysis, single_{gene,reaction}_deletion,
cobra.flux_analysis.sampling and
cobra.util.create_stoichiometric_matrix now return pandas data frames
instead of nested dicts as these are more convenient and fun to work
with. Pandas (and numpy) are therefore now hard requirements for
cobrapy, which should not be a problem for neither linux, windows or
mac users as there are reliable wheels for these packages now.
Model medium
model.medium is now a dict and setter for getting boundary feeding
reactions and their bounds
Knocking out genes
Addition of cobra.core.Gene.knock_out which can be used to evaluate
impact of knocking a gene (and all depending reactions).
Adding boundary reactions
The model class has new method model.add_boundary which can be used
to add sink, exchange or demand reactions with the appropriate bounds
and prefixes (DM, SK or EX).
Gapfilling
The SMILEY and growMatch implementations were refactored to a
single new function cobra.flux_analysis.gapfilling.gapfill which
handles both use-cases.
New Output Format in YAML
Models can now be round tripped to/from YAML documents. YAML is a file format
that is even more legible than JSON. In the scope of cobrapy, YAML output is
intended for diff comparisons between models.
Fixes
- Handle multiple IDs in Matlab models #345
DictList.querybehavior changed so that attribute isNoneif the search parameter is not a regex or string, to enablereactions.query(lambda x: x.boundary)- Set charge from notes if not defined elsewhere #352
- Warnings are no longer issued on package import if soft requirement scipy, python-libsbml is not available.
Deprecated features
These features are now deprecated and slated for complete removal in the next major cobrapy release.
- The whole
cobra.solvermodule is now deprecated, see New features. ArrayBasedModel/Model.to_array_based_modelare deprecated. This formulation makes little sense when handing over the matrix algebra to optlang, for the stoichiometry matrix (aka S), seecobra.util.array.create_stoichiometric_matrix.Metabolite.yin favor ofMetabolite.shadow_priceModel.add_reactionin favor ofModel.add_reactionsReaction.xin favor ofReaction.fluxReaction.yin favor ofReaction.reduced_costSolution.{x, y, x_dict, y_dict, f}in favor ofSolution.{fluxes, reduced_costs}. The setters are also deprecated.phenotype_phase_planein favor ofproduction_envelope. The plotting capabilities are deprecated, to be re-implemented somewhere else.convert_to_irreverible,revert_to_irreversible,canonical_formdeprecated without replacement.check_reaction_boundsdeprecated without replacement.optimize_minimal_fluxwas renamed topfba
Backwards incompatible changes
- optknock was completely removed, users are advised to use cameo for this functionality
- dual_problem was removed
cobra.topologywas removed, possibly to be reintroduced in a different package- fluxvariabilityanalysis results must be transformed to have them
work as the previous nested dict,
i.e.
flux_variability_analysis(model).Tshould give behavior as previously. - In a major linting effort we renamed capitalized modules to lower-case,
e.g.
cobra.core.Modeltocobra.core.model. Imports fromcobraare unchanged though. - objective coefficients of reactions can now only be set once the reaction is attached to a model.
Reaction.{x,y},Metabolite.yare defunct for legacy solvers.SMILEYandgrowMatchalgorithms are defunct in combination with the legacy solvers.
- Python
Published by hredestig about 9 years ago
cobra -
Release notes for cobrapy 0.6.0
Highlights
In this release we have made major changes to pretty much all corners of cobrapy and we hope that you will enjoy the new features as much as we do, and that any negative impacts on existing workflows will be limited.
The major change is the ongoing move away from cobrapy's internal solver interfaces to those provided by optlang which provides a single unified interface to glpk, cplex and gurobi enhanced by the ability to deal with symbolic expressions. This means formulating complex constraints no longer implies defining the necessary matrix algebra, but instead simply writing the expression and assigning that as an objective to the model.
We feel that this, and the clarified scope and focus attained by separating the topic of linear programming (optlang) and metabolic flux analysis (cobrapy) to two packages is natural and makes both of these tasks less confusing and more fun. We hope that you after trying, feel the same and that in any case you let us know what you think by raising an issue or talking directly to us on gitter or google groups.
New features
The optlang solver interface
The main change is the addition of model.solver which is the optlang
interface to the chosen solver (cplex and glpk are currently well
supported, gurobi interface is at the time of writing mostly working
but improvements are still expected). The solver interface manages
variables, constraints and the objective of the model and the task of
turning these into a model formulation to be optimized by the
solver. From cobrapy's point-of-view, this means that all aspects
concerning generating problems, configuring solvers are handed over to
optlang and consequently the whole cobra.solver has been deprecated,
slated for removal in the next major release of cobrapy.
Importantly, configuring the solver by passing **solver_args or
solver='solver' is now instead done by assigning solver to
model.solver and then configuring via model.solver.configuration.
Creating new algorithms has been greatly facilitated as it no longer
requires formulating objectives and constraints by matrix algebra but
instead directly by expressions, e.g. see the implementation of
cobra.flux_analysis.moma.add_moma and
cobra.flux_analysis.loopless.loopless_solution.
Instead of having only reactions as variables and metabolites as
constraints, with optlang, cobrapy now supports arbitrary constraints
and variables and these can be added/removed by model.add_cons_vars
and model.remove_cons_vars which take care of adding these to
model.problem which is the optlang's mathematical model associated
with the cobra model.
Reactions are now modeled by two variables, forward and reverse, and
these can be seen by accessing reaction.{forward,reverse}_variable
and the combined reaction.flux_expression.
Objectives can now easily be made quite advanced by simply crafting
the right expression and assigning this as usual to model.objective,
see the
contraints and objectives notebook.
Temporary changes to a model
Models are large complex objects and copying such objects is
inevitably slow. To avoid that, cobrapy has drawn on the experience
from the development of cameo to introduce the HistoryManager class
and the concept of models as contexts. Now, most changes that can be
made to a model such as changing the objective, setting reaction
bounds, adding and removing reactions, is reversed upon exit when done
inside a context, see the updated
getting started notebook.
Improved solution handling
Previously, cobra models lugged around their latest solution to enable
providing reaction.{flux,reduced_cost} (formerly
reaction.{x,y}). This was problematic because if the model had
changed since last optimization, then this would effectively give the
wrong result. On top of that, it was not easy to make a change,
optimize and get values, and then undo that change to the model
without having to copy the whole model object. To solve this, and many
similar problem, we have completely refactored cobra.Solution so
that model.optimize() now returns a solution and it is the user's
responsibility to manage this object. reaction.flux gets its values
directly from the model.problem. To sugar the new solution class,
fluxes, reduced costs, and shadow prices are now pandas series! Fluxes
and reduced costs can be returned as a data frame directly with the
to_frame method.
Sampling
Cobrapy now has flux sampling supported by
cobra.flux_analysis.sampling see
the sampling notebook.
Loopless models and solutions
Added implementations of CycleFreeFlux and the loopless model of Schellenberger et al.. See the notebook on loopless and simulating
DataFrames as return values
flux_variability_analysis, single_{gene,reaction}_deletion,
cobra.flux_analysis.sampling and
cobra.util.create_stoichiometric_matrix now return pandas data frames
instead of nested dicts as these are more convenient and fun to work
with. Pandas (and numpy) are therefore now hard requirements for
cobrapy, which should not be a problem for neither linux, windows or
mac users as there are reliable wheels for these packages now.
Model medium
model.medium is now a dict and setter for getting boundary feeding
reactions and their bounds
Knocking out genes
Addition of cobra.core.Gene.knock_out which can be used to evaluate
impact of knocking a gene (and all depending reactions).
Adding boundary reactions
The model class has new method model.add_boundary which can be used
to add sink, exchange or demand reactions with the appropriate bounds
and prefixes (DM, SK or EX).
Fixes
- Handle multiple IDs in Matlab models #345
DictList.querybehavior changed so that attribute isNoneif the search parameter is not a regex or string, to enablereactions.query(lambda x: x.boundary)- Set charge from notes if not defined elsewhere #352
- Warnings are no longer issued on package import if soft requirement scipy, python-libsbml is not available.
Deprecated features
These features are now deprecated and slated for complete removal in the next major cobrapy release.
- The whole
cobra.solvermodule is now deprecated, see New features. ArrayBasedModel/Model.to_array_based_modelare deprecated. This formulation makes little sense when handing over the matrix algebra to optlang, for the stoichiometry matrix (aka S), seecobra.util.array.create_stoichiometric_matrix.Metabolite.yin favor ofMetabolite.shadow_priceModel.add_reactionin favor ofModel.add_reactionsReaction.xin favor ofReaction.fluxReaction.yin favor ofReaction.reduced_costSolution.{x, y, x_dict, y_dict, f}in favor ofSolution.{fluxes, reduced_costs}. The setters are also deprecated.phenotype_phase_planein favor ofproduction_envelope. The plotting capabilities are deprecated, to be re-implemented somewhere else.convert_to_irreverible,revert_to_irreversible,canonical_formdeprecated without replacement.check_reaction_boundsdeprecated without replacement.optimize_minimal_fluxwas renamed topfba
Backwards incompatible changes
- optknock was completely removed, users are advised to use cameo for this functionality
- dual_problem was removed
- gapfilling algorithms were removed without replacement, to be re-introduced in a different package
cobra.topologywas removed, possibly to be reintroduced in a different package- fluxvariabilityanalysis results must be transformed to have them
work as the previous nested dict,
i.e.
flux_variability_analysis(model).Tshould give behavior as previously. - In a major linting effort we renamed capitalized modules to lower-case,
e.g.
cobra.core.Modeltocobra.core.model. Imports fromcobraare unchanged though. - objective coefficients of reactions can now only be set once the reaction is attached to a model.
Reaction.{x,y},Metabolite.yare defunct for legacy solvers.
- Python
Published by hredestig about 9 years ago
cobra - 0.6.0a6
Release notes for cobrapy 0.6.0
Highlights
In this release we have made major changes to pretty much all corners of cobrapy and we hope that you will enjoy the new features as much as we do, and that any negative impacts on existing workflows will be limited.
The major change is the ongoing move away from cobrapy's internal solver interfaces to those provided by optlang which provides a single unified interface to glpk, cplex and gurobi enhanced by the ability to deal with symbolic expressions. This means formulating complex constraints no longer implies defining the necessary matrix algebra, but instead simply writing the expression and assigning that as an objective to the model.
We feel that this, and the clarified scope and focus attained by separating the topic of linear programming (optlang) and metabolic flux analysis (cobrapy) to two packages is natural and makes both of these tasks less confusing and more fun. We hope that you after trying, feel the same and that in any case you let us know what you think by raising an issue or talking directly to us on gitter or google groups.
New features
The optlang solver interface
The main change is the addition of model.solver which is the optlang
interface to the chosen solver (cplex and glpk are currently well
supported, gurobi interface is at the time of writing mostly working
but improvements are still expected). The solver interface manages
variables, constraints and the objective of the model and the task of
turning these into a model formulation to be optimized by the
solver. From cobrapy's point-of-view, this means that all aspects
concerning generating problems, configuring solvers are handed over to
optlang and consequently the whole cobra.solver has been deprecated,
slated for removal in the next major release of cobrapy.
Importantly, configuring the solver by passing **solver_args or
solver='solver' is now instead done by assigning solver to
model.solver and then configuring via model.solver.configuration.
Creating new algorithms has been greatly facilitated as it no longer
requires formulating objectives and constraints by matrix algebra but
instead directly by expressions, e.g. see the implementation of
cobra.flux_analysis.moma.add_moma and
cobra.flux_analysis.loopless.loopless_solution.
Instead of having only reactions as variables and metabolites as
constraints, with optlang, cobrapy now supports arbitrary constraints
and variables and these can be added/removed by model.add_cons_vars
and model.remove_cons_vars which take care of adding these to
model.problem which is the optlang's mathematical model associated
with the cobra model.
Reactions are now modeled by two variables, forward and reverse, and
these can be seen by accessing reaction.{forward,reverse}_variable
and the combined reaction.flux_expression.
Objectives can now easily be made quite advanced by simply crafting
the right expression and assigning this as usual to model.objective,
see the
contraints and objectives notebook.
Temporary changes to a model
Models are large complex objects and copying such objects is
inevitably slow. To avoid that, cobrapy has drawn on the experience
from the development of cameo to introduce the HistoryManager class
and the concept of models as contexts. Now, most changes that can be
made to a model such as changing the objective, setting reaction
bounds, adding and removing reactions, is reversed upon exit when done
inside a context, see the updated
getting started notebook.
Improved solution handling
Previously, cobra models lugged around their latest solution to enable
providing reaction.{flux,reduced_cost} (formerly
reaction.{x,y}). This was problematic because if the model had
changed since last optimization, then this would effectively give the
wrong result. On top of that, it was not easy to make a change,
optimize and get values, and then undo that change to the model
without having to copy the whole model object. To solve this, and many
similar problem, we have completely refactored cobra.Solution so
that model.optimize() now returns a solution and it is the user's
responsibility to manage this object. reaction.flux gets its values
directly from the model.problem. To sugar the new solution class,
fluxes, reduced costs, and shadow prices are now pandas series!
Sampling
Cobrapy now has flux sampling supported by
cobra.flux_analysis.sampling see
the sampling notebook.
Loopless models and solutions
Added implementations of CycleFreeFlux and the loopless model of Schellenberger et al.. See the notebook on loopless and simulating
DataFrames as return values
flux_variability_analysis, single_{gene,reaction}_deletion,
cobra.flux_analysis.sampling and
cobra.util.create_stoichiometric_matrix now return pandas data frames
instead of nested dicts as these are more convenient and fun to work
with. Pandas (and numpy) are therefore now hard requirements for
cobrapy, which should not be a problem for neither linux, windows or
mac users as there are reliable wheels for these packages now.
Model medium
model.medium is now a dict and setter for getting boundary feeding
reactions and their bounds
Knocking out genes
Addition of cobra.core.Gene.knock_out which can be used to evaluate
impact of knocking a gene (and all depending reactions).
Adding boundary reactions
The model class has new method model.add_boundary which can be used
to add sink, exchange or demand reactions with the appropriate bounds
and prefixes (DM, SK or EX).
Fixes
- Handle multiple IDs in Matlab models #345
DictList.querybehavior changed so that attribute isNoneif the search parameter is not a regex or string, to enablereactions.query(lambda x: x.boundary)- Set charge from notes if not defined elsewhere #352
- Warnings are no longer issued on package import if soft requirement scipy, python-libsbml is not available.
Deprecated features
These features are now deprecated and slated for complete removal in the next major cobrapy release.
- The whole
cobra.solvermodule is now deprecated, see New features. ArrayBasedModel/Model.to_array_based_modelare deprecated. This formulation makes little sense when handing over the matrix algebra to optlang, for the stoichiometry matrix (aka S), seecobra.util.array.create_stoichiometric_matrix.Metabolite.yin favor ofMetabolite.shadow_priceModel.add_reactionin favor ofModel.add_reactionsReaction.xin favor ofReaction.fluxReaction.yin favor ofReaction.reduced_costSolution.{x, y, x_dict, y_dict, f}in favor ofSolution.{fluxes, reduced_costs}. The setters are also deprecated.phenotype_phase_planein favor ofproduction_envelope. The plotting capabilities are deprecated, to be re-implemented somewhere else.convert_to_irreverible,revert_to_irreversible,canonical_formdeprecated without replacement.check_reaction_boundsdeprecated without replacement.optimize_minimal_fluxwas renamed topfba
Backwards incompatible changes
- optknock was completely removed, users are advised to use cameo for this functionality
- dual_problem was removed
- gapfilling algorithms were removed without replacement, to be re-introduced in a different package
cobra.topologywas removed, possibly to be reintroduced in a different package- fluxvariabilityanalysis results must be transformed to have them
work as the previous nested dict,
i.e.
flux_variability_analysis(model).Tshould give behavior as previously. - In a major linting effort we renamed capitalized modules to lower-case,
e.g.
cobra.core.Modeltocobra.core.model. Imports fromcobraare unchanged though. - objective coefficients of reactions can now only be set once the reaction is attached to a model.
Reaction.{x,y},Metabolite.yare defunct for legacy solvers.
- Python
Published by hredestig about 9 years ago
cobra - 0.6.0a4
Release notes for cobrapy 0.6.0
Highlights
In this release we have made major changes to pretty much all corners of cobrapy and we hope that you will enjoy the new features as much as we do, and that any negative impacts on existing workflows will be limited.
The major change is the ongoing move away from cobrapy's internal solver interfaces to those provided by optlang which provides a single unified interface to glpk, cplex and gurobi enhanced by the ability to deal with symbolic expressions. This means formulating complex constraints no longer implies defining the necessary matrix algebra, but instead simply writing the expression and assigning that as an objective to the model.
We feel that this, and the clarified scope and focus attained by separating the topic of linear programming (optlang) and metabolic flux analysis (cobrapy) to two packages is natural and makes both of these tasks less confusing and more fun. We hope that you after trying, feel the same and that in any case you let us know what you think by raising an issue or talking directly to us on gitter or google groups.
New features
The optlang solver interface
The main change is the addition of model.solver which is the optlang
interface to the chosen solver (cplex and glpk are currently well
supported, gurobi interface is at the time of writing mostly working
but improvements are still expected). The solver interface manages
variables, constraints and the objective of the model and the task of
turning these into a model formulation to be optimized by the
solver. From cobrapy's point-of-view, this means that all aspects
concerning generating problems, configuring solvers are handed over to
optlang and consequently the whole cobra.solver has been deprecated,
slated for removal in the next major release of cobrapy.
Importantly, configuring the solver by passing **solver_args or
solver='solver' is now instead done by assigning solver to
model.solver and then configuring via model.solver.configuration.
Creating new algorithms has been greatly facilitated as it no longer
requires formulating objectives and constraints by matrix algebra but
instead directly by expressions, e.g. see the implementation of
cobra.flux_analysis.moma.add_moma and
cobra.flux_analysis.loopless.loopless_solution.
Instead of having only reactions as variables and metabolites as
constraints, with optlang, cobrapy now supports arbitrary constraints
and variables and these can be added/removed by model.add_cons_vars
and model.remove_cons_vars which take care of adding these to
model.problem which is the optlang's mathematical model associated
with the cobra model.
Reactions are now modeled by two variables, forward and reverse, and
these can be seen by accessing reaction.{forward,reverse}_variable
and the combined reaction.flux_expression.
Objectives can now easily be made quite advanced by simply crafting
the right expression and assigning this as usual to model.objective,
see the
contraints and objectives notebook.
Temporary changes to a model
Models are large complex objects and copying such objects is
inevitably slow. To avoid that, cobrapy has drawn on the experience
from the development of cameo to introduce the HistoryManager class
and the concept of models as contexts. Now, most changes that can be
made to a model such as changing the objective, setting reaction
bounds, adding and removing reactions, is reversed upon exit when done
inside a context, see the updated
getting started notebook.
Improved solution handling
Previously, cobra models lugged around their latest solution to enable
providing reaction.{flux,reduced_cost} (formerly
reaction.{x,y}). This was problematic because if the model had
changed since last optimization, then this would effectively give the
wrong result. On top of that, it was not easy to make a change,
optimize and get values, and then undo that change to the model
without having to copy the whole model object. To solve this, and many
similar problem, we have completely refactored cobra.Solution so
that model.optimize() now returns a solution and it is the user's
responsibility to manage this object. reaction.flux gets its values
directly from the model.problem. To sugar the new solution class,
fluxes, reduced costs, and shadow prices are now pandas series!
Sampling
Cobrapy now has flux sampling supported by
cobra.flux_analysis.sampling see
the sampling notebook.
Loopless models and solutions
Added implementations of CycleFreeFlux and the loopless model of Schellenberger et al.. See the notebook on loopless and simulating
DataFrames as return values
flux_variability_analysis, single_{gene,reaction}_deletion,
cobra.flux_analysis.sampling and
cobra.util.create_stoichiometric_matrix now return pandas data frames
instead of nested dicts as these are more convenient and fun to work
with. Pandas (and numpy) are therefore now hard requirements for
cobrapy, which should not be a problem for neither linux, windows or
mac users as there are reliable wheels for these packages now.
Model medium
model.medium is now a dict and setter for getting boundary feeding
reactions and their bounds
Fixes
- Handle multiple IDs in Matlab models #345
DictList.querybehavior changed so that attribute isNoneif the search parameter is not a regex or string, to enablereactions.query(lambda x: x.boundary)- Set charge from notes if not defined elsewhere #352
- Warnings are no longer issued on package import if soft requirement scipy, python-libsbml is not available.
Deprecated features
These features are now deprecated and slated for complete removal in the next major cobrapy release.
- The whole
cobra.solvermodule is now deprecated, see New features. ArrayBasedModel/Model.to_array_based_modelare deprecated. This formulation makes little sense when handing over the matrix algebra to optlang, for the stoichiometry matrix (aka S), seecobra.util.array.create_stoichiometric_matrix.Metabolite.yin favor ofMetabolite.shadow_priceModel.add_reactionin favor ofModel.add_reactionsReaction.xin favor ofReaction.fluxReaction.yin favor ofReaction.reduced_costSolution.{x, y, x_dict, y_dict, f}in favor ofSolution.{fluxes, reduced_costs}. The setters are also deprecated.phenotype_phase_planein favor ofproduction_envelope. The plotting capabilities are deprecated, to be re-implemented somewhere else.convert_to_irreverible,revert_to_irreversible,canonical_formdeprecated without replacement.check_reaction_boundsdeprecated without replacement.optimize_minimal_fluxwas renamed topfba
Backwards incompatible changes
- optknock was completely removed, users are advised to use cameo for this functionality
- dual_problem was removed
- gapfilling algorithms were removed without replacement, to be re-introduced in a different package
cobra.topologywas removed, possibly to be reintroduced in a different package- fluxvariabilityanalysis results must be transformed to have them
work as the previous nested dict,
i.e.
flux_variability_analysis(model).Tshould give behavior as previously. - In a major linting effort we renamed capitalized modules to lower-case,
e.g.
cobra.core.Modeltocobra.core.model. Imports fromcobraare unchanged though. - objective coefficients of reactions can now only be set once the reaction is attached to a model.
Reaction.{x,y},Metabolite.yare defunct for legacy solvers.
- Python
Published by hredestig about 9 years ago
cobra - 0.6.0a2
Release notes for cobrapy 0.6.0
Highlights
In this release we have made major changes to pretty much all corners of cobrapy and we hope that you will enjoy the new features as much as we do, and that any negative impacts on existing workflows will be limited.
The major change is the ongoing move away from cobrapy's internal solver interfaces to those provided by optlang which provides a single unified interface to glpk, cplex and gurobi enhanced by the ability to deal with symbolic expressions. This means formulating complex constraints no longer implies defining the necessary matrix algebra, but instead simply writing the expression and assigning that as an objective to the model.
We feel that this, and the clarified scope and focus attained by separating the topic of linear programming (optlang) and metabolic flux analysis (cobrapy) to two packages is natural and makes both of these tasks less confusing and more fun. We hope that you after trying, feel the same and that in any case you let us know what you think by raising an issue or talking directly to us on gitter or google groups.
New features
The optlang solver interface
The main change is the addition of model.solver which is the optlang
interface to the chosen solver (cplex and glpk are currently well
supported, gurobi interface is at the time of writing mostly working
but improvements are still expected). The solver interface manages
variables, constraints and the objective of the model and the task of
turning these into a model formulation to be optimized by the
solver. From cobrapy's point-of-view, this means that all aspects
concerning generating problems, configuring solvers are handed over to
optlang and consequently the whole cobra.solver has been deprecated,
slated for removal in the next major release of cobrapy.
Importantly, configuring the solver by passing **solver_args or
solver='solver' is now instead done by assigning solver to
model.solver and then configuring via model.solver.configuration.
Creating new algorithms has been greatly facilitated as it no longer
requires formulating objectives and constraints by matrix algebra but
instead directly by expressions, e.g. see the implementation of
cobra.flux_analysis.moma.add_moma and
cobra.flux_analysis.loopless.loopless_solution.
Instead of having only reactions as variables and metabolites as
constraints, with optlang, cobrapy now supports arbitrary constraints
and variables and these can be added/removed by model.add_cons_vars
and model.remove_cons_vars which take care of adding these to
model.problem which is the optlang's mathematical model associated
with the cobra model.
Reactions are now modeled by two variables, forward and reverse, and
these can be seen by accessing reaction.{forward,reverse}_variable
and the combined reaction.flux_expression.
Objectives can now easily be made quite advanced by simply crafting
the right expression and assigning this as usual to model.objective,
see the
contraints and objectives notebook.
Temporary changes to a model
Models are large complex objects and copying such objects is
inevitably slow. To avoid that, cobrapy has drawn on the experience
from the development of cameo to introduce the HistoryManager class
and the concept of models as contexts. Now, most changes that can be
made to a model such as changing the objective, setting reaction
bounds, adding and removing reactions, is reversed upon exit when done
inside a context, see the updated
getting started notebook.
Improved solution handling
Previously, cobra models lugged around their latest solution to enable
providing reaction.{flux,reduced_cost} (formerly
reaction.{x,y}). This was problematic because if the model had
changed since last optimization, then this would effectively give the
wrong result. On top of that, it was not easy to make a change,
optimize and get values, and then undo that change to the model
without having to copy the whole model object. To solve this, and many
similar problem, we have completely refactored cobra.Solution so
that model.optimize() now returns a solution and it is the user's
responsibility to manage this object. reaction.flux gets its values
directly from the model.problem. To sugar the new solution class,
fluxes, reduced costs, and shadow prices are now pandas series!
Sampling
Cobrapy now has flux sampling supported by
cobra.flux_analysis.sampling see
the sampling notebook.
Loopless models and solutions
Added implementations of CycleFreeFlux and the loopless model of Schellenberger et al.. See the notebook on loopless and simulating
DataFrames as return values
flux_variability_analysis, single_{gene,reaction}_deletion,
cobra.flux_analysis.sampling and
cobra.util.create_stoichiometric_matrix now return pandas data frames
instead of nested dicts as these are more convenient and fun to work
with. Pandas (and numpy) are therefore now hard requirements for
cobrapy, which should not be a problem for neither linux, windows or
mac users as there are reliable wheels for these packages now.
Model medium
model.medium is now a dict and setter for getting boundary feeding
reactions and their bounds
Fixes
- Handle multiple IDs in Matlab models #345
DictList.querybehavior changed so that attribute isNoneif the search parameter is not a regex or string, to enablereactions.query(lambda x: x.boundary)- Set charge from notes if not defined elsewhere #352
- Warnings are no longer issued on package import if soft requirement scipy, python-libsbml is not available.
Deprecated features
These features are now deprecated and slated for complete removal in the next major cobrapy release.
- The whole
cobra.solvermodule is now deprecated, see New features. ArrayBasedModel/Model.to_array_based_modelare deprecated. This formulation makes little sense when handing over the matrix algebra to optlang, for the stoichiometry matrix (aka S), seecobra.util.array.create_stoichiometric_matrix.Metabolite.yin favor ofMetabolite.shadow_priceModel.add_reactionin favor ofModel.add_reactionsReaction.xin favor ofReaction.fluxReaction.yin favor ofReaction.reduced_costSolution.{x, y, x_dict, y_dict, f}in favor ofSolution.{fluxes, reduced_costs}. The setters are also deprecated.phenotype_phase_planein favor ofproduction_envelope. The plotting capabilities are deprecated, to be re-implemented somewhere else.convert_to_irreverible,revert_to_irreversible,canonical_formdeprecated without replacement.check_reaction_boundsdeprecated without replacement.
Backwards incompatible changes
- optknock was completely removed, users are advised to use cameo for this functionality
- dual_problem was removed
- gapfilling algorithms were removed without replacement, to be re-introduced in a different package
cobra.topologywas removed, possibly to be reintroduced in a different package- fluxvariabilityanalysis results must be transformed to have them
work as the previous nested dict,
i.e.
flux_variability_analysis(model).Tshould give behavior as previously. - In a major linting effort we renamed capitalized modules to lower-case,
e.g.
cobra.core.Modeltocobra.core.model. Imports fromcobraare unchanged though. - objective coefficients of reactions can now only be set once the reaction is attached to a model.
Reaction.{x,y},Metabolite.yare defunct for legacy solvers.
- Python
Published by hredestig about 9 years ago
cobra - 0.6.0a1
Release notes for cobrapy 0.6.0
Highlights
In this release we have made major changes to pretty much all corners of cobrapy but we hope that any negative impact on existing workflows will still be limited. The major change is the ongoing move away from cobrapy's internal solver interfaces to those provided by optlang which provides a single unified interface to glpk, cplex and gurobi enhanced by the ability to deal with symbolic expressions. This means formulating complex constraints no longer implies defining the necessary matrix algebra, but instead simply writing the expression and assigning that as on objective to the model.
We feel that the this, and the clarified scope and focus attained by separating the topic of linear programming (optlang) and metabolic flux analysis (cobrapy) to two packages is natural and makes both of these tasks less confusing and more fun. We hope that you after trying, feel the same and that in any case you let us know what you think by raising an issue or talking directly to us on gitter or google groups.
New features
The optlang solver interface
The main change is the addition of model.solver which is the optlang
interface to the chosen solver (cplex and glpk are currently well
supported, gurobi interface is at the time of writing mostly working
but improvements are still expected). The solver interface manages
variables, constraints and the objective of the model and the task of
turning these into a model formulation to be optimized by the
solver. From cobrapy's point-of-view, this means that all aspects
concerning generating problems, configuring solvers are handed over to
optlang and consequently the whole cobra.solver has been deprecated,
slated for removal in the next major release of cobrapy.
Importantly, configuring the solver by passing **solver_args or
solver='solver' is now instead done by assigning solver to
model.solver and then configuring via model.solver.configuration.
Creating new algorithms has been greatly facilitated as it no longer
requires formulating objectives and constraints by matrix algebra but
instead directly by expressions, e.g. see the implementation of
cobra.flux_analysis.moma.add_moma and
cobra.flux_analysis.loopless.loopless_solution.
Instead of having only reactions as variables and metabolites as
constraints, with optlang, cobrapy now supports arbitrary constraints
and variables and these can be added/removed by model.add_cons_vars
and model.remove_cons_vars which take care of adding these to
model.problem which is the optlang's mathematical model associated
with the cobra model.
Reactions are now modeled by two variables, forward and reverse, and
these can be seen by accessing reaction.{forward,reverse}_variable
and the combined reaction.flux_expression.
Objectives can now easily be made quite advanced by simply crafting
the right expression and assigning this as usual to model.objective,
see the
contraints and objectives notebook.
Temporary changes to a model
Models are large complex objects and copying such objects is
inevitably slow. To avoid that, cobrapy has drawn on the experience
from the development of cameo to introduce the HistoryManager class
and the concept of models as contexts. Now, most changes that can be
made to a model such as changing the objective, setting reaction
bounds, adding and removing reactions, is reversed upon exit when done
inside a context, see the updated
getting started notebook.
Improved solution handling
Previously, cobra models lugged around their latest solution to enable
providing reaction.{flux,reduced_cost} (formerly
reaction.{x,y}). This was problematic because if the model had
changed since last optimization, then this would effectively give the
wrong result. On top of that, it was not easy to make a change,
optimize and get values, and then undo that change to the model
without having to copy the whole model object. To solve this, and many
similar problem, we have completely refactored cobra.Solution so
that model.optimize() now returns a solution and it is the user's
responsibility to manage this object. reaction.flux gets its values
directly from the model.problem. To sugar the new solution class,
fluxes, reduced costs, and shadow prices are now pandas series!
Sampling
Cobrapy now has flux sampling supported by
cobra.flux_analysis.sampling see
the sampling notebook.
Loopless models and solutions
Added implementations of CycleFreeFlux and the loopless model of Schellenberger et al.. See the notebook on loopless and simulating
DataFrames as return values
flux_variability_analysis, single_{gene,rection}_deletion,
cobra.flux_analysis.sampling and
cobra.util.create_stoichiometric_array now return a pandas data frame
instead of nested dicts as these are more convenient and fun to work
with. Pandas (and numpy) are therefore now hard requirements for
cobrapy, which should not be a problem for neither linux, windows or
mac users as there are reliable wheels for these packages now.
Model medium
model.medium is now a dict and setter for getting boundary feeding
reactions and their bounds
Fixes
- Handle multiple IDs in Matlab models #345
DictList.querybehavior changed so that attribute isNoneif the search parameter is not a regex or string, to enablereactions.query(lambda x: x.boundary)- Set charge from notes if not defined elsewhere #352
- Warnings are no longer issued on package import if soft requirement scipy, python-libsbml is not available.
Deprecated features
These features are now deprecated and slated for complete removal in the next major cobrapy release.
- The whole
cobra.solvermodule is now deprecated, see New features. ArrayBasedModel/Model.to_array_based_modelare deprecated. This formulation makes little sense when handing over the matrix algebra to optlang, for the stoichiometry matrix (aka S), seecobra.util.array.create_stoichiometric_array.Metabolite.yin favor ofMetabolite.shadow_priceModel.add_reactionin favor ofModel.add_reactionsReaction.xin favor ofReaction.fluxReaction.yin favor ofReaction.reduced_costSolution.{x, y, x_dict, y_dict, f}in favor ofSolution.{fluxes, reduced_costs}. The setters are also deprecated.phenotype_phase_planein favor ofproduction_envelope. The plotting capabilities are deprecated, to be re-implemented somewhere else.convert_to_irreverible,revert_to_irreversible,canonical_formdeprecated without replacement.check_reaction_boundsdeprecated without replacement.
Backwards incompatible changes
- optknock was completely removed, users are advised to use cameo for this functionality
- dual_problem was removed
- gapfilling algorithms were removed without replacement, to be re-introduced in a different package
cobra.topologywas removed, possibly to be reintroduced in a different package- fluxvariabilityanalysis results must be transformed to have them
work as the previous nested dict,
i.e.
flux_variability_analysis(model).Tshould give behavior as previously. - In a major linting effort we renamed capitalized modules to lower-case,
e.g.
cobra.core.Modeltocobra.core.model. Imports fromcobraare unchanged though. - objective coefficients of reactions can now only be set once the reaction is attached to a model.
Reaction.{x,y},Metabolite.yare defunct for legacy solvers.
- Python
Published by hredestig about 9 years ago
cobra - 0.3.0
This is a major release from 0.2.1, with many new features added. A brief summary is below: - Revamped faster and simpler solver interface - New "cglpk" solver to replace "pyglpk" as the default solver (compatible with the latest version of GLPK) - Support for "exact" solving (#126, 41d91e8b2bf9c7b6c58b5315a07768c3c460b2af) - Rewritten documentation now available as IPython notebooks - Major performance improvements to deletions and FVA - More flux analysis tools (pFBA and phenotypic phase planes, loopless FBA) - SBML fbc support - Python 3 support - Improvements to ArrayBasedModel - Read-only attributes for gene/reaction/metabolite relationships
- Python
Published by aebrahim over 11 years ago
cobra - 0.3.0b4
The following features were added: - Improvements to solver interface - Support for exact solving with esolver (Qsopt_ex) (#126) - Support for Mosek (f79248f89673025e37f1b9aa796bd8cb28ba157f) - Support for "exact" solving with glpk (through cglpk) (41d91e8b2bf9c7b6c58b5315a07768c3c460b2af) - cglpk is now the preferred binding to glpk (#129) - Implementation of loopless FBA (#133) - Update documentation to IPython notebooks (0e380963d3428d0fbd40135032efd24810048ce4)
- Python
Published by aebrahim over 11 years ago
cobra -
Improvements over 0.3.0b1:
- installation improvements
- updates to documentation
- misc bugfixes in
- qp
- cglpk solver
- double deletion multiprocessing
- Python
Published by aebrahim almost 12 years ago
cobra -
Changes in 0.3.0b1: - faster solver interface - faster fva and single/double deletions with new interface - cython-based glpk solver - more flux analysis tools (pFBA and phenotypic phase planes) - sbml fbc support - improvements to ArrayBasedModel - access read-only attributes for gene/reaction/metabolite relationships - simplified installation - python3 support
- Python
Published by aebrahim almost 12 years ago