Skip to content

Commit

Permalink
Improve mat (#1197)
Browse files Browse the repository at this point in the history
* speedup mat reading

* using dictionary comprehension to be a bit faster

* vectorized metabolite processing and added annotations

* vectorize reaction processing

* functionalize cell processing

* functionalize cell processing for floats

* added docstring

* added rxn annotations, including pubmed and EC

* added rxn annotations, including pubmed and EC

* tidying

* functionalize annotations

* fixed minor mistake with REV

* started annotations_to_mat

* fast version of mat_annotations, need to split to list

* black and some tidying, including an else

* annotations will be lists

* fixed outputting of annotations. Added parsing of Rxn Notes from mat struct

* some minor name changes

* mat writing and reading work on all fields

* removed pymatbridge

* fixed some errors

* black

* minor correction since number of arrays is inconsistent. Harvey and Harvetta should work now.

* removed unnecessary function and kludgy modification of MET_PROVIDERS

* modified regular expression. Added check for empty compartments which should not be happening

* ran black becase I had forgotten it

* added logger warning about compartments via regular expressions

* log compartments found

* some typing correction and test modification

* some more typing correction

* some corrections according to comments

* some corrections according to discussion on PR

* fix bug in GPR.from_string()

* updated tests. Was treating logger.warning like warn.warning but the function is different. Also, the documentation states that
"warnings.warn() in library code if the issue is avoidable and the client application should be modified to eliminate the warning"
And malformed GPR should be modified in the client application (by modifying the input).

* corrected according to comments.

* removed deprecated function remove_from_model in gene.py

* some corrections according to discussion on PR and cobratoolbox test models

* some corrections according to cobratoolbox test models

* added subsystem to groups. some tidying

* removed unnecessary functions now need to update tests for coverage

* not using enumerate

* added some tests

* raven style model should be written properly
made failure better
added tests to fail when compartments are missing or problematic
added test to see that mat models with no genes are imported correctly

* cobratoolbox created models seem to be inconsistent about capitalization of model fields (metChebiID, metCHEBIID, metChEBIID) - revised reading to be tolerant of this

* CHEBI: shouldn't be removed from metCHEBIID since that how it is accessed in the CHEBI website.
removed unnecessary function create_mat_metabolite_id()

* mat models seem to be read and rewritten correctly

* read gene names and make sure to add genes to model (otherwise gene names are ignored)

* fix for old cobratoolbox fields
added tests - test_compare_xml_to_written_matlab_model, test_mat_model_with_long_compartment_ids, test_mat_model_wrong_caps

* save model name only if it exists

* variable name fixes
next release corrected
removed instructions to gist

* revert changes in test_sbml.py

Co-authored-by: uri.akavia <[email protected]>
  • Loading branch information
akaviaLab and uri.akavia authored Apr 28, 2022
1 parent ca8e8bd commit f5a1b96
Show file tree
Hide file tree
Showing 11 changed files with 832 additions and 408 deletions.
236 changes: 0 additions & 236 deletions documentation_builder/pymatbridge.ipynb

This file was deleted.

6 changes: 6 additions & 0 deletions release-notes/next-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## New features

Improve reading of matlab models, which will include metaboilte
and reaction annotations.

## Fixes

`model.copy()` will now correctly copy GPRs.
Expand All @@ -22,3 +25,6 @@ test_gpr_that_needs_two_replacements()
## Deprecated features

## Backwards incompatible changes

Removed pymatlib direct transfer of models to matlab process.
Please use save_matlab_model() and then read the model in matlab.
Loading

0 comments on commit f5a1b96

Please sign in to comment.