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
|
@@ -0,0 +1,621 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: seed2lp
|
|
3
|
+
Version: 2.1.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
|
+
Requires-Dist: graphviz
|
|
27
|
+
Provides-Extra: tests
|
|
28
|
+
Requires-Dist: pytest; extra == "tests"
|
|
29
|
+
Dynamic: author
|
|
30
|
+
Dynamic: author-email
|
|
31
|
+
Dynamic: classifier
|
|
32
|
+
Dynamic: home-page
|
|
33
|
+
Dynamic: license
|
|
34
|
+
Dynamic: license-file
|
|
35
|
+
Dynamic: summary
|
|
36
|
+
|
|
37
|
+
# Seed2LP
|
|
38
|
+
|
|
39
|
+
## Introduction
|
|
40
|
+
Seed2LP is a formal framework for metabolic seed inference, based on logical and combinatorial modelling of metabolic networks, and extended to a hybrid approach combining logical reasoning and flow analysis. The objective is to identify the minimal sets of metabolites necessary for the functional activation of a metabolic network, while integrating constraints from stoichiometry and flow feasibility.
|
|
41
|
+
|
|
42
|
+
In its basic formulation, Seed2LP represents a metabolic network as a system of logical rules derived from the reaction structure: a reaction is activatable if all of its substrates are available, and its activation makes its products available. This logical abstraction makes it possible to define metabolic accessibility independently of any kinetic dynamics or objective function, and to formulate the seed inference problem as an optimisation problem in constraint-based logical programming (Answer Set Programming). This formalisation guarantees the completeness of the solutions, allows the enumeration of alternative minimal sets, and makes the network's implicit environmental dependencies explicit.
|
|
43
|
+
|
|
44
|
+
In order to overcome the limitations inherent in a purely topological approach, Seed2LP proposes a hybridisation with flux analysis (FBA). Logically inferred seed sets can be filtered, validated or refined using stoichiometric constraints, imposing the feasibility of steady-state fluxes compatible with the production of target metabolites or growth. This articulation makes it possible to distinguish structurally sufficient seeds from those that are stoichiometrically unfeasible, and to identify dependencies induced by thermodynamically or quantitatively constrained cycles. The hybrid approach thus provides a compromise between logical completeness and biochemical realism, while maintaining formal interpretability of the solutions.
|
|
45
|
+
|
|
46
|
+
The framework has been extended to the analysis of microbial communities, considering each organism as a distinct metabolic network, interconnected by exchangeable metabolites representing inter-species transfers. Seeds can then be defined at different levels: individual (environmental dependencies specific to each taxon), community (minimum resources for the entire system). Metabolic transfers are explicitly modelled as production/consumption relationships between networks, allowing the inference of trophic complementarities, cross-dependencies and syntrophy scenarios.
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
## Individual network
|
|
50
|
+
Three approaches for seed inference are implemented into Seed2LP:
|
|
51
|
+
- [**Full network**](#full-network) mode, that activates all compounds of the metabolic network.
|
|
52
|
+
- [**Target**](#target) mode, that activates metabolites of interest.
|
|
53
|
+
- [**FBA**](#fba) mode, that randomly searches seeds ensuring a positive flux into the objective reaction, using ASP linear constraints with clingo-lpx
|
|
54
|
+
|
|
55
|
+
> **_Mandatory inputs:_**
|
|
56
|
+
> - Network file (sbml)
|
|
57
|
+
> - Result directory
|
|
58
|
+
|
|
59
|
+
## Community networks
|
|
60
|
+
|
|
61
|
+
An extension of seed inference for [**Target**](#target) has been added, searching for set of seeds and transfers based on [**Target**](#target) mode:
|
|
62
|
+
- [**Community**](#community) mode.
|
|
63
|
+
|
|
64
|
+
> **_Mandatory inputs:_**
|
|
65
|
+
> - Community file ; text file containing name of sbml file (without extension)
|
|
66
|
+
> - SBML directory: diretory containting all possible networks
|
|
67
|
+
> - Result directory
|
|
68
|
+
|
|
69
|
+
## Additional features ecosystem
|
|
70
|
+
|
|
71
|
+
There are also multiple additional features:
|
|
72
|
+
- [**Network**](documentations/network.mkd): 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 deleted reaction having all boundaries to 0)
|
|
73
|
+
- [**Flux**](documentations/flux.mkd): Allows checking the flux for individual network with COBRApy from Seed2LP result files, or any file having the same json structure than Seed2LP.
|
|
74
|
+
- [**Flux community**](documentations/fluxcom.mkd): Allows checking the flux for community with COBRApy from Seed2LP result files, or any file having the same json structure than Seed2LP.
|
|
75
|
+
- [**Scope**](documentations/scope.mkd): Perform scopes from seeds for individual network from Seed2LP result files, or any file having the same json structure than Seed2LP.
|
|
76
|
+
|
|
77
|
+
## Notebooks
|
|
78
|
+
|
|
79
|
+
The notebook directory of this repo contains scripts that reproduce the results presented in associated papers.
|
|
80
|
+
|
|
81
|
+
## Citation
|
|
82
|
+
|
|
83
|
+
If you use **Seed2LP** in your work, please cite:
|
|
84
|
+
|
|
85
|
+
- Ghassemi Nedjad C. et al.
|
|
86
|
+
*Seed2LP: seed inference in metabolic networks for reverse ecology applications*.
|
|
87
|
+
Bioinformatics, 2025.
|
|
88
|
+
DOI: https://doi.org/10.1093/bioinformatics/btaf140
|
|
89
|
+
[HAL](https://inria.hal.science/hal-05230510v1/document)
|
|
90
|
+
[Individual dataset and code repository](https://doi.org/10.57745/OS1JND)
|
|
91
|
+
|
|
92
|
+
- Ghassemi Nedjad C., Mendoza S. N., Frioux C. and Paulevé L.
|
|
93
|
+
*Seed inference in interacting microbial communities using combinatorial optimization.*
|
|
94
|
+
In *CMSB 2025*
|
|
95
|
+
DOI: http://doi.org/10.1007/978-3-032-01436-8\_20
|
|
96
|
+
[HAL](https://inria.hal.science/hal-04713829)
|
|
97
|
+
[Community dataset and code repository](https://doi.org/10.57745/Y6KDJC)
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
### BibTeX
|
|
102
|
+
|
|
103
|
+
```bibtex
|
|
104
|
+
@article{GhassemiNedjad.2025,
|
|
105
|
+
year = {2025},
|
|
106
|
+
title = {{Seed2LP: seed inference in metabolic networks for reverse ecology applications}},
|
|
107
|
+
author = {Ghassemi-Nedjad, Chabname and Bolteau, Mathieu and Bourneuf, Lucas and Paulevé, Loïc and Frioux, Clémence},
|
|
108
|
+
journal = {Bioinformatics},
|
|
109
|
+
doi = {10.1093/bioinformatics/btaf140},
|
|
110
|
+
pmid = {40163742},
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
@inproceedings{GhassemiNedjad.2026,
|
|
114
|
+
title = {Seed {Inference} in {Interacting} {Microbial} {Communities} {Using} {Combinatorial} {Optimization}},
|
|
115
|
+
isbn = {978-3-032-01436-8},
|
|
116
|
+
booktitle = {Computational {Methods} in {Systems} {Biology}},
|
|
117
|
+
publisher = {Springer Nature Switzerland},
|
|
118
|
+
author = {Ghassemi Nedjad, Chabname and Mendoza, Sebastián Nelson and Frioux, Clémence and Paulevé, Loïc},
|
|
119
|
+
editor = {Fages, François and Pérès, Sabine},
|
|
120
|
+
year = {2026},
|
|
121
|
+
pages = {370--387},
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
</br>
|
|
126
|
+
<hr style="border: 4px outset" size="8" >
|
|
127
|
+
|
|
128
|
+
## Install
|
|
129
|
+
**From pypi**
|
|
130
|
+
```
|
|
131
|
+
pip install seed2lp
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
**From github**
|
|
135
|
+
```
|
|
136
|
+
pip install git+https://github.com/bioasp/seed2lp
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**From repository source after git clone**
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
pip install .
|
|
143
|
+
```
|
|
144
|
+
or
|
|
145
|
+
```
|
|
146
|
+
python setup.py install
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
</br>
|
|
151
|
+
|
|
152
|
+
## Requirements
|
|
153
|
+
|
|
154
|
+
Requires Python >= 3.11.
|
|
155
|
+
|
|
156
|
+
Need to manually install graphviz: `conda install -c conda-forge graphviz`. If not installed and Seed2LP is launched for a graph visualisation of the network, the tool will raise an error and invite the user to install graphviz.
|
|
157
|
+
|
|
158
|
+
For below requirements, installing Seed2LP will install all needed packages if not already installed.
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
| name | version |
|
|
163
|
+
|:----------:|:-------------:|
|
|
164
|
+
| [clyngor](https://github.com/Aluriak/clyngor) | 0.3.18 |
|
|
165
|
+
| [clingo-lpx](https://github.com/potassco/clingo-lpx) | 1.3.0 |
|
|
166
|
+
| [COBRApy](https://COBRApy.readthedocs.io/en/latest/index.html) | 0.26.0 |
|
|
167
|
+
| [pyyaml](https://pyyaml.org/wiki/PyYAMLDocumentation) | 6.0 |
|
|
168
|
+
| [menetools](https://github.com/cfrioux/MeneTools) | 3.4.0 |
|
|
169
|
+
| [padmet](https://github.com/AuReMe/padmet) | 5.0.1 |
|
|
170
|
+
|
|
171
|
+
<hr style="border: 4px outset" size="8" >
|
|
172
|
+
|
|
173
|
+
## Command examples
|
|
174
|
+
The following examples uses a toy described on Seed2LP paper.
|
|
175
|
+
|
|
176
|
+
> Get all solutions in all Target modes (Reasoning, Filter, Guess&Check, Guess&Check with Diversity, Hybrid lpx), in all optimisations (subset minimal and minimize)
|
|
177
|
+
>```
|
|
178
|
+
>seed2lp target networks/toys/SBML/toy_paper.SBML results/toys/
|
|
179
|
+
>```
|
|
180
|
+
|
|
181
|
+
> Get one solution in Full Network in reasoning and check flux
|
|
182
|
+
>```
|
|
183
|
+
>seed2lp full networks/toys/SBML/toy_paper.SBML results/toys/ -nbs 1 -so reasoning -cf
|
|
184
|
+
>```
|
|
185
|
+
|
|
186
|
+
> Get one solution in FBA only in subset minimal
|
|
187
|
+
>```
|
|
188
|
+
>seed2lp fba networks/toys/SBML/toy_paper.SBML results/toys/ -nbs 1 -m subsetmin
|
|
189
|
+
>```
|
|
190
|
+
|
|
191
|
+
<hr style="border: 4px outset" size="8" >
|
|
192
|
+
|
|
193
|
+
## 📜[Network analyse](documentations/network_analyse.mkd)
|
|
194
|
+
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:
|
|
195
|
+
|
|
196
|
+
$$ Reaction: Set\{reactants\} ⟶ Set\{products\} \quad with \quad bounds = [0,\infty]$$
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
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.
|
|
200
|
+
|
|
201
|
+
📃 **Output example:**
|
|
202
|
+
|
|
203
|
+
```
|
|
204
|
+
WARNING :
|
|
205
|
+
- R_R2: Deleted.
|
|
206
|
+
Boundaries was: [0.0 ; 0.0]
|
|
207
|
+
- R_R7: Reactants and products switched.
|
|
208
|
+
Boundaries was: [-1000.0 ; 0.0]
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## Seed inference mode features
|
|
213
|
+
For **_individual network_**, 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.
|
|
214
|
+
|
|
215
|
+
For [**Community**](#Community), ony a [**Target**](#target) mode is performed, and arguments are availabled to choose between optimisation methods (optimise set of seeds and transfers)
|
|
216
|
+
|
|
217
|
+
<br/>
|
|
218
|
+
<hr style="border: 1px dotted" >
|
|
219
|
+
|
|
220
|
+
### 📜 [<ins>Full Network</ins>](documentations/full_network.mkd)
|
|
221
|
+
This mode searches seeds with this goal: "activate"/"produce" all reaction/metabolites of the network.
|
|
222
|
+
> 💻 **Command:**
|
|
223
|
+
>
|
|
224
|
+
> ```
|
|
225
|
+
> seed2lp full [network_file] [output_directory] [arguments]
|
|
226
|
+
> ```
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
There are also different [seed inference submodes](#Seed-inference-submodes) and [optimisations](#optimisations-for-individual-network)
|
|
230
|
+
|
|
231
|
+
<br/>
|
|
232
|
+
<hr style="border: 1px dotted" >
|
|
233
|
+
|
|
234
|
+
### 📜 [<ins>Target</ins>](documentations/target.mkd)
|
|
235
|
+
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.
|
|
236
|
+
> 💻 **Command:**
|
|
237
|
+
>
|
|
238
|
+
> ```
|
|
239
|
+
> seed2lp target [network_file] [output_directory] [arguments]
|
|
240
|
+
> ```
|
|
241
|
+
|
|
242
|
+
There are also [seed inference submodes](#Seed-inference-submodes) and [optimisations](#optimisations-for-individual-network)
|
|
243
|
+
|
|
244
|
+
<br/>
|
|
245
|
+
<hr style="border: 1px dotted" >
|
|
246
|
+
|
|
247
|
+
### 📜 [<ins>FBA</ins>](documentations/fba.mkd)
|
|
248
|
+
This mode randomly searches seeds by ensuring flux on objective reaction. It ensures the resulting model statisfies both logical and flux constraints using a hybrid ASP-LP solver.
|
|
249
|
+
|
|
250
|
+
> 💻 **Command:**
|
|
251
|
+
>
|
|
252
|
+
> ```
|
|
253
|
+
> seed2lp fba [network_file] [output_directory] [arguments]
|
|
254
|
+
> ```
|
|
255
|
+
|
|
256
|
+
There are also [optimisations](#optimisations-for-individual-network)
|
|
257
|
+
|
|
258
|
+
<br/>
|
|
259
|
+
<hr style="border: 1px dotted" >
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
### 📜 [<ins>Community</ins>](documentations/fba.mkd)
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
> 💻 **Command:**
|
|
266
|
+
>
|
|
267
|
+
> ```
|
|
268
|
+
> seed2lp community [community_file_text] [sbml_directory] [result directory]
|
|
269
|
+
> ```
|
|
270
|
+
|
|
271
|
+
There are also [seed inference submodes](#Seed-inference-submodes), uses only [subset minimal](#Subset-minimal) optimisation and performs different [algorithm of optimisations](#Community-optimisation-submodes)
|
|
272
|
+
|
|
273
|
+
<br/>
|
|
274
|
+
<hr style="border: 1px dotted" >
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
### <ins>Seed inference submodes</ins>
|
|
278
|
+
**Common for <ins>individual network</ins> and <ins>community</ins>**
|
|
279
|
+
- [Reasoning](documentations/full_network.mkd#reasoning): Use ASP solving with clingo
|
|
280
|
+
- **Classic:** Use reasoning (logical, Boolean abstraction of metabolic activity) search only, without calculating flux into objective reaction.
|
|
281
|
+
💻 **Command:** `-so reasoning`
|
|
282
|
+
- Hybrids with [COBRApy](https://COBRApy.readthedocs.io/en/latest/index.html): Use ASP solving with clingo to solve seeds and check solution with [COBRApy](https://COBRApy.readthedocs.io/en/latest/index.html)
|
|
283
|
+
- **Filter:** Use reasoning search only, but for all results the flux is checked, and only the solutions having flux are returned.
|
|
284
|
+
💻 **Command:** `-so filter`
|
|
285
|
+
- **Guess-check:** Use reasoning search and directly interact with the solver during solving by adding new constraints. Flux is checked 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.
|
|
286
|
+
💻 **Command:** `-so guess_check`
|
|
287
|
+
- **Guess-check-diversity:** Reuse **Guess-check** but also avoid a subset of current set of seeds for the next solving by adding new constraints on seeds
|
|
288
|
+
💻 **Command:** `-so guess_check_div`
|
|
289
|
+
|
|
290
|
+

|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
**Only for <ins>individual network</ins>**
|
|
294
|
+
- Hybrid-lpx: Use ASP solving with clingo-lpx to solve seeds and check fluxes with ASP linear constraints:
|
|
295
|
+
- **Hybrid:** Ensure the resulting model statisfies both logical and flux constraints using a hybrid ASP-LP solver.
|
|
296
|
+
💻 **Command:** `-so hybrid`
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
</br>
|
|
300
|
+
<hr style="border: 4px outset" size="8" >
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
## Optimisations for individual network
|
|
305
|
+
It is possible to choose what kind of optimisation to perform on set of seeds.
|
|
306
|
+
|
|
307
|
+
### <ins>Subset minimal</ins>
|
|
308
|
+
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.
|
|
309
|
+
|
|
310
|
+
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.
|
|
311
|
+
|
|
312
|
+
> 📃 **Example:**
|
|
313
|
+
>
|
|
314
|
+
> Considering all the followings sets of seeds below, that statisfy constraints for the objective, which of them are subset minimal and will be selected?
|
|
315
|
+
>
|
|
316
|
+
> | Sets of seeds | is choosen ? | reasons |
|
|
317
|
+
> |:--------------:|:---------------:|:-------------:|
|
|
318
|
+
> | {A,B,C,D,E} | no | {A,B,C} is a set of seeds included into this set|
|
|
319
|
+
> | {A,B,C} | yes | There is no other set smaller included in this set|
|
|
320
|
+
> | {A,D,E,F} | no |{A,D,F} is a set of seeds included into this set |
|
|
321
|
+
> | {A,D,F} | yes | There is no other set smaller included in this set |
|
|
322
|
+
> | {A,C,E,F} | yes | There is no other set smaller included in this set|
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
<br/>
|
|
326
|
+
<hr style="border: 1px dotted" >
|
|
327
|
+
|
|
328
|
+
### <ins>Minimize</ins>
|
|
329
|
+
The minimize (min) set-mode finds set of seeds of minimal size which satisfies all the constraints.
|
|
330
|
+
|
|
331
|
+
This method of search **ensures minimality**. But it is computationally more demanding.
|
|
332
|
+
|
|
333
|
+
> 📃 **Example:**
|
|
334
|
+
>
|
|
335
|
+
> 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?
|
|
336
|
+
>
|
|
337
|
+
> | Sets of seeds | is choosen ? | reasons |
|
|
338
|
+
> |:--------------:|:---------------:|:-------------:|
|
|
339
|
+
> | {A,B,C,D,E} | no | There is a smaller set of size 3 existing |
|
|
340
|
+
> | {A,B,C} | yes | This a one of the smaller set |
|
|
341
|
+
> | {A,D,E,F} | no | There is a smaller set of size 3 existing |
|
|
342
|
+
> | {A,D,F} | yes | This a one of the smaller set |
|
|
343
|
+
> | {A,C,E,F} | no | There is a smaller set of size 3 existing|
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
</br>
|
|
347
|
+
<hr style="border: 4px outset" size="8" >
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
## Community optimisation submodes
|
|
352
|
+
In community, the tool search for a set of seeds and transfers. The tool only perorm a subset minimal type of optimisations in community. Three algorithms have been implemented to optimise these sets :
|
|
353
|
+
|
|
354
|
+
- **Global:** Optimisation by performing a subset minimality on set of seeds+transfers. This method do not ensures a subset minimality of seeds sets.
|
|
355
|
+
**Command:** `-cm global`
|
|
356
|
+
- **Bisteps:** Optimisation by performing a subset minimality on set of seeds first, and another step find and perform a subset minimialty of transfers sets (first transfers set found). This method ensures a subset minimalisty of set of seeds.
|
|
357
|
+
**Command:** `-cm bisteps`
|
|
358
|
+
- **Delete supersets:** Optimisation by performing a subset minimality on set of seeds+transfers. For each solution, a ASP constraint is added to forbid superset of current seed sets for next resolution. Also, a post check is performed to detect and delete all previous solution found which is a superset of the current set of seeds. This method approximate a subset minimalisty of set of seeds, and ensures it when all solutions are found.
|
|
359
|
+
**Command:** `-cm delsupset`
|
|
360
|
+
|
|
361
|
+

|
|
362
|
+
|
|
363
|
+
</br>
|
|
364
|
+
|
|
365
|
+
</br>
|
|
366
|
+
<hr style="border: 4px outset" size="8" >
|
|
367
|
+
|
|
368
|
+
## Results
|
|
369
|
+
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.
|
|
370
|
+
|
|
371
|
+
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).
|
|
372
|
+
|
|
373
|
+
The results are also written in the terminal.
|
|
374
|
+
|
|
375
|
+
</br>
|
|
376
|
+
<hr style="border: 4px outset" size="8" >
|
|
377
|
+
|
|
378
|
+
## Additional features
|
|
379
|
+
### 📜 [<ins>Network</ins>](documentations/network.mkd)
|
|
380
|
+
This feature can reconstruct a very basic picture of the network from the ASP conversion of the source network (in SBML format).
|
|
381
|
+
- It can create the picture with the reaction names, or without the reaction.
|
|
382
|
+
- It can also create all the reactions description / formula from ASP and COBRApy and give a difference of both contents.
|
|
383
|
+
- It can write an SBML file derived from the SBML sources after correction of the network
|
|
384
|
+
- Deletion of reaction with boundaries [0,0]
|
|
385
|
+
- Exchanging set of reactants and products when boundaries negatives: ie [-1000, 0], [-100; -10], ...
|
|
386
|
+
|
|
387
|
+
> 💻 **Command:**
|
|
388
|
+
>
|
|
389
|
+
> `seed2lp network [network_file] [output_directory] [arguments]`
|
|
390
|
+
|
|
391
|
+
<br/>
|
|
392
|
+
<hr style="border: 1px dotted" >
|
|
393
|
+
|
|
394
|
+
### 📜 [<ins>Flux</ins>](documentations/flux.mkd)
|
|
395
|
+
This feature allows the calculation, using COBRApy library, of the flux of the objective function from a result file of seed2lp (or any file having the same JSON format) and save them. This can be a validation of the solutions provided by Seed2LP.
|
|
396
|
+
|
|
397
|
+
> 💻 **Command:**
|
|
398
|
+
>
|
|
399
|
+
> `seed2lp flux [network_file] [seed2lp_result_file]`
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
> 📝 **Notes:**
|
|
404
|
+
>
|
|
405
|
+
> 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).
|
|
406
|
+
|
|
407
|
+
<br/>
|
|
408
|
+
<hr style="border: 1px dotted" >
|
|
409
|
+
|
|
410
|
+
### 📜 [<ins>Flux Community</ins>](documentations/fluxcom.mkd)
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
This feature allows the calculation, using COBRApy library, of the flux of all objective function (for each species) from a result file of seed2lp (or any file having the same JSON format) and save them. This can be a validation of the solutions provided by Seed2LP.
|
|
414
|
+
|
|
415
|
+
> 💻 **Command:**
|
|
416
|
+
>
|
|
417
|
+
> `seed2lp fluxcom [community_file_text] [sbml_directory] [seed2lp_result_file] [output_directory]`
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
> 📝 **Notes:**
|
|
422
|
+
>
|
|
423
|
+
> 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.
|
|
424
|
+
|
|
425
|
+
<br/>
|
|
426
|
+
<hr style="border: 1px dotted" >
|
|
427
|
+
|
|
428
|
+
### 📜 [<ins>Scope</ins>](documentations/scope.mkd)
|
|
429
|
+
|
|
430
|
+
This feature determine scope inferred by seeeds using Network Expansion from a result file of seed2lp (or any file having the same JSON format) and save them. The scope calculation is done with [MeneTools](https://github.com/cfrioux/MeneTools).
|
|
431
|
+
|
|
432
|
+
> 💻 **Command:**
|
|
433
|
+
>
|
|
434
|
+
> `seed2lp scope [sbml_file] [seed2lp_result_file] [output_directory]`
|
|
435
|
+
|
|
436
|
+
</br>
|
|
437
|
+
<hr style="border: 4px outset" size="8" >
|
|
438
|
+
|
|
439
|
+
## Main 📜 [options](documentations/options.mkd) for [search mode features](#search-mode-features)
|
|
440
|
+
|
|
441
|
+
### <ins>Data given by user</ins>
|
|
442
|
+
|
|
443
|
+
File format described [here](documentations/options.mkd#Input-file-formats)
|
|
444
|
+
|
|
445
|
+
| option | short| default | description | search mode |
|
|
446
|
+
|:----------------------:|:----:|:--------:|:------------:|:-------------:|
|
|
447
|
+
| --targets-file | -tf | optional | List of metabolites⭐ and/or <br/>an objective🔆 reaction as file | Target |
|
|
448
|
+
| --objective | -o | optional | An objective🔆 reaction <br/> as command line | Full Network and FBA |
|
|
449
|
+
| --seeds-file | -sf | optional | List of metabolites⭐ known to be seeds and will <br/> be in the initial set of seeds| ALL |
|
|
450
|
+
| --possible-seeds-file | -psf | optional | List of metabolites⭐ among which the seed selection will be performed <br/> be in the set of seeds | ALL |
|
|
451
|
+
| --forbidden-seeds-file | -fsf | optional | List of metabolites⭐ that can not <br/> be in the set of seeds | ALL |
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
> 📝 **Notes:**
|
|
455
|
+
>
|
|
456
|
+
> **Target** search mode :
|
|
457
|
+
>
|
|
458
|
+
> - 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.
|
|
459
|
+
> - 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.
|
|
460
|
+
> - 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**
|
|
461
|
+
> - 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**
|
|
462
|
+
>
|
|
463
|
+
> **Full network** (**hybrid** submode) and **FBA** :
|
|
464
|
+
>
|
|
465
|
+
>If no objective reaction given, the objective reaction will be the one found in the SBML file for flux calculation.
|
|
466
|
+
|
|
467
|
+
> 💬 **Comments:**
|
|
468
|
+
>
|
|
469
|
+
> ⭐ One metabolite by line, must be prefixed with "M_" to fit the ID of the SBML file.
|
|
470
|
+
>
|
|
471
|
+
> 🔆 One Objective reaction only, must be prefixed with "R_" to fit the ID of the SBML file.
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
<br/>
|
|
475
|
+
<hr style="border: 1px dotted" >
|
|
476
|
+
|
|
477
|
+
### <ins>Set mode</ins>
|
|
478
|
+
|
|
479
|
+
| option | short| default | description | search mode |
|
|
480
|
+
|:-----------:|:----:|:--------:|:------------:|:-------------:|
|
|
481
|
+
| --mode | -m | subsetmin | run different set modes: <br/> minimize, subsetmin, all | ALL |
|
|
482
|
+
| --solve | -so | reasoning | run different submodes: <br/> reasoning, filter, gues-check, hybrid, all | Full Network<br> and Target |
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
<br/>
|
|
486
|
+
<hr style="border: 1px dotted" >
|
|
487
|
+
|
|
488
|
+
### <ins>Set of seed restrictions</ins>
|
|
489
|
+
|
|
490
|
+
File format described [here](documentations/options.mkd#Input-file-formats)
|
|
491
|
+
|
|
492
|
+
| option | short| default | description | search mode |
|
|
493
|
+
|:----------------------:|:----:|:--------:|:------------:|:-------------:|
|
|
494
|
+
| --targets-as-seeds | -tas | False | If used, targets found are given, <br/> allowed to be in the set of seeds | ALL |
|
|
495
|
+
| --topological-injection | -ti | False | If used, the exchange⭐ metabolite <br/> from source file are set as seeds directly | ALL |
|
|
496
|
+
| --keep-import-reactions | -kir | False | If used, the exchange⭐ reactions <br/> are not deleted during the conversion to ASP| ALL |
|
|
497
|
+
| --accumulation | -accu | False | If used, solutions with possible <br/> accumulating metabolites are allowed | Full Network <br/> and Target |
|
|
498
|
+
|
|
499
|
+
|
|
500
|
+
> 💬 **Comments:**
|
|
501
|
+
>
|
|
502
|
+
> ⭐ 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:
|
|
503
|
+
> - R ⟶ ∅ $\quad$|$\quad$ R ⟷ ∅ $\quad$|$\quad$ R ⟵ ∅
|
|
504
|
+
> - ∅ ⟶ P $\quad$|$\quad$ ∅ ⟷ P $\quad$|$\quad$ ∅ ⟵ P
|
|
505
|
+
>
|
|
506
|
+
> An **exchange metabolite** will be the metabolite involved in the exchange reaction
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
<br/>
|
|
510
|
+
<hr style="border: 1px dotted" >
|
|
511
|
+
|
|
512
|
+
### <ins>Flux</ins>
|
|
513
|
+
|
|
514
|
+
| option | short| default | description | search mode |
|
|
515
|
+
|:----------------------:|:----:|:--------:|:------------:|:-------------:|
|
|
516
|
+
| --check-flux | -cf | False | If used, the COBRApy flux calculation <br/> from seeds will be executed and saved | ALL |
|
|
517
|
+
| --maximize-flux | -max | False | If used, the flux calculation <br/> with ASP will be maximized | ALL⭐ |
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
> 💬 **Comments:**
|
|
521
|
+
>
|
|
522
|
+
> ⭐ 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.
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
### <ins>Flux extension to community</ins>
|
|
526
|
+
|
|
527
|
+
|
|
528
|
+
| option | short| default | description | search mode |
|
|
529
|
+
|:----------------------:|:----:|:--------:|:------------:|:-------------:|
|
|
530
|
+
| --equality-flux | -ef | False | If used, the COBRApy flux calculation <br/> from seeds will force equality of flux <br/> between species biomass | ALL |</br>
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
<hr style="border: 4px outset" size="8" >
|
|
535
|
+
|
|
536
|
+
## Configuration file
|
|
537
|
+
The application has its own configuration file located [here: seed2lp/config.yaml](seed2lp/config.yaml).
|
|
538
|
+
|
|
539
|
+
It is possible to use another configuration file by using the option `-conf` or `--config-file`.
|
|
540
|
+
|
|
541
|
+
But all these configurations are overwritten by the arguments if used. The config file is used as "the default configuration" of your app.
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
</br>
|
|
545
|
+
<hr style="border: 4px outset" size="8" >
|
|
546
|
+
|
|
547
|
+
## Output files
|
|
548
|
+
### <ins>Result file</ins>
|
|
549
|
+
|
|
550
|
+
The result file is in JSON format, containing multiple blocks:
|
|
551
|
+
- **OPTIONS:** Options used for seed inference (relating to import reactions, tragets as forbidden seeds, flux calculation or not, ASP accumulation allowed or not)
|
|
552
|
+
- **NETWORK:** Data related to the network and type of seed inference (Network or community name, objective reactions, search mode type and solvint type)
|
|
553
|
+
- **USER DATA:** Data given by the user (empty if none)
|
|
554
|
+
- **RESULTS:** List of results by solving mode, optimisation mode...
|
|
555
|
+
|
|
556
|
+
For more details please check [output files documentation](documentations/output_files.mkd)
|
|
557
|
+
|
|
558
|
+
<br/>
|
|
559
|
+
<hr style="border: 1px dotted" >
|
|
560
|
+
|
|
561
|
+
### <ins>Flux file</ins>
|
|
562
|
+
The flux file is in tsv format, containing multiple column, such as:
|
|
563
|
+
- Name of network or community
|
|
564
|
+
- List of biomass reaction
|
|
565
|
+
- List of seeds
|
|
566
|
+
- Initial flux of network
|
|
567
|
+
- Flux after deleting import reaction
|
|
568
|
+
- Flux after applying new seeds
|
|
569
|
+
- other informations (type of seed detections, optimisations ...)
|
|
570
|
+
|
|
571
|
+
For more details please check [output files documentation](documentations/output_files.mkd)
|
|
572
|
+
|
|
573
|
+
<br/>
|
|
574
|
+
<hr style="border: 1px dotted" >
|
|
575
|
+
|
|
576
|
+
### <ins>Logs file</ins>
|
|
577
|
+
Into the result directory, a logs repository is created by Seed2LP, containing a log file for each result file generated. This files contains all modification done on networks, all steps performed and all solutions found.
|
|
578
|
+
|
|
579
|
+
It is possible to get more information by using the command: `--verbose`
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
```
|
|
583
|
+
WARNING :
|
|
584
|
+
|
|
585
|
+
If a exactly same execution is performed (same network, seed search, optimisation, and all possible main options), the log file will be overwrite
|
|
586
|
+
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
|
|
590
|
+
For more details please check [output files documentation](documentations/output_files.mkd)
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
</br>
|
|
594
|
+
<hr style="border: 4px outset" size="8" >
|
|
595
|
+
<hr style="border: 4px outset" size="8" >
|
|
596
|
+
|
|
597
|
+
## Troubleshooting
|
|
598
|
+
### GCC version
|
|
599
|
+
Seed2Lp needs a gcc version >= 7.
|
|
600
|
+
|
|
601
|
+
|
|
602
|
+
> 💻 Linux Commands:
|
|
603
|
+
>
|
|
604
|
+
> **Check your version:**
|
|
605
|
+
>```
|
|
606
|
+
>gcc --version
|
|
607
|
+
>```
|
|
608
|
+
>
|
|
609
|
+
> **Install latest version (here v11):**
|
|
610
|
+
>```
|
|
611
|
+
> sudo apt install gcc-11
|
|
612
|
+
>```
|
|
613
|
+
>
|
|
614
|
+
> **Link to the latest version (here v11):**
|
|
615
|
+
>```
|
|
616
|
+
> sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 20
|
|
617
|
+
>```
|
|
618
|
+
> **Check your version:**
|
|
619
|
+
>```
|
|
620
|
+
>gcc --version
|
|
621
|
+
>```
|