annotate COBRAxy/flux_simulation.xml @ 12:e09bea6f1379 draft

Uploaded
author luca_milaz
date Wed, 18 Sep 2024 12:34:25 +0000
parents 3788bd8c278b
children c10d8b38de84
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
1 <tool id="fluxSimulation" name="Flux Simulation" version="2.0.0">
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
2
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
3 <macros>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
4 <import>marea_macros.xml</import>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
5 </macros>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
6
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
7 <requirements>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
8 <requirement type="package" version="1.24.4">numpy</requirement>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
9 <requirement type="package" version="2.0.3">pandas</requirement>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
10 <requirement type="package" version="0.29.0">cobra</requirement>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
11 <requirement type="package" version="5.2.2">lxml</requirement>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
12 <requirement type="package" version="1.4.2">joblib</requirement>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
13 <requirement type="package" version="1.10.1">scipy</requirement>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
14 </requirements>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
15
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
16 <command detect_errors="exit_code">
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
17 <![CDATA[
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
18 python $__tool_directory__/flux_simulation.py
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
19 --tool_dir $__tool_directory__
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
20 --model_selector $cond_model.model_selector
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
21 #if $cond_model.model_selector == 'Custom'
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
22 --model $model
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
23 --model_name $model.element_identifier
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
24 #end if
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
25 --input "${",".join(map(str, $inputs))}"
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
26 #set $names = ""
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
27 #for $input_temp in $inputs:
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
28 #set $names = $names + $input_temp.element_identifier + ","
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
29 #end for
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
30 --name $names
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
31 --thinning 0
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
32 #if $algorithm_param.algorithm == 'OPTGP':
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
33 --thinning $algorithm_param.thinning
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
34 #end if
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
35 --algorithm $algorithm_param.algorithm
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
36 --n_batches $n_batches
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
37 --n_samples $n_samples
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
38 --seed $seed
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
39 --output_type "${",".join(map(str, $output_types))}"
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
40 --output_type_analysis "${",".join(map(str, $output_types_analysis))}"
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
41 --out_log $log
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
42 ]]>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
43 </command>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
44 <inputs>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
45
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
46 <conditional name="cond_model">
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
47 <expand macro="options_ras_to_bounds_model"/>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
48 <when value="Custom">
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
49 <param name="model" argument="--model" type="data" format="json, xml" label="Custom model" />
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
50 </when>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
51 </conditional>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
52
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
53 <param name="inputs" argument="--inputs" multiple="true" type="data" format="tabular, csv, tsv" label="Bound(s):" />
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
54
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
55
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
56 <conditional name="algorithm_param">
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
57 <param name="algorithm" argument="--algorithm" type="select" label="Choose sampling algorithm:">
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
58 <option value="CBS" selected="true">CBS</option>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
59 <option value="OPTGP">OPTGP</option>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
60 </param>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
61 <when value="OPTGP">
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
62 <param name="thinning" argument="--thinning" type="integer" label="Thinning:" value="100" help="Number of iterations to wait before taking a sample."/>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
63 </when>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
64
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
65 </conditional>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
66
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
67
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
68 <param name="n_samples" argument="--n_samples" type="integer" label="Samples:" value="1000"/>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
69
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
70 <param name="n_batches" argument="--n_batches" type="integer" label="Batches:" value="10" help="This is useful for computational perfomances."/>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
71
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
72 <param name="seed" argument="--seed" type="integer" label="Seed:" value="0" helph="Random seed."/>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
73
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
74 <param type="select" argument="--output_types" multiple="true" name="output_types" label="Desired outputs from sampling">
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
75 <option value="mean" selected="true">Mean</option>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
76 <option value="median" selected="true">Median</option>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
77 <option value="quantiles" selected="true">Quantiles</option>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
78 <option value="fluxes" selected="false">All fluxes</option>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
79 </param>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
80
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
81 <param type="select" argument="--output_types_analysis" multiple="true" name="output_types_analysis" label="Desired outputs from flux analysis">
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
82 <option value="pFBA" selected="false">pFBA</option>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
83 <option value="FVA" selected="false">FVA</option>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
84 <option value="sensitivity" selected="false">Sensitivity reaction knock-out (Biomass)</option>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
85 </param>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
86 </inputs>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
87
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
88
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
89 <outputs>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
90 <data format="txt" name="log" label="fluxSimulation - Log" />
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
91 <collection name="results" type="list" label="${tool.name} - Samples">
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
92 <discover_datasets pattern="__name_and_ext__" directory="flux_simulation"/>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
93 </collection>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
94 </outputs>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
95
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
96
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
97 <help>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
98 <![CDATA[
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
99 What it does
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
100 -------------
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
101
10
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
102 This tool generates flux samples starting from a model in JSON or XML format by using CBS (Corner-based sampling) or OPTGP (Improved Artificial Centering Hit-and-Run sampler) sampling algorithms.
9
7c01dab3e961 Uploaded
luca_milaz
parents: 8
diff changeset
103
4
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
104 It can return sampled fluxes by appliying summary statistics:
7
515cd9e4f518 Uploaded
luca_milaz
parents: 4
diff changeset
105 - mean
515cd9e4f518 Uploaded
luca_milaz
parents: 4
diff changeset
106 - median
515cd9e4f518 Uploaded
luca_milaz
parents: 4
diff changeset
107 - quantiles (0.25, 0.50, 0.75).
9
7c01dab3e961 Uploaded
luca_milaz
parents: 8
diff changeset
108
7c01dab3e961 Uploaded
luca_milaz
parents: 8
diff changeset
109 Flux analysis can be perfomed over the metabolic model:
7
515cd9e4f518 Uploaded
luca_milaz
parents: 4
diff changeset
110 - parsimoniuos-FBA (optimized by Biomass)
515cd9e4f518 Uploaded
luca_milaz
parents: 4
diff changeset
111 - FVA
515cd9e4f518 Uploaded
luca_milaz
parents: 4
diff changeset
112 - Biomass sensitivity analysis (single reaction knock-out). It is the ratio between the optimal of the Biomass reaction computed by FBA after knocking-out a reaction and the same over the complete model.
4
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
113
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
114 Accepted files:
9
7c01dab3e961 Uploaded
luca_milaz
parents: 8
diff changeset
115 - A model: JSON or XML file reporting reactions and rules contained in the model. It can be ENGRO2 or a custom model.
7c01dab3e961 Uploaded
luca_milaz
parents: 8
diff changeset
116 - Context-specific bounds: generated by RAS to Bounds tool. This can be a collection of bounds too (one bounds file per context).
4
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
117
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
118 Output:
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
119 -------------
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
120
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
121 The tool generates:
9
7c01dab3e961 Uploaded
luca_milaz
parents: 8
diff changeset
122 - Samples: reporting the sampled fluxes for each reaction (reaction names on the rows and sample names on the columns). Format: csv.
7
515cd9e4f518 Uploaded
luca_milaz
parents: 4
diff changeset
123 - a log file (.txt).
4
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
124
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
125 **TIP**: The Batches parameter is useful to mantain in memory just a batch of samples at time. For example, if you wish to sample 10.000 points, than it is suggested to select n_samples = 1.000 and n_batches=10.
10
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
126 **TIP**: The Thinning parameter of the OPTGP algorithm is useful to converge to a stationary distribution (see cited articles by Galuzzi, Milazzo and Damiani).
4
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
127
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
128 ]]>
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
129 </help>
10
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
130
12
e09bea6f1379 Uploaded
luca_milaz
parents: 10
diff changeset
131
10
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
132 <citations>
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
133 <citation type="bibtex">
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
134 @article{galuzzi2024adjusting,
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
135 title={Adjusting for false discoveries in constraint-based differential metabolic flux analysis},
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
136 author={Galuzzi, Bruno G and Milazzo, Luca and Damiani, Chiara},
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
137 journal={Journal of Biomedical Informatics},
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
138 volume={150},
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
139 pages={104597},
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
140 year={2024},
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
141 publisher={Elsevier}
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
142 }
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
143 </citation>
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
144 <citation type="bibtex">
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
145 @inproceedings{galuzzi2022best,
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
146 title={Best practices in flux sampling of constrained-based models},
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
147 author={Galuzzi, Bruno G and Milazzo, Luca and Damiani, Chiara},
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
148 booktitle={International Conference on Machine Learning, Optimization, and Data Science},
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
149 pages={234--248},
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
150 year={2022},
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
151 organization={Springer}
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
152 }
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
153 </citation>
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
154 <citation type="bibtex">
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
155 @article{ebrahim2013cobrapy,
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
156 title={COBRApy: constraints-based reconstruction and analysis for python},
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
157 author={Ebrahim, Ali and Lerman, Joshua A and Palsson, Bernhard O and Hyduke, Daniel R},
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
158 journal={BMC systems biology},
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
159 volume={7},
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
160 pages={1--6},
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
161 year={2013},
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
162 publisher={Springer}
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
163 }
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
164 </citation>
3788bd8c278b Uploaded
luca_milaz
parents: 9
diff changeset
165 </citations>
12
e09bea6f1379 Uploaded
luca_milaz
parents: 10
diff changeset
166
4
41f35c2f0c7b Uploaded
luca_milaz
parents:
diff changeset
167 </tool>