Skip to content
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
2 changes: 1 addition & 1 deletion main/como/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from como.utils import stringlist_to_list

__all__ = ["stringlist_to_list", "Config"]
__version__ = "1.10.0"
__version__ = "1.11.0"


def return_placeholder_data() -> pd.DataFrame:
Expand Down
19 changes: 16 additions & 3 deletions main/como/create_context_specific_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,16 @@ def _build_with_imat(
expr_vector: npt.NDArray,
expr_thesh: tuple[float, float],
force_gene_ids: Sequence[int],
solver: str,
) -> (cobra.Model, pd.DataFrame):
expr_vector = np.array(expr_vector)
properties = IMATProperties(exp_vector=expr_vector, exp_thresholds=expr_thesh, core=force_gene_ids, epsilon=0.01)
properties = IMATProperties(
exp_vector=expr_vector,
exp_thresholds=expr_thesh,
core=force_gene_ids,
epsilon=0.01,
solver=solver.upper(),
)
algorithm = IMAT(s_matrix, np.array(lb), np.array(ub), properties)
context_rxns: npt.NDArray = algorithm.run()
fluxes: pd.Series = algorithm.sol.to_series()
Expand Down Expand Up @@ -419,7 +426,6 @@ def _build_model( # noqa: C901
force excluded even if they meet GPR association requirements using the force exclude file.
"""
config = Config()
cobra.Configuration().solver = solver.lower()
reference_model: cobra.Model
match general_model_file.suffix:
case ".mat":
Expand Down Expand Up @@ -508,7 +514,14 @@ def _build_model( # noqa: C901
elif recon_algorithm == Algorithm.IMAT:
context_model_cobra: cobra.Model
context_model_cobra, flux_df = _build_with_imat(
reference_model, s_matrix, lb, ub, expr_vector, exp_thresh, idx_force
reference_model,
s_matrix,
lb,
ub,
expr_vector,
exp_thresh,
idx_force,
solver=solver,
)
imat_reactions = flux_df.rxn
model_reactions = [reaction.id for reaction in context_model_cobra.reactions]
Expand Down
8 changes: 2 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ dependencies = [
"openpyxl>=3.1.5",
"aiofiles>=24.1.0",
"aioftp>=0.23.1",
"troppo",
"cobamp",
"troppo@git+https://github.com/JoshLoecker/troppo@master",
"cobamp@git+https://github.com/JoshLoecker/cobamp@master",
]

[build-system]
Expand Down Expand Up @@ -46,7 +46,3 @@ dev-dependencies = [
"hypothesis>=6.122.1",
"pytest-cov>=6.0.0",
]

[tool.uv.sources]
troppo = { git = "https://github.com/JoshLoecker/troppo", rev = "update_dependencies" }
cobamp = { git = "https://github.com/JoshLoecker/cobamp", rev = "update_packages" }