Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mat cleanup #1220

Merged
merged 12 commits into from
Jul 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ ipython_config.py
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
.idea/

# Generated files
.idea/**/contentModel.xml
Expand Down
6 changes: 6 additions & 0 deletions release-notes/next-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

## Fixes

* Reformatted example files (e_coli_core.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

## Other

* Resolve `flake8` issues and add missing type annotations and docstrings in `src/cobra/io` and `tests/test_io` (#1212).
Expand Down
19 changes: 10 additions & 9 deletions src/cobra/data/mini.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
},
{
"annotation": {
"ncbigi": [
"GI:1208453",
"GI:1652654"
"ncbiprotein": [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference between the mini.json in src/cobra/data and the one in tests/data. Couldn't the tests just use the first one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None.
The tests are using the one in tests, because that's how the functions are designed. The ones in src/cobra/data are example files for users installing cobra without development and without tests.
If we want to have tests rely on the files in src/cobra/data we can rewrite tests and update_pickles.py, which I'd be happy to do in a different PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds good to me 👍

"1208453",
"1652654"
]
},
"id": "b1676",
Expand Down Expand Up @@ -84,7 +84,7 @@
},
{
"annotation": {
"ncbigi": "GI:1653839"
"ncbiprotein": "1653839"
},
"id": "b2779",
"name": "eno"
Expand All @@ -95,7 +95,7 @@
},
{
"annotation": {
"ncbigi": "GI:1653609"
"ncbiprotein": "1653609"
},
"id": "b2926",
"name": "pgk"
Expand All @@ -114,9 +114,9 @@
},
{
"annotation": {
"ncbigi": [
"GI:1006614",
"GI:1651919"
"ncbiprotein": [
"1006614",
"1651919"
]
},
"id": "b3916",
Expand All @@ -128,7 +128,7 @@
},
{
"annotation": {
"ncbigi": "GI:1653253"
"ncbiprotein": "1653253"
},
"id": "b4025",
"name": "pgi"
Expand Down Expand Up @@ -1278,6 +1278,7 @@
"pyr_c": 1.0
},
"name": "D-lactate dehydrogenase",
"subsystem": "Pyruvate Metabolism",
"upper_bound": 1000.0
},
{
Expand Down
Binary file modified src/cobra/data/mini.mat
Binary file not shown.
Binary file modified src/cobra/data/mini.pickle
Binary file not shown.
19 changes: 10 additions & 9 deletions src/cobra/data/mini.yml
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,7 @@
- lower_bound: -1000.0
- upper_bound: 1000.0
- gene_reaction_rule: b2133 or b1380
- subsystem: Pyruvate Metabolism
- annotation: !!omap
- bigg.reaction: LDH_D
- biocyc: META:DLACTDEHYDROGNAD-RXN
Expand Down Expand Up @@ -1080,9 +1081,9 @@
- id: b1676
- name: pykF
- annotation: !!omap
- ncbigi:
- GI:1208453
- GI:1652654
- ncbiprotein:
- '1208453'
- '1652654'
- !!omap
- id: b1723
- name: pfkB
Expand Down Expand Up @@ -1123,15 +1124,15 @@
- id: b2779
- name: eno
- annotation: !!omap
- ncbigi: GI:1653839
- ncbiprotein: '1653839'
- !!omap
- id: b2925
- name: fbaA
- !!omap
- id: b2926
- name: pgk
- annotation: !!omap
- ncbigi: GI:1653609
- ncbiprotein: '1653609'
- !!omap
- id: b2987
- name: pitB
Expand All @@ -1145,17 +1146,17 @@
- id: b3916
- name: pfkA
- annotation: !!omap
- ncbigi:
- GI:1006614
- GI:1651919
- ncbiprotein:
- '1006614'
- '1651919'
- !!omap
- id: b3919
- name: tpiA
- !!omap
- id: b4025
- name: pgi
- annotation: !!omap
- ncbigi: GI:1653253
- ncbiprotein: '1653253'
- !!omap
- id: b4395
- name: ytjC
Expand Down
16 changes: 8 additions & 8 deletions src/cobra/data/mini_cobra.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns:fbc="http://www.sbml.org/sbml/level3/version1/fbc/version2" xmlns="http://www.sbml.org/sbml/level3/version1/core" sboTerm="SBO:0000624" level="3" version="1" fbc:required="false">
<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:fbc="http://www.sbml.org/sbml/level3/version1/fbc/version2" sboTerm="SBO:0000624" level="3" version="1" fbc:required="false">
<model metaid="meta_mini_textbook" id="mini_textbook" fbc:strict="true">
<listOfUnitDefinitions>
<unitDefinition id="mmol_per_gDW_per_hr">
Expand Down Expand Up @@ -1333,8 +1333,8 @@
<rdf:Description rdf:about="#meta_G_b1676">
<bqbiol:is>
<rdf:Bag>
<rdf:li rdf:resource="https://identifiers.org/ncbigi/GI:1208453"/>
<rdf:li rdf:resource="https://identifiers.org/ncbigi/GI:1652654"/>
<rdf:li rdf:resource="https://identifiers.org/ncbiprotein/1208453"/>
<rdf:li rdf:resource="https://identifiers.org/ncbiprotein/1652654"/>
</rdf:Bag>
</bqbiol:is>
</rdf:Description>
Expand All @@ -1359,7 +1359,7 @@
<rdf:Description rdf:about="#meta_G_b2779">
<bqbiol:is>
<rdf:Bag>
<rdf:li rdf:resource="https://identifiers.org/ncbigi/GI:1653839"/>
<rdf:li rdf:resource="https://identifiers.org/ncbiprotein/1653839"/>
</rdf:Bag>
</bqbiol:is>
</rdf:Description>
Expand All @@ -1373,7 +1373,7 @@
<rdf:Description rdf:about="#meta_G_b2926">
<bqbiol:is>
<rdf:Bag>
<rdf:li rdf:resource="https://identifiers.org/ncbigi/GI:1653609"/>
<rdf:li rdf:resource="https://identifiers.org/ncbiprotein/1653609"/>
</rdf:Bag>
</bqbiol:is>
</rdf:Description>
Expand All @@ -1389,8 +1389,8 @@
<rdf:Description rdf:about="#meta_G_b3916">
<bqbiol:is>
<rdf:Bag>
<rdf:li rdf:resource="https://identifiers.org/ncbigi/GI:1006614"/>
<rdf:li rdf:resource="https://identifiers.org/ncbigi/GI:1651919"/>
<rdf:li rdf:resource="https://identifiers.org/ncbiprotein/1006614"/>
<rdf:li rdf:resource="https://identifiers.org/ncbiprotein/1651919"/>
</rdf:Bag>
</bqbiol:is>
</rdf:Description>
Expand All @@ -1404,7 +1404,7 @@
<rdf:Description rdf:about="#meta_G_b4025">
<bqbiol:is>
<rdf:Bag>
<rdf:li rdf:resource="https://identifiers.org/ncbigi/GI:1653253"/>
<rdf:li rdf:resource="https://identifiers.org/ncbiprotein/1653253"/>
</rdf:Bag>
</bqbiol:is>
</rdf:Description>
Expand Down
Binary file modified src/cobra/data/textbook.xml.gz
Binary file not shown.
Loading