Skip to content

Commit

Permalink
Merge pull request #144 from Fxe/dev
Browse files Browse the repository at this point in the history
Fix RAST parsing
  • Loading branch information
Fxe authored Apr 9, 2024
2 parents 76804cc + 184faf5 commit 06462e1
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v3
- name: Set up Python
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: python
python:
- 3.7
- 3.8
- 3.9
- 3.10
- 3.11
before_install:
- python --version
- pip install -U pip
Expand Down
2 changes: 2 additions & 0 deletions modelseedpy/core/msbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,8 @@ def build_full_template_model(template, model_id=None, index="0"):
:param index: index for the metabolites
:return:
"""
from modelseedpy.core.msmodel import MSModel

model = MSModel(model_id if model_id else template.id, template=template)
all_reactions = []
for rxn in template.reactions:
Expand Down
1 change: 0 additions & 1 deletion modelseedpy/core/msmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ def get_set_set(expr_str): # !!! this currently returns dictionaries, not sets?
return {frozenset({str(x) for x in dnf.inputs})}
else:
return {frozenset({str(x) for x in o.inputs}) for o in dnf.xs}
return {}


class MSModel(Model):
Expand Down
2 changes: 1 addition & 1 deletion modelseedpy/core/rast_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def annotate_genome(self, genome):
for o in res[0]["features"]:
feature = genome.features.get_by_id(o["id"])
if "function" in o:
functions = re.split("; | / | @ | => ", o["function"])
functions = re.split("; | / | @", o["function"])
for function in functions:
feature.add_ontology_term("RAST", function)

Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Natural Language :: English",
],
install_requires=[
"networkx >= 2.4",
"cobra >= 0.28.0",
"cobra >= 0.29.0",
"scikit-learn == 1.2.0", # version lock for pickle ML models
"scipy >= 1.5.4",
"chemicals >= 1.0.13",
Expand Down
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions tests/test_data/mock_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,9 @@ def remap(model, bigg_to_seed_cpd, bigg_to_seed_rxn, index="0"):


def mock_model_ecoli_core(seed=True):
from cobra.io import load_json_model
from os import path
from cobra.io import load_model

model = load_json_model(path.join(path.dirname(__file__), "e_coli_core.json"))
model = load_model("textbook")
if not seed:
return model
bigg_to_seed_cpd = {
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[tox]
envlist = py38,py39,py310
envlist = py39,py310,py311

[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311

[testenv]
setenv = ARCHIVEINTERFACE_CPCONFIG = {toxinidir}/server.conf
Expand Down

0 comments on commit 06462e1

Please sign in to comment.