Skip to content

Commit d416dc9

Browse files
committed
Merge branch 'main' into develop
# Conflicts: # pyproject.toml
2 parents 7fc7109 + 4fc2c32 commit d416dc9

3 files changed

Lines changed: 23 additions & 14 deletions

File tree

main/como/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from como.utils import stringlist_to_list
55

66
__all__ = ["stringlist_to_list", "Config"]
7-
__version__ = "1.10.0"
7+
__version__ = "1.11.1"
88

99

1010
def return_placeholder_data() -> pd.DataFrame:

main/como/create_context_specific_model.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,16 @@ def _build_with_imat(
308308
expr_vector: npt.NDArray,
309309
expr_thesh: tuple[float, float],
310310
force_gene_ids: Sequence[int],
311+
solver: str,
311312
) -> (cobra.Model, pd.DataFrame):
312313
expr_vector = np.array(expr_vector)
313-
properties = IMATProperties(exp_vector=expr_vector, exp_thresholds=expr_thesh, core=force_gene_ids, epsilon=0.01)
314+
properties = IMATProperties(
315+
exp_vector=expr_vector,
316+
exp_thresholds=expr_thesh,
317+
core=force_gene_ids,
318+
epsilon=0.01,
319+
solver=solver.upper(),
320+
)
314321
algorithm = IMAT(s_matrix, np.array(lb), np.array(ub), properties)
315322
context_rxns: npt.NDArray = algorithm.run()
316323
fluxes: pd.Series = algorithm.sol.to_series()
@@ -507,7 +514,14 @@ def _build_model( # noqa: C901
507514
elif recon_algorithm == Algorithm.IMAT:
508515
context_model_cobra: cobra.Model
509516
context_model_cobra, flux_df = _build_with_imat(
510-
reference_model, s_matrix, lb, ub, expr_vector, exp_thresh, idx_force
517+
reference_model,
518+
s_matrix,
519+
lb,
520+
ub,
521+
expr_vector,
522+
exp_thresh,
523+
idx_force,
524+
solver=solver,
511525
)
512526
imat_reactions = flux_df.rxn
513527
model_reactions = [reaction.id for reaction in context_model_cobra.reactions]
@@ -626,10 +640,10 @@ def create_context_specific_model( # noqa: C901
626640
raise ValueError(f"Output file type {output_type} not recognized. Must be one of: 'xml', 'mat', 'json'")
627641

628642
if algorithm not in Algorithm:
629-
raise ValueError(f"Algorithm {algorithm} not supported. Please use one of: GIMME, FASTCORE, or IMAT")
643+
raise ValueError(f"Algorithm {algorithm} not supported. Use one of {', '.join(a.value for a in Algorithm)}")
630644

631645
if solver not in Solver:
632-
raise ValueError(f"Solver '{solver}' not supported. Use 'GLPK' or 'GUROBI'")
646+
raise ValueError(f"Solver '{solver}' not supported. Use one of {', '.join(s.value for s in Solver)}")
633647

634648
if boundary_rxns_filepath:
635649
boundary_reactions = _collect_boundary_reactions(boundary_rxns_filepath)
@@ -662,7 +676,7 @@ def create_context_specific_model( # noqa: C901
662676
bound_ub=boundary_reactions.upper_bounds,
663677
exclude_rxns=exclude_rxns,
664678
force_rxns=force_rxns,
665-
solver=solver.value,
679+
solver=solver.value.lower(),
666680
low_thresh=low_threshold,
667681
high_thresh=high_threshold,
668682
)

pyproject.toml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ requires-python = ">=3.10,<3.13"
55
dependencies = [
66
"aiofiles>=24.1.0",
77
"aioftp>=0.23.1",
8-
"cobamp",
8+
"cobamp@git+https://github.com/JoshLoecker/cobamp@master",
99
"cobra>=0.28.0",
1010
"fast-bioservices>=0.3.9",
1111
"gurobipy>=11.0",
@@ -20,7 +20,7 @@ dependencies = [
2020
"scikit-learn>=1.5.2",
2121
"scipy>=1.7.3",
2222
"setuptools<60.0",
23-
"troppo",
23+
"troppo@git+https://github.com/JoshLoecker/troppo@master",
2424
]
2525

2626
[project.optional-dependencies]
@@ -57,14 +57,9 @@ dev-dependencies = [
5757
"cz-conventional-gitmoji>=0.6.1",
5858
]
5959

60-
[tool.uv.sources]
61-
troppo = { git = "https://github.com/JoshLoecker/troppo", rev = "update_dependencies" }
62-
cobamp = { git = "https://github.com/JoshLoecker/cobamp", rev = "update_packages" }
63-
pydantic-settings = { git = "https://github.com/pydantic/pydantic-settings" }
64-
6560
[tool.commitizen]
6661
name = "cz_conventional_commits"
6762
tag_format = "$version"
6863
version_scheme = "semver2"
6964
version_provider = "pep621"
70-
update_changelog_on_bump = true
65+
update_changelog_on_bump = true

0 commit comments

Comments
 (0)