changeset 153:fc183a80dae3 draft

Uploaded
author luca_milaz
date Mon, 22 Jul 2024 11:24:59 +0000
parents c0cb72d92fd9
children 4f43c1da18b6
files marea_2/flux_simulation.xml
diffstat 1 files changed, 108 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/marea_2/flux_simulation.xml	Mon Jul 22 11:24:59 2024 +0000
@@ -0,0 +1,108 @@
+<tool id="fluxSimulation" name="COBRAxy Flux Simulation" version="2.0.0">
+    
+    <macros>
+        <import>marea_macros.xml</import>
+    </macros>
+
+	<requirements>
+        <requirement type="package" version="1.24.4">numpy</requirement>
+        <requirement type="package" version="2.0.3">pandas</requirement>
+		<requirement type="package" version="0.29.0">cobra</requirement>
+        <requirement type="package" version="5.2.2">lxml</requirement>
+        <requirement type="package" version="1.4.2">joblib</requirement>
+        <requirement type="package" version="1.10.1">scipy</requirement>
+	</requirements>
+
+    <command detect_errors="exit_code">
+        <![CDATA[
+        python $__tool_directory__/flux_simulation.py
+        --tool_dir $__tool_directory__
+        --input "${",".join(map(str, $inputs))}"
+        #set $names = ""
+        #for $input_temp in $inputs:
+            #set $names = $names + $input_temp.element_identifier + ","
+        #end for
+        --name $names
+        --thinning 0
+        #if $algorithm_param.algorithm == 'OPTGP':
+        	--thinning $algorithm_param.thinning
+        #end if
+        --algorithm $algorithm_param.algorithm
+        --n_batches $n_batches
+        --n_samples $n_samples
+        --seed $seed
+        --output_type "${",".join(map(str, $output_types))}"
+        --output_type_analysis "${",".join(map(str, $output_types_analysis))}"
+        --out_log $log
+        ]]>
+    </command>
+    <inputs>
+
+        <param name="inputs" argument="--inputs" multiple="true" type="data" format="tabular, csv, tsv" label="Bound(s):" />
+        
+        
+        <conditional name="algorithm_param">
+			<param name="algorithm" argument="--algorithm" type="select" label="Choose sampling algorithm:">
+                    <option value="CBS" selected="true">CBS</option>
+                	<option value="OPTGP">OPTGP</option>
+        	</param>
+        	<when value="OPTGP">
+        		<param name="thinning" argument="--thinning" type="integer" label="Thinning:"  value="100" help="Number of iterations to wait before taking a sample."/>
+        	</when>
+
+		</conditional>
+
+
+        <param name="n_samples" argument="--n_samples" type="integer" label="Samples:" value="1000"/>
+
+        <param name="n_batches" argument="--n_batches" type="integer" label="Batches:" value="10" help="This is useful for computational perfomances."/>
+
+        <param name="seed" argument="--seed" type="integer" label="Seed:" value="0" helph="Random seed."/>
+
+        <param type="select" argument="--output_types" multiple="true" name="output_types" label="Desired outputs from sampling">
+            <option value="mean" selected="true">Mean</option>
+            <option value="median" selected="true">Median</option>
+            <option value="quantiles" selected="true">Quantiles</option>
+            <option value="fluxes" selected="false">All fluxes</option>
+        </param>
+
+        <param type="select" argument="--output_types_analysis" multiple="true" name="output_types" label="Desired outputs from flux analysis">
+            <option value="pFBA" selected="false">pFBA</option>
+            <option value="FVA" selected="false">FVA</option>
+            <option value="sensitivity" selected="false">Sensitivity reaction knock-out (Biomass)</option>
+        </param>
+    </inputs>
+
+        		
+    <outputs>
+        <data format="txt" name="log" label="fluxSampling - Log" />
+        <collection name="results" type="list" label="${tool.name} - Samples">
+            <discover_datasets pattern="__name_and_ext__" directory="flux_sampling"/>
+        </collection>
+    </outputs>
+       
+        
+    <help>
+    <![CDATA[
+What it does
+-------------
+
+This tool generates flux samples starting from a model in JSON or XML format by using CBS (Corner-based sampling) and OPTGP (mproved Artificial Centering Hit-and-Run sampler) sampling algorithms.
+
+Accepted files:
+    - A model: JSON or XML file reporting reactions and rules contained in the model. It can be a single model, multiple models or a collection of models. 
+
+Output:
+-------------
+
+The tool generates:
+    - Samples: reporting the sampled fluxes for each reaction. Format: csv or pickle.
+    - a log file (.txt).
+
+**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.
+
+
+]]>
+    </help>
+    <expand macro="citations" />
+</tool>
\ No newline at end of file