seed2lp 2.0.0__py3-none-any.whl → 2.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- seed2lp/__main__.py +124 -70
- seed2lp/_version.py +1 -1
- seed2lp/argument.py +6 -6
- seed2lp/asp/enum-cc.lp +3 -3
- seed2lp/clingo_lpx.py +14 -6
- seed2lp/description.py +44 -33
- seed2lp/file.py +6 -3
- seed2lp/flux.py +23 -17
- seed2lp/linear.py +37 -36
- seed2lp/log_conf.yaml +4 -4
- seed2lp/logger.py +83 -39
- seed2lp/network.py +55 -68
- seed2lp/reaction.py +4 -2
- seed2lp/reasoning.py +29 -26
- seed2lp/reasoningcom.py +27 -20
- seed2lp/reasoninghybrid.py +30 -25
- seed2lp/sbml.py +4 -2
- seed2lp/scope.py +14 -12
- seed2lp/solver.py +44 -41
- seed2lp/utils.py +7 -3
- seed2lp-2.1.0.dist-info/METADATA +621 -0
- {seed2lp-2.0.0.dist-info → seed2lp-2.1.0.dist-info}/RECORD +28 -28
- {seed2lp-2.0.0.dist-info → seed2lp-2.1.0.dist-info}/WHEEL +1 -1
- tests/normalization.py +8 -8
- tests/utils.py +18 -10
- seed2lp-2.0.0.dist-info/METADATA +0 -404
- {seed2lp-2.0.0.dist-info → seed2lp-2.1.0.dist-info}/entry_points.txt +0 -0
- {seed2lp-2.0.0.dist-info → seed2lp-2.1.0.dist-info}/licenses/LICENCE.txt +0 -0
- {seed2lp-2.0.0.dist-info → seed2lp-2.1.0.dist-info}/top_level.txt +0 -0
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
seed2lp/__init__.py,sha256=zWlSZ8ABRjc2pvv4U3pQ3k6d_n783xGyYWLLH5SOzf0,394
|
|
2
|
-
seed2lp/__main__.py,sha256=
|
|
3
|
-
seed2lp/_version.py,sha256=
|
|
4
|
-
seed2lp/argument.py,sha256=
|
|
5
|
-
seed2lp/clingo_lpx.py,sha256=
|
|
2
|
+
seed2lp/__main__.py,sha256=wAde2yk1u3B-htMbmQdFmGUrvu7VOWqzo0gI-xw5XNg,33981
|
|
3
|
+
seed2lp/_version.py,sha256=asT-DgNgxRtTXtRcRnjOMRQHO0O8t1paQKw1lMWHal0,75
|
|
4
|
+
seed2lp/argument.py,sha256=19-PH8x6WwBOItXyVeaef8MYYyV2fh5tXjfPP6iQW08,29714
|
|
5
|
+
seed2lp/clingo_lpx.py,sha256=pGh2bW0frvffBVHyFHPdzo5AzstLxIh6doOUSsxwzWU,9629
|
|
6
6
|
seed2lp/color.py,sha256=GVRb5uuljv-EW9n7QFpaiXzZJ1-deIVXF4zoeVEepIc,715
|
|
7
7
|
seed2lp/config.yaml,sha256=FosxRNjvm5vOO-mYH0Ado8EEc8KrNf92s36_3WiAI-U,1900
|
|
8
|
-
seed2lp/description.py,sha256=
|
|
9
|
-
seed2lp/file.py,sha256=
|
|
10
|
-
seed2lp/flux.py,sha256=
|
|
11
|
-
seed2lp/linear.py,sha256=
|
|
12
|
-
seed2lp/log_conf.yaml,sha256=
|
|
13
|
-
seed2lp/logger.py,sha256=
|
|
8
|
+
seed2lp/description.py,sha256=Qq0Z7yLshuWDLCu5xYcxjYRepM5YVHsCtnpuMMnRegE,20601
|
|
9
|
+
seed2lp/file.py,sha256=y8nlvxcSRotWf5lDRtvXXaG7WTHtEW2HB_KB8uJiVds,4112
|
|
10
|
+
seed2lp/flux.py,sha256=vzTgJQMQ2L42UK-SD-wN0GbSLu4tXGVhKr-VuM0sKJ0,15237
|
|
11
|
+
seed2lp/linear.py,sha256=7gdqJHAgWkWZtDli2_wBgz9tkndx5iVTVCfVpEYuHk0,22866
|
|
12
|
+
seed2lp/log_conf.yaml,sha256=qBi5hxanmEPt9-UcwEzpTjXjZsDLzmI85EJypcPOZTg,469
|
|
13
|
+
seed2lp/logger.py,sha256=5HiS_1XLglOvtWBc4LIEPfwjKslrsf9WFidj812guqU,4645
|
|
14
14
|
seed2lp/metabolite.py,sha256=tlqYfmiybaXykIpDNA3qRmRPiO0Gso-DsZingJZtSj4,2120
|
|
15
|
-
seed2lp/network.py,sha256=
|
|
16
|
-
seed2lp/reaction.py,sha256
|
|
17
|
-
seed2lp/reasoning.py,sha256
|
|
18
|
-
seed2lp/reasoningcom.py,sha256=
|
|
19
|
-
seed2lp/reasoninghybrid.py,sha256=
|
|
15
|
+
seed2lp/network.py,sha256=IWxMnZfONjtMf_lCh2e-O2DQH7vEwv51JKb31OKYkXM,91781
|
|
16
|
+
seed2lp/reaction.py,sha256=-wzJM58Swp_429EwBa8nj6igdOLPm3VOqcFGj1rjfTI,9641
|
|
17
|
+
seed2lp/reasoning.py,sha256=7n_sFeaJhTy7ZEKjOp55lhIqJMb214Pw2cZsQh8Uu9k,21472
|
|
18
|
+
seed2lp/reasoningcom.py,sha256=M6MNatdADS6NAdGHYYLT0A7MvudwbRjUMEimIH8CKDw,38502
|
|
19
|
+
seed2lp/reasoninghybrid.py,sha256=ahm_nzsxN-pSk_sinJwTOO7EnGkV_Pob74Ds6QwxyCw,39919
|
|
20
20
|
seed2lp/resmod.py,sha256=eSp0n7IjBRD15a4oKl69femmZGHkKDoF_mX5nIrczi4,3588
|
|
21
|
-
seed2lp/sbml.py,sha256=
|
|
22
|
-
seed2lp/scope.py,sha256=
|
|
23
|
-
seed2lp/solver.py,sha256=
|
|
21
|
+
seed2lp/sbml.py,sha256=q8WihuScMtWYm2s2rMk8sNFb7kcqQq-2mA0glV_bLAc,10220
|
|
22
|
+
seed2lp/scope.py,sha256=qDknPTnb9EhfmZVs87-IdxA1j-2oYnk6cdWxfM3nePI,5721
|
|
23
|
+
seed2lp/solver.py,sha256=cupOy7tiosBlSLaPbfmaEC9aIUqNojyzqIHtjPJqq3g,17592
|
|
24
24
|
seed2lp/temp_flux_com.py,sha256=9ceHfXZ2Thc5KtsRNTsawrvFOE-33HyNUU13I-pjviE,2553
|
|
25
|
-
seed2lp/utils.py,sha256=
|
|
25
|
+
seed2lp/utils.py,sha256=8KfV22TzdSO6RrrmdrWOkblgbL_bjh_RTYDK_CVH7LA,8566
|
|
26
26
|
seed2lp/asp/atom_for_transfers.lp,sha256=w8Lg_s1bEcdsuBXBVlPgFpOhyZZcF0UyHOrDS4gLGtg,320
|
|
27
27
|
seed2lp/asp/community_heuristic.lp,sha256=2FKrNLbIJG14QdjrEE0rMlGOP_l5mw9n2ZDoT5unRrc,140
|
|
28
28
|
seed2lp/asp/community_search.lp,sha256=Q0yCdH2NufmXgyPMEdtlgFDAMR8uS92ExjYIar6Nwjk,703
|
|
29
29
|
seed2lp/asp/constraints_targets.lp,sha256=uiVrXjKo19lES7LcNXA48Evl0PKPT3OoBAj7dGHSmeM,528
|
|
30
30
|
seed2lp/asp/definition_atoms.lp,sha256=FuWXggEq0VHk9iW67-tjVVT-U71JI0wNalzmkTP4TDM,3583
|
|
31
|
-
seed2lp/asp/enum-cc.lp,sha256=
|
|
31
|
+
seed2lp/asp/enum-cc.lp,sha256=PFI_AL9axXrrR77yi6B7J130wbkGyDUzVc9r_E7l_9o,1348
|
|
32
32
|
seed2lp/asp/flux.lp,sha256=vaKcTWUXvsmYyAa903zIrKr3_NKf5yzT94X_wV-AQkU,3596
|
|
33
33
|
seed2lp/asp/limit_transfers.lp,sha256=R0xv5spWrmJtrkymCoJo-2kh7JDQYkDmdG0NTYxzzv8,411
|
|
34
34
|
seed2lp/asp/maximize_flux.lp,sha256=L5u-gjlfYJncXEeg90y_GmM_XGSckjJPJ_7fcgVbVE8,46
|
|
@@ -39,15 +39,15 @@ seed2lp/asp/seed_external.lp,sha256=FGLXh9rfg3FtdkvPuEGIqCAgwTtFMlJZHopPmQxojlQ,
|
|
|
39
39
|
seed2lp/asp/show_seeds.lp,sha256=N3dKwHB1idgfFvxR5x-BpbCURIPo5knXJ9gdjxw9KN8,32
|
|
40
40
|
seed2lp/asp/show_tranfers.lp,sha256=r5q1LsZ4JBZv7GhFLmTmzv592i9K4_-ppa-HVK7jMpY,20
|
|
41
41
|
seed2lp/asp/test.lp,sha256=P79bIUCT_wZUho5oT1JLSfpRXbrnUXXgcg_hfeRGn-w,1199
|
|
42
|
-
seed2lp-2.
|
|
42
|
+
seed2lp-2.1.0.dist-info/licenses/LICENCE.txt,sha256=rymAta8z0pwrrZEKjbZ7sKE4SwTwIibuHYwF3cNo51w,7662
|
|
43
43
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
44
44
|
tests/fba.py,sha256=a7E82uLdYEWa2vU-XFrehx5mm-ET5xgOqIpdEjzckWc,5156
|
|
45
45
|
tests/full_network.py,sha256=8WIqRbCz7N0US1lBMaYxFdcbsj1VhLI3Nbz2LC1oXHw,6001
|
|
46
|
-
tests/normalization.py,sha256=
|
|
46
|
+
tests/normalization.py,sha256=Cy-NCUyGNf-KwQPo-Oh4A8dL2cNL3j5LwcmxterB5vo,5975
|
|
47
47
|
tests/target.py,sha256=_hGod6xEInMx1l4SD1iG2cnBxD7L7jdcM226x7AcrhM,9645
|
|
48
|
-
tests/utils.py,sha256=
|
|
49
|
-
seed2lp-2.
|
|
50
|
-
seed2lp-2.
|
|
51
|
-
seed2lp-2.
|
|
52
|
-
seed2lp-2.
|
|
53
|
-
seed2lp-2.
|
|
48
|
+
tests/utils.py,sha256=4YAUst7El_0IpeAyDC2mYtXpOjlvt3Yma-Tsv0qkhD8,6955
|
|
49
|
+
seed2lp-2.1.0.dist-info/METADATA,sha256=Oe8p5rzpn1awXAZMPiliDAoKxiv4itP5e3aMzrsKHVY,28205
|
|
50
|
+
seed2lp-2.1.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
51
|
+
seed2lp-2.1.0.dist-info/entry_points.txt,sha256=eVeu66obgZSj5jsvbJ4mdtchMU7hkfQLFY8ThuU0GNA,50
|
|
52
|
+
seed2lp-2.1.0.dist-info/top_level.txt,sha256=I0kzFikY6lfRvzNZbs01GkkBTRnGVHxvBmPhpr-hEaY,14
|
|
53
|
+
seed2lp-2.1.0.dist-info/RECORD,,
|
tests/normalization.py
CHANGED
|
@@ -72,7 +72,7 @@ def test_exchange():
|
|
|
72
72
|
topological_injection = False
|
|
73
73
|
keep_import_reactions = False
|
|
74
74
|
|
|
75
|
-
network = get_network(INFILE, run_mode, targets_as_seeds,
|
|
75
|
+
network, log_path = get_network(INFILE, run_mode, targets_as_seeds,
|
|
76
76
|
topological_injection, keep_import_reactions)
|
|
77
77
|
assert set(network.exchanged_reactions) == EXCH
|
|
78
78
|
|
|
@@ -83,7 +83,7 @@ def test_delete():
|
|
|
83
83
|
topological_injection = False
|
|
84
84
|
keep_import_reactions = False
|
|
85
85
|
|
|
86
|
-
network = get_network(INFILE, run_mode, targets_as_seeds,
|
|
86
|
+
network, log_path = get_network(INFILE, run_mode, targets_as_seeds,
|
|
87
87
|
topological_injection, keep_import_reactions)
|
|
88
88
|
assert set(network.deleted_reactions) == DEL
|
|
89
89
|
|
|
@@ -94,7 +94,7 @@ def test_rev_modified():
|
|
|
94
94
|
topological_injection = False
|
|
95
95
|
keep_import_reactions = False
|
|
96
96
|
|
|
97
|
-
network = get_network(INFILE, run_mode, targets_as_seeds,
|
|
97
|
+
network, log_path = get_network(INFILE, run_mode, targets_as_seeds,
|
|
98
98
|
topological_injection, keep_import_reactions)
|
|
99
99
|
assert set(network.reversible_modified_reactions.keys()) == REV
|
|
100
100
|
|
|
@@ -108,7 +108,7 @@ def test_rm_rxn():
|
|
|
108
108
|
topological_injection = False
|
|
109
109
|
keep_import_reactions = False
|
|
110
110
|
|
|
111
|
-
network = get_network(INFILE, run_mode, targets_as_seeds,
|
|
111
|
+
network, log_path = get_network(INFILE, run_mode, targets_as_seeds,
|
|
112
112
|
topological_injection, keep_import_reactions)
|
|
113
113
|
network.convert_to_facts()
|
|
114
114
|
|
|
@@ -130,7 +130,7 @@ def test_kir():
|
|
|
130
130
|
topological_injection = False
|
|
131
131
|
keep_import_reactions = True
|
|
132
132
|
|
|
133
|
-
network = get_network(INFILE, run_mode, targets_as_seeds,
|
|
133
|
+
network, log_path = get_network(INFILE, run_mode, targets_as_seeds,
|
|
134
134
|
topological_injection, keep_import_reactions)
|
|
135
135
|
network.convert_to_facts()
|
|
136
136
|
|
|
@@ -151,7 +151,7 @@ def test_ti():
|
|
|
151
151
|
topological_injection = True
|
|
152
152
|
keep_import_reactions = True
|
|
153
153
|
|
|
154
|
-
network = get_network(INFILE, run_mode, targets_as_seeds,
|
|
154
|
+
network, log_path = get_network(INFILE, run_mode, targets_as_seeds,
|
|
155
155
|
topological_injection, keep_import_reactions)
|
|
156
156
|
network.convert_to_facts()
|
|
157
157
|
|
|
@@ -172,7 +172,7 @@ def test_taf():
|
|
|
172
172
|
targets_as_seeds = False
|
|
173
173
|
topological_injection = False
|
|
174
174
|
keep_import_reactions = False
|
|
175
|
-
network = get_network(INFILE, run_mode, targets_as_seeds,
|
|
175
|
+
network, log_path = get_network(INFILE, run_mode, targets_as_seeds,
|
|
176
176
|
topological_injection, keep_import_reactions)
|
|
177
177
|
assert set(network.forbidden_seeds) == FORBID_TAF
|
|
178
178
|
|
|
@@ -182,7 +182,7 @@ def test_tas():
|
|
|
182
182
|
targets_as_seeds = True
|
|
183
183
|
topological_injection = False
|
|
184
184
|
keep_import_reactions = False
|
|
185
|
-
network = get_network(INFILE, run_mode, targets_as_seeds,
|
|
185
|
+
network, log_path = get_network(INFILE, run_mode, targets_as_seeds,
|
|
186
186
|
topological_injection, keep_import_reactions)
|
|
187
187
|
# check if list is empty
|
|
188
188
|
assert not network.forbidden_seeds
|
tests/utils.py
CHANGED
|
@@ -3,7 +3,7 @@ from seed2lp.network import Network
|
|
|
3
3
|
from seed2lp.reasoning import Reasoning
|
|
4
4
|
from seed2lp.linear import Hybrid, FBA
|
|
5
5
|
from seed2lp.__main__ import get_reaction_options, get_input_datas
|
|
6
|
-
from seed2lp import
|
|
6
|
+
from seed2lp.logger import get_logger
|
|
7
7
|
from seed2lp.file import is_valid_dir
|
|
8
8
|
|
|
9
9
|
################ DIRECTORIES AND FILES ###################
|
|
@@ -12,8 +12,6 @@ RESULT_DIR=path.join(TEST_DIR,"results")
|
|
|
12
12
|
TMP_DIR=path.join(TEST_DIR,"tmp")
|
|
13
13
|
is_valid_dir(RESULT_DIR)
|
|
14
14
|
is_valid_dir(TMP_DIR)
|
|
15
|
-
logger.set_log_dir(path.join(TEST_DIR, RESULT_DIR,"logs"))
|
|
16
|
-
is_valid_dir(logger.LOG_DIR)
|
|
17
15
|
########################################################
|
|
18
16
|
|
|
19
17
|
|
|
@@ -79,23 +77,23 @@ def search_seed(infile:str, run_mode:str, solve:str, optim:str, targets_as_seeds
|
|
|
79
77
|
|
|
80
78
|
|
|
81
79
|
|
|
82
|
-
network= get_network(infile, run_mode, targets_as_seeds, topological_injection,
|
|
80
|
+
network, log_path = get_network(infile, run_mode, targets_as_seeds, topological_injection,
|
|
83
81
|
keep_import_reactions, accumulation, opt_short=options['short'])
|
|
84
82
|
network.convert_to_facts()
|
|
85
83
|
network.simplify()
|
|
86
84
|
|
|
87
85
|
if run_mode != "fba":
|
|
88
|
-
model = Reasoning(run_mode, solve, network, TIME_LIMIT, NB_SOLUTION,
|
|
86
|
+
model = Reasoning(run_mode, solve, network, log_path, TIME_LIMIT, NB_SOLUTION,
|
|
89
87
|
CLINGO_CONF,CLINGO_STRAT, INTERSECTION, UNION, minimize, subset_minimal,
|
|
90
88
|
TMP_DIR, options['short'], VERBOSE)
|
|
91
89
|
model.search_seed()
|
|
92
90
|
|
|
93
|
-
model = Hybrid(run_mode, solve, network, TIME_LIMIT, NB_SOLUTION,
|
|
91
|
+
model = Hybrid(run_mode, solve, network, log_path, TIME_LIMIT, NB_SOLUTION,
|
|
94
92
|
CLINGO_CONF,CLINGO_STRAT, INTERSECTION, UNION, minimize, subset_minimal,
|
|
95
93
|
maximization, TMP_DIR, options['short'], VERBOSE)
|
|
96
94
|
model.search_seed()
|
|
97
95
|
else:
|
|
98
|
-
model = FBA(run_mode, network, TIME_LIMIT, NB_SOLUTION,
|
|
96
|
+
model = FBA(run_mode, network, log_path, TIME_LIMIT, NB_SOLUTION,
|
|
99
97
|
CLINGO_CONF,CLINGO_STRAT, INTERSECTION, UNION, minimize, subset_minimal,
|
|
100
98
|
maximization, TMP_DIR, options['short'], VERBOSE)
|
|
101
99
|
model.search_seed()
|
|
@@ -168,14 +166,24 @@ def get_network(infile:str, run_mode:str, targets_as_seeds:bool,
|
|
|
168
166
|
seeds_file:str=None, forbidden_seeds_file:str=None, possible_seeds_file:str=None,
|
|
169
167
|
opt_short:str="test"):
|
|
170
168
|
|
|
171
|
-
logger.get_logger(infile, opt_short, VERBOSE)
|
|
169
|
+
#logger.get_logger(infile, opt_short, VERBOSE)
|
|
170
|
+
#get_logger(infile, opt_short, VERBOSE)
|
|
171
|
+
log_dir = path.join(TEST_DIR, RESULT_DIR,"logs")
|
|
172
|
+
is_valid_dir(log_dir)
|
|
173
|
+
logger, log_path = get_logger(
|
|
174
|
+
log_dir=log_dir,
|
|
175
|
+
sbml_file=infile,
|
|
176
|
+
short_option= "get_network",
|
|
177
|
+
verbose=False
|
|
178
|
+
)
|
|
179
|
+
|
|
172
180
|
input_dict = get_input_datas(seeds_file, forbidden_seeds_file, possible_seeds_file)
|
|
173
181
|
network = Network(infile, run_mode, targets_as_seeds,
|
|
174
182
|
topological_injection, keep_import_reactions,
|
|
175
|
-
input_dict, accumulation)
|
|
183
|
+
input_dict, accumulation, verbose=VERBOSE)
|
|
176
184
|
|
|
177
185
|
if not targets_as_seeds:
|
|
178
186
|
network.forbidden_seeds += network.targets
|
|
179
|
-
return network
|
|
187
|
+
return network, log_path
|
|
180
188
|
|
|
181
189
|
########################################################
|
seed2lp-2.0.0.dist-info/METADATA
DELETED
|
@@ -1,404 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: seed2lp
|
|
3
|
-
Version: 2.0.0
|
|
4
|
-
Summary: Seed searching from network as SBML using Logic programming
|
|
5
|
-
Home-page: http://github.com/bioasp/seed2lp
|
|
6
|
-
Author: Chabname Ghassemi Nedjad
|
|
7
|
-
Author-email: chabname.ghassemi-nedjad@inria.fr
|
|
8
|
-
License: GPL
|
|
9
|
-
Keywords: Answer Set Programming,wrapper,clingo
|
|
10
|
-
Classifier: Development Status :: 4 - Beta
|
|
11
|
-
Classifier: Intended Audience :: Science/Research
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
-
Classifier: Programming Language :: ASP
|
|
14
|
-
Description-Content-Type: text/markdown
|
|
15
|
-
License-File: LICENCE.txt
|
|
16
|
-
Requires-Dist: clyngor>=0.3.18
|
|
17
|
-
Requires-Dist: pytest>=4.4.0
|
|
18
|
-
Requires-Dist: biseau>=0.0.16
|
|
19
|
-
Requires-Dist: cobra
|
|
20
|
-
Requires-Dist: clyngor-with-clingo
|
|
21
|
-
Requires-Dist: clingo-lpx
|
|
22
|
-
Requires-Dist: pyyaml
|
|
23
|
-
Requires-Dist: menetools
|
|
24
|
-
Requires-Dist: padmet
|
|
25
|
-
Requires-Dist: tqdm
|
|
26
|
-
Provides-Extra: tests
|
|
27
|
-
Requires-Dist: pytest; extra == "tests"
|
|
28
|
-
Dynamic: author
|
|
29
|
-
Dynamic: author-email
|
|
30
|
-
Dynamic: classifier
|
|
31
|
-
Dynamic: home-page
|
|
32
|
-
Dynamic: license
|
|
33
|
-
Dynamic: license-file
|
|
34
|
-
Dynamic: summary
|
|
35
|
-
|
|
36
|
-
# Seed2LP
|
|
37
|
-
|
|
38
|
-
Seed2LP is a Python tool that searches seeds in metabolic networks. It uses answer set programming (ASP) and provides three approaches for seed detection:
|
|
39
|
-
- [**Full network**](#full-network) mode, that activates all compounds of the metabolic network.
|
|
40
|
-
- [**Target**](#target) mode, that activates metabolites of interest.
|
|
41
|
-
- [**FBA**](#fba) mode, that randomly searches seeds ensuring a positive flux into the objective reaction
|
|
42
|
-
|
|
43
|
-
The notebook directory of this repo contains scripts that reproduce the results presented in the associated paper.
|
|
44
|
-
|
|
45
|
-
</br>
|
|
46
|
-
<hr style="border: 4px outset" size="8" >
|
|
47
|
-
|
|
48
|
-
## Install
|
|
49
|
-
|
|
50
|
-
**From github**
|
|
51
|
-
```
|
|
52
|
-
pip install git+https://github.com/bioasp/seed2lp
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
**From repository source after git clone**
|
|
56
|
-
|
|
57
|
-
```
|
|
58
|
-
pip install .
|
|
59
|
-
```
|
|
60
|
-
or
|
|
61
|
-
```
|
|
62
|
-
python setup.py install
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
</br>
|
|
67
|
-
|
|
68
|
-
## Requirements
|
|
69
|
-
|
|
70
|
-
Requires Python >= 3.10.
|
|
71
|
-
|
|
72
|
-
For below requirements, installing Seed2LP will install all needed packages if not already installed.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
| name | version |
|
|
77
|
-
|:----------:|:-------------:|
|
|
78
|
-
| [clyngor](https://github.com/Aluriak/clyngor) | 0.3.18 |
|
|
79
|
-
| [clingo-lpx](https://github.com/potassco/clingo-lpx) | 1.3.0 |
|
|
80
|
-
| [cobrapy](https://cobrapy.readthedocs.io/en/latest/index.html) | 0.26.0 |
|
|
81
|
-
| [pyyaml](https://pyyaml.org/wiki/PyYAMLDocumentation) | 6.0 |
|
|
82
|
-
| [menetools](https://github.com/cfrioux/MeneTools) | 3.4.0 |
|
|
83
|
-
| [padmet](https://github.com/AuReMe/padmet) | 5.0.1 |
|
|
84
|
-
|
|
85
|
-
<hr style="border: 4px outset" size="8" >
|
|
86
|
-
|
|
87
|
-
## Command examples
|
|
88
|
-
The following examples uses a toy described on Seed2LP paper.
|
|
89
|
-
|
|
90
|
-
> Get all solutions in all Target modes (Reasoning, Filter, Guess&Check, Guess&Check with Diversity, Hybrid lpx), in all optimisations (subset minimal and minimize)
|
|
91
|
-
>```
|
|
92
|
-
>seed2lp target networks/toys/SBML/toy_paper.SBML results/toys/
|
|
93
|
-
>```
|
|
94
|
-
|
|
95
|
-
> Get one solution in Full Network in reasoning and check flux
|
|
96
|
-
>```
|
|
97
|
-
>seed2lp full networks/toys/SBML/toy_paper.SBML results/toys/ -nbs 1 -so reasoning -cf
|
|
98
|
-
>```
|
|
99
|
-
|
|
100
|
-
> Get one solution in FBA only in subset minimal
|
|
101
|
-
>```
|
|
102
|
-
>seed2lp fba networks/toys/SBML/toy_paper.SBML results/toys/ -nbs 1 -m subsetmin
|
|
103
|
-
>```
|
|
104
|
-
|
|
105
|
-
<hr style="border: 4px outset" size="8" >
|
|
106
|
-
|
|
107
|
-
## 📜[Network analyse](documentations/network_analyse.mkd)
|
|
108
|
-
The first step of the tool is to read the network, analyse it to be able to perform a logic analyse of the Network, each reaction must be defined as follows:
|
|
109
|
-
|
|
110
|
-
$$ Reaction: Set\{reactants\} ⟶ Set\{products\} \quad with \quad bounds = [0,\infty]$$
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
For each reaction, multiple factors are verified and correction is done if needed such as swapping set of reactants and set of products if the boundaries of a reaction are negative or deleting reactions with null boundaries. A warning is outputted when changes are done.
|
|
114
|
-
|
|
115
|
-
📃 **Output example:**
|
|
116
|
-
|
|
117
|
-
```
|
|
118
|
-
WARNING :
|
|
119
|
-
- R_R2: Deleted.
|
|
120
|
-
Boundaries was: [0.0 ; 0.0]
|
|
121
|
-
- R_R7: Reactants and products switched.
|
|
122
|
-
Boundaries was: [-1000.0 ; 0.0]
|
|
123
|
-
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
## Search mode features
|
|
127
|
-
It is possible to run Seed2LP for all the 3 modes ([**Full network**](#full-network), [**Target**](#target) and [**FBA**](#fba) by changing the command, and for each one to use specifics arguments.
|
|
128
|
-
|
|
129
|
-
There are also 2 additional features:
|
|
130
|
-
- [**Network**](#network): allows drawing the network from the ASP definition and checking the network ASP decription by comparing with the Cobrapy description, or write into an SBML file the corrected network (exchanging products and reactants or delteing reaction with all boundaries to 0)
|
|
131
|
-
- [**Flux**](#flux): Allows checking the flux with Cobrapy from Seed2LP result files, or any file having the same json structure than Seed2LP.
|
|
132
|
-
|
|
133
|
-
<br/>
|
|
134
|
-
<hr style="border: 1px dotted" >
|
|
135
|
-
|
|
136
|
-
### 📜 [<ins>Full Network</ins>](documentations/full_network.mkd)
|
|
137
|
-
This mode searches seeds with this goal: "activate"/"produce" all reaction/metabolites of the network.
|
|
138
|
-
> 💻 **Command:**
|
|
139
|
-
>
|
|
140
|
-
> ```
|
|
141
|
-
> seed2lp full [network_file] [output_directory] [arguments]
|
|
142
|
-
> ```
|
|
143
|
-
|
|
144
|
-
There are also two submodes:
|
|
145
|
-
- 📜 [Reasoning](documentations/full_network.mkd#reasoning): Use ASP solving with clingo
|
|
146
|
-
- **Classic:** Use reasoning (logical, Boolean abstraction of metabolic activity) search only, without calculating flux into objective reaction
|
|
147
|
-
- **Filter:** Use reasoning search only, but for all results the flux is checked with [cobrapy](https://cobrapy.readthedocs.io/en/latest/index.html), and only the solutions having flux are returned.
|
|
148
|
-
- **Guess-check:** Use reasoning search and directly interact with the solver during solving by adding new constraints. Flux is checked with [cobrapy](https://cobrapy.readthedocs.io/en/latest/index.html) for every solution proposed by the solver and new constraints are derived out of it to guide the remaining solving process. All outputted solutions have flux natively.
|
|
149
|
-
- 📜 [Hybrid](documentations/full_network.mkd#hybrid): Ensure the resulting model statisfies both logical and flux constraints using a hybrid ASP-LP solver.
|
|
150
|
-
|
|
151
|
-
<br/>
|
|
152
|
-
<hr style="border: 1px dotted" >
|
|
153
|
-
|
|
154
|
-
### 📜 [<ins>Target</ins>](documentations/target.mkd)
|
|
155
|
-
This mode searches seeds with this goal: producing a set of metabolites, or if a reaction is given, ensuring the production of the reactants needed for its activation.
|
|
156
|
-
> 💻 **Command:**
|
|
157
|
-
>
|
|
158
|
-
> ```
|
|
159
|
-
> seed2lp target [network_file] [output_directory] [arguments]
|
|
160
|
-
> ```
|
|
161
|
-
|
|
162
|
-
There are also two submodes:
|
|
163
|
-
- 📜 [Reasoning](documentations/target.mkd): Use ASP solving with clingo
|
|
164
|
-
- **Classic:** Use reasoning (logical, Boolean abstraction of metabolic activity) search only, without calculating flux into objective reaction
|
|
165
|
-
- **Filter:** Use reasoning search only, but for all results the flux is checked with [cobrapy](https://cobrapy.readthedocs.io/en/latest/index.html), and only the solutions having flux are returned.
|
|
166
|
-
- **Guess-check:** Use reasoning search and directly interact with the solver during solving by adding new constraints. Flux is checked with [cobrapy](https://cobrapy.readthedocs.io/en/latest/index.html) for every solution proposed by the solver and new constraints are derived out of it to guide the remaining solving process. All outputted solutions have flux natively.
|
|
167
|
-
- 📜 [Hybrid](documentations/target.mkd): Ensure the resulting model statisfies both logical and flux constraints using a hybrid ASP-LP solver.
|
|
168
|
-
|
|
169
|
-
<br/>
|
|
170
|
-
<hr style="border: 1px dotted" >
|
|
171
|
-
|
|
172
|
-
### 📜 [<ins>FBA</ins>](documentations/fba.mkd)
|
|
173
|
-
This mode randomly searches seeds by ensuring flux on objective reaction.
|
|
174
|
-
|
|
175
|
-
> 💻 **Command:**
|
|
176
|
-
>
|
|
177
|
-
> ```
|
|
178
|
-
> seed2lp fba [network_file] [output_directory] [arguments]
|
|
179
|
-
> ```
|
|
180
|
-
|
|
181
|
-
</br>
|
|
182
|
-
<hr style="border: 4px outset" size="8" >
|
|
183
|
-
|
|
184
|
-
## set-mode features
|
|
185
|
-
It is possible to choose what kind of set of seeds to search.
|
|
186
|
-
|
|
187
|
-
### <ins>Subset minimal</ins>
|
|
188
|
-
The subset minimal (submin) mode finds a set of seeds which satisfies all the constraints, then from this set, it tries to eliminate seeds until it finds the minimal set that will satisfy the constraints.
|
|
189
|
-
|
|
190
|
-
This method of search **does not guarantee minimality** in terms of size of the set. But it can be a **faster way** to have set of seeds the most minimal possible from a set already validated.
|
|
191
|
-
|
|
192
|
-
> 📃 **Example:**
|
|
193
|
-
>
|
|
194
|
-
> Considering all the followings sets of seeds below, that statisfy constraints for the objective, which of them are subset minimal and will be selected?
|
|
195
|
-
>
|
|
196
|
-
> | Sets of seeds | is choosen ? | reasons |
|
|
197
|
-
> |:--------------:|:---------------:|:-------------:|
|
|
198
|
-
> | {A,B,C,D,E} | no | {A,B,C} is a set of seeds included into this set|
|
|
199
|
-
> | {A,B,C} | yes | There is no other set smaller included in this set|
|
|
200
|
-
> | {A,D,E,F} | no |{A,D,F} is a set of seeds included into this set |
|
|
201
|
-
> | {A,D,F} | yes | There is no other set smaller included in this set |
|
|
202
|
-
> | {A,C,E,F} | yes | There is no other set smaller included in this set|
|
|
203
|
-
|
|
204
|
-
<br/>
|
|
205
|
-
<hr style="border: 1px dotted" >
|
|
206
|
-
|
|
207
|
-
### <ins>Minimize</ins>
|
|
208
|
-
The minimize (min) set-mode finds set of seeds of minimal size which satisfies all the constraints.
|
|
209
|
-
|
|
210
|
-
This method of search **ensures minimality**. But it is computationally more demanding.
|
|
211
|
-
|
|
212
|
-
> 📃 **Example:**
|
|
213
|
-
>
|
|
214
|
-
> Considering all the followings sets of seeds below, that statisfy constraints for the objective, which of them are of minimal size and will be selected?
|
|
215
|
-
>
|
|
216
|
-
> | Sets of seeds | is choosen ? | reasons |
|
|
217
|
-
> |:--------------:|:---------------:|:-------------:|
|
|
218
|
-
> | {A,B,C,D,E} | no | There is a smaller set of size 3 existing |
|
|
219
|
-
> | {A,B,C} | yes | This a one of the smaller set |
|
|
220
|
-
> | {A,D,E,F} | no | There is a smaller set of size 3 existing |
|
|
221
|
-
> | {A,D,F} | yes | This a one of the smaller set |
|
|
222
|
-
> | {A,C,E,F} | no | There is a smaller set of size 3 existing|
|
|
223
|
-
|
|
224
|
-
</br>
|
|
225
|
-
|
|
226
|
-
</br>
|
|
227
|
-
<hr style="border: 4px outset" size="8" >
|
|
228
|
-
|
|
229
|
-
## Results
|
|
230
|
-
For each mode, a result json file is created. This file will write all models for all submodes reasoning / hybrid and **set-mode** subset minimial / minimize.
|
|
231
|
-
|
|
232
|
-
If the check-flux option is used, `-cf` / `--check-flux`, a tsv file is created with all the fluxes calculated with Cobrapy, and if hybrid submode or fba mode is used, the LP flux found (calculated from ASP).
|
|
233
|
-
|
|
234
|
-
The results are also written in the terminal.
|
|
235
|
-
|
|
236
|
-
</br>
|
|
237
|
-
<hr style="border: 4px outset" size="8" >
|
|
238
|
-
|
|
239
|
-
## Additional features
|
|
240
|
-
### 📜 [<ins>Network</ins>](documentations/network.mkd)
|
|
241
|
-
This feature can reconstruct a very basic picture of the network from the ASP conversion of the source network (in SBML format).
|
|
242
|
-
- It can create the picture with the reaction names, or without the reaction.
|
|
243
|
-
- It can also create all the reactions description / formula from ASP and Cobrapy and give a difference of both contents.
|
|
244
|
-
- It can write an SBML file derived from the SBML sources after correction of the network
|
|
245
|
-
- Deletion of reaction with boundaries [0,0]
|
|
246
|
-
- Exchanging set of reactants and products when boundaries negatives: ie [-1000, 0], [-100; -10], ...
|
|
247
|
-
|
|
248
|
-
> 💻 **Command:**
|
|
249
|
-
>
|
|
250
|
-
> `seed2lp network [network_file] [output_directory] [arguments]`
|
|
251
|
-
|
|
252
|
-
<br/>
|
|
253
|
-
<hr style="border: 1px dotted" >
|
|
254
|
-
|
|
255
|
-
### 📜 [<ins>Flux</ins>](documentations/flux.mkd)
|
|
256
|
-
This feature allows the calculation, using Cobrapy library, of the flux of the objective function from a result file of seed2lp and save them. This can be a validation of the solutions provided by Seed2LP.
|
|
257
|
-
|
|
258
|
-
> 💻 **Command:**
|
|
259
|
-
>
|
|
260
|
-
> `seed2lp flux [network_file] [seed2lp_result_file]`
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
> 📝 **Notes:**
|
|
265
|
-
>
|
|
266
|
-
> It is possible to do the flux calculation using Cobrapy directly after the seed search by using the argument `-cf` / `--check-flux` on each mode. A tsv file is created with all the fluxes calculated with Cobrapy, and if hybrid submode or fba mode is used, the LP flux found (calculated from ASP).
|
|
267
|
-
|
|
268
|
-
</br>
|
|
269
|
-
<hr style="border: 4px outset" size="8" >
|
|
270
|
-
|
|
271
|
-
## Main 📜 [options](documentations/options.mkd) for [search mode features](#search-mode-features)
|
|
272
|
-
|
|
273
|
-
### <ins>Data given by user</ins>
|
|
274
|
-
|
|
275
|
-
| option | short| default | description | search mode |
|
|
276
|
-
|:----------------------:|:----:|:--------:|:------------:|:-------------:|
|
|
277
|
-
| --targets-file | -tf | optional | List of metabolites⭐ and/or <br/>an objective🔆 reaction as file | Target |
|
|
278
|
-
| --objective | -o | optional | An objective🔆 reaction <br/> as command line | Full Network and FBA |
|
|
279
|
-
| --seeds-file | -sf | optional | List of metabolites⭐ known to be seeds and will <br/> be in the initial set of seeds| ALL |
|
|
280
|
-
| --possible-seeds-file | -psf | optional | List of metabolites⭐ among which the seed selection will be performed <br/> be in the set of seeds | ALL |
|
|
281
|
-
| --forbidden-seeds-file | -fsf | optional | List of metabolites⭐ that can not <br/> be in the set of seeds | ALL |
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
> 📝 **Notes:**
|
|
285
|
-
>
|
|
286
|
-
> **Target** search mode :
|
|
287
|
-
>
|
|
288
|
-
> - If **no target file** given, the targets will be the **reactants of the objective reaction** found in the SBML file. The flux calculation will be done **on the objective objective reaction** found in the SBML file.
|
|
289
|
-
> - If only **Metabolites** given in the file: the targets will be **these given metabolites**. The flux calculation will be done on the **objective objective reaction** found in the SBML file.
|
|
290
|
-
> - If only **Reaction** given in the file: the targets will be the **reactants of the objective reaction** found in the SBML file. The flux calculation will be done **on this given reaction**
|
|
291
|
-
> - If both **Metabolites** and **Reaction** given in the file: the targets will be **these given metabolites**. The flux calculation will be done **on this given reaction**
|
|
292
|
-
>
|
|
293
|
-
> **Full network** (**hybrid** submode) and **FBA** :
|
|
294
|
-
>
|
|
295
|
-
>If no objective reaction given, the objective reaction will be the one found in the SBML file for flux calculation.
|
|
296
|
-
|
|
297
|
-
> 💬 **Comments:**
|
|
298
|
-
>
|
|
299
|
-
> ⭐ One metabolite by line, must be prefixed with "M_" to fit the ID of the SBML file.
|
|
300
|
-
>
|
|
301
|
-
> 🔆 One Objective reaction only, must be prefixed with "R_" to fit the ID of the SBML file.
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
<br/>
|
|
305
|
-
<hr style="border: 1px dotted" >
|
|
306
|
-
|
|
307
|
-
### <ins>Set mode</ins>
|
|
308
|
-
|
|
309
|
-
| option | short| default | description | search mode |
|
|
310
|
-
|:-----------:|:----:|:--------:|:------------:|:-------------:|
|
|
311
|
-
| --mode | -m | subsetmin | run different set modes: <br/> minimize, subsetmin, all | ALL |
|
|
312
|
-
| --solve | -so | reasoning | run different submodes: <br/> reasoning, filter, gues-check, hybrid, all | Full Network<br> and Target |
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
<br/>
|
|
316
|
-
<hr style="border: 1px dotted" >
|
|
317
|
-
|
|
318
|
-
### <ins>Set of seed restrictions</ins>
|
|
319
|
-
|
|
320
|
-
| option | short| default | description | search mode |
|
|
321
|
-
|:----------------------:|:----:|:--------:|:------------:|:-------------:|
|
|
322
|
-
| --targets-as-seeds | -tas | False | If used, targets found are given, <br/> allowed to be in the set of seeds | ALL |
|
|
323
|
-
| --topological-injection | -ti | False | If used, the exchange⭐ metabolite <br/> from source file are set as seeds directly | ALL |
|
|
324
|
-
| --keep-import-reactions | -kir | False | If used, the exchange⭐ reactions <br/> are not deleted during the conversion to ASP| ALL |
|
|
325
|
-
| --accumulation | -accu | False | If used, solutions with possible <br/> accumulating metabolites are allowed | Full Network <br/> and Target |
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
> 💬 **Comments:**
|
|
329
|
-
>
|
|
330
|
-
> ⭐ An **exchange reaction** is defined as a reaction having **one or multiple metabolites** as reactants or products (while the other set must be empty), it represent import or export reactions, and can be reversible or not, written forwards or backwards:
|
|
331
|
-
> - R ⟶ ∅ $\quad$|$\quad$ R ⟷ ∅ $\quad$|$\quad$ R ⟵ ∅
|
|
332
|
-
> - ∅ ⟶ P $\quad$|$\quad$ ∅ ⟷ P $\quad$|$\quad$ ∅ ⟵ P
|
|
333
|
-
>
|
|
334
|
-
> An **exchange metabolite** will be the metabolite involved in the exchange reaction
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
<br/>
|
|
338
|
-
<hr style="border: 1px dotted" >
|
|
339
|
-
|
|
340
|
-
### <ins>Flux</ins>
|
|
341
|
-
|
|
342
|
-
| option | short| default | description | search mode |
|
|
343
|
-
|:----------------------:|:----:|:--------:|:------------:|:-------------:|
|
|
344
|
-
| --check-flux | -cf | False | If used, the Cobrapy flux calculation <br/> from seeds will be executed and saved | ALL |
|
|
345
|
-
| --maximize-flux | -max | False | If used, the flux calculation <br/> with ASP will be maximized | ALL⭐ |
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
> 💬 **Comments:**
|
|
349
|
-
>
|
|
350
|
-
> ⭐ The option is used only in [Hybrid](documentations/hybrid.mkd) mode for [Full Network](documentations/full_network.mkd) and [Target](documentations/target.mkd) search mode features.
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
</br>
|
|
354
|
-
<hr style="border: 4px outset" size="8" >
|
|
355
|
-
|
|
356
|
-
## Configuration file
|
|
357
|
-
The application has its own configuration file located [here: seed2lp/config.yaml](seed2lp/config.yaml).
|
|
358
|
-
|
|
359
|
-
It is possible to use another configuration file by using the option `-conf` or `--config-file`.
|
|
360
|
-
|
|
361
|
-
But all these configurations are overwritten by the arguments if used. The config file is used as "the default configuration" of your app.
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
</br>
|
|
365
|
-
<hr style="border: 4px outset" size="8" >
|
|
366
|
-
|
|
367
|
-
## Output files
|
|
368
|
-
### Result file
|
|
369
|
-
|
|
370
|
-
<br/>
|
|
371
|
-
<hr style="border: 1px dotted" >
|
|
372
|
-
|
|
373
|
-
### Flux file
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
</br>
|
|
377
|
-
<hr style="border: 4px outset" size="8" >
|
|
378
|
-
<hr style="border: 4px outset" size="8" >
|
|
379
|
-
|
|
380
|
-
## Troubleshooting
|
|
381
|
-
### GCC version
|
|
382
|
-
Seed2Lp needs a gcc version >= 7.
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
> 💻 Linux Commands:
|
|
386
|
-
>
|
|
387
|
-
> **Check your version:**
|
|
388
|
-
>```
|
|
389
|
-
>gcc --version
|
|
390
|
-
>```
|
|
391
|
-
>
|
|
392
|
-
> **Install latest version (here v11):**
|
|
393
|
-
>```
|
|
394
|
-
> sudo apt install gcc-11
|
|
395
|
-
>```
|
|
396
|
-
>
|
|
397
|
-
> **Link to the latest version (here v11):**
|
|
398
|
-
>```
|
|
399
|
-
> sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 20
|
|
400
|
-
>```
|
|
401
|
-
> **Check your version:**
|
|
402
|
-
>```
|
|
403
|
-
>gcc --version
|
|
404
|
-
>```
|
|
File without changes
|
|
File without changes
|
|
File without changes
|