changeset 182:7be7ea5283cb draft

Uploaded
author luca_milaz
date Thu, 04 Jul 2024 14:09:24 +0000
parents af2079c6b749
children cbe1cb0a55be
files marea_2_0/flux_sampling.xml
diffstat 1 files changed, 97 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/marea_2_0/flux_sampling.xml	Thu Jul 04 14:09:24 2024 +0000
@@ -0,0 +1,97 @@
+<tool id="fluxSampling" name="COBRAxy Model sampling" version="2.0.0">
+    
+    <macros>
+        <import>marea_macros.xml</import>
+    </macros>
+
+	<requirements>
+        <requirement type="package" version="0.29.0">cobra</requirement>
+        <requirement type="package" version="4.9.3">lxml</requirement>
+        <requirement type="package" version="1.4.2">joblib</requirement>
+        
+	</requirements>
+
+    <command detect_errors="exit_code">
+        <![CDATA[
+        python $__tool_directory__/flux_sampling.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_format $output_format
+        --out_log $log
+        ]]>
+    </command>
+    <inputs>
+
+        <param name="inputs" argument="--inputs" multiple="true" type="data" format="xml, json" label="Model(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="1" help="The output file will contain n_batches*n_samples samples. 
+        This is useful for computational perfomances."/>
+
+        <param name="seed" argument="--seed" type="integer" label="Seed:" value="0" helph="Random seed."/>
+        
+        <param name="output_format" argument="--output_format" type="select" label="Output files format:">
+            <option value="pickle" selected="true">pickle extension (binary, non-editable, pre-parsed)</option>
+            <option value="csv">Comma Separated Values (csv text file, editable, raw)</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