4
|
1 <tool id="fluxSimulation" name="Flux Simulation" version="2.0.0">
|
|
2
|
|
3 <macros>
|
|
4 <import>marea_macros.xml</import>
|
|
5 </macros>
|
|
6
|
|
7 <requirements>
|
|
8 <requirement type="package" version="1.24.4">numpy</requirement>
|
|
9 <requirement type="package" version="2.0.3">pandas</requirement>
|
|
10 <requirement type="package" version="0.29.0">cobra</requirement>
|
|
11 <requirement type="package" version="5.2.2">lxml</requirement>
|
|
12 <requirement type="package" version="1.4.2">joblib</requirement>
|
|
13 <requirement type="package" version="1.10.1">scipy</requirement>
|
|
14 </requirements>
|
|
15
|
|
16 <command detect_errors="exit_code">
|
|
17 <![CDATA[
|
|
18 python $__tool_directory__/flux_simulation.py
|
|
19 --tool_dir $__tool_directory__
|
|
20 --model_selector $cond_model.model_selector
|
|
21 #if $cond_model.model_selector == 'Custom'
|
|
22 --model $model
|
|
23 --model_name $model.element_identifier
|
|
24 #end if
|
|
25 --input "${",".join(map(str, $inputs))}"
|
|
26 #set $names = ""
|
|
27 #for $input_temp in $inputs:
|
|
28 #set $names = $names + $input_temp.element_identifier + ","
|
|
29 #end for
|
|
30 --name $names
|
|
31 --thinning 0
|
|
32 #if $algorithm_param.algorithm == 'OPTGP':
|
|
33 --thinning $algorithm_param.thinning
|
|
34 #end if
|
|
35 --algorithm $algorithm_param.algorithm
|
|
36 --n_batches $n_batches
|
|
37 --n_samples $n_samples
|
|
38 --seed $seed
|
|
39 --output_type "${",".join(map(str, $output_types))}"
|
|
40 --output_type_analysis "${",".join(map(str, $output_types_analysis))}"
|
|
41 --out_log $log
|
|
42 ]]>
|
|
43 </command>
|
|
44 <inputs>
|
|
45
|
|
46 <conditional name="cond_model">
|
|
47 <expand macro="options_ras_to_bounds_model"/>
|
|
48 <when value="Custom">
|
|
49 <param name="model" argument="--model" type="data" format="json, xml" label="Custom model" />
|
|
50 </when>
|
|
51 </conditional>
|
|
52
|
|
53 <param name="inputs" argument="--inputs" multiple="true" type="data" format="tabular, csv, tsv" label="Bound(s):" />
|
|
54
|
|
55
|
|
56 <conditional name="algorithm_param">
|
|
57 <param name="algorithm" argument="--algorithm" type="select" label="Choose sampling algorithm:">
|
|
58 <option value="CBS" selected="true">CBS</option>
|
|
59 <option value="OPTGP">OPTGP</option>
|
|
60 </param>
|
|
61 <when value="OPTGP">
|
|
62 <param name="thinning" argument="--thinning" type="integer" label="Thinning:" value="100" help="Number of iterations to wait before taking a sample."/>
|
|
63 </when>
|
|
64
|
|
65 </conditional>
|
|
66
|
|
67
|
|
68 <param name="n_samples" argument="--n_samples" type="integer" label="Samples:" value="1000"/>
|
|
69
|
|
70 <param name="n_batches" argument="--n_batches" type="integer" label="Batches:" value="10" help="This is useful for computational perfomances."/>
|
|
71
|
|
72 <param name="seed" argument="--seed" type="integer" label="Seed:" value="0" helph="Random seed."/>
|
|
73
|
|
74 <param type="select" argument="--output_types" multiple="true" name="output_types" label="Desired outputs from sampling">
|
|
75 <option value="mean" selected="true">Mean</option>
|
|
76 <option value="median" selected="true">Median</option>
|
|
77 <option value="quantiles" selected="true">Quantiles</option>
|
|
78 <option value="fluxes" selected="false">All fluxes</option>
|
|
79 </param>
|
|
80
|
|
81 <param type="select" argument="--output_types_analysis" multiple="true" name="output_types_analysis" label="Desired outputs from flux analysis">
|
|
82 <option value="pFBA" selected="false">pFBA</option>
|
|
83 <option value="FVA" selected="false">FVA</option>
|
|
84 <option value="sensitivity" selected="false">Sensitivity reaction knock-out (Biomass)</option>
|
|
85 </param>
|
|
86 </inputs>
|
|
87
|
|
88
|
|
89 <outputs>
|
|
90 <data format="txt" name="log" label="fluxSimulation - Log" />
|
35
|
91 <collection name="results" type="list" label="${tool.name} - Samples">
|
|
92 <discover_datasets pattern="__name_and_ext__" directory="flux_simulation"/>
|
|
93 </collection>
|
4
|
94 </outputs>
|
29
|
95
|
4
|
96 <help>
|
|
97 <![CDATA[
|
|
98 What it does
|
|
99 -------------
|
|
100
|
10
|
101 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
|
102
|
4
|
103 It can return sampled fluxes by appliying summary statistics:
|
7
|
104 - mean
|
|
105 - median
|
|
106 - quantiles (0.25, 0.50, 0.75).
|
9
|
107
|
|
108 Flux analysis can be perfomed over the metabolic model:
|
7
|
109 - parsimoniuos-FBA (optimized by Biomass)
|
|
110 - FVA
|
|
111 - 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
|
112
|
|
113 Accepted files:
|
9
|
114 - A model: JSON or XML file reporting reactions and rules contained in the model. It can be ENGRO2 or a custom model.
|
|
115 - Context-specific bounds: generated by RAS to Bounds tool. This can be a collection of bounds too (one bounds file per context).
|
4
|
116
|
|
117 Output:
|
|
118 -------------
|
|
119
|
|
120 The tool generates:
|
16
|
121 - Samples: reporting the sampled fluxes for each reaction (reaction names on the rows and sample names on the columns). Format: tab-separated.
|
7
|
122 - a log file (.txt).
|
4
|
123
|
|
124 **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
|
125 **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
|
126
|
|
127 ]]>
|
|
128 </help>
|
14
|
129 <expand macro="citations_fluxes" />
|
12
|
130
|
4
|
131 </tool> |