comparison sampler.xml @ 6:04159a12c757 draft

planemo upload for repository ['https://github.com/brsynth/icfree-ml', 'https://github.com/pablocarb/doebase'] commit 9889dbc08f8f4ff3ee992418d81d39e35c81051a
author tduigou
date Tue, 17 Sep 2024 15:09:50 +0000
parents 5e7468a35380
children 257a173f377e
comparison
equal deleted inserted replaced
5:5e7468a35380 6:04159a12c757
1 <tool id="doe_synbio_sampler" name="iCFree sampler" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" license="@LICENCE@"> 1 <tool id="doe_synbio_sampler" name="iCFree sampler" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" license="@LICENCE@">
2 <description>Generate Latin Hypercube Samples for given components.</description> 2 <description>Generate Latin Hypercube Samples for given components.</description>
3 <macros> 3 <macros>
4 <import>macros.xml</import> 4 <import>macros.xml</import>
5 <token name="@TOOL_VERSION@">2.4.0</token> 5 <token name="@TOOL_VERSION@">2.5.0</token>
6 </macros> 6 </macros>
7 <requirements> 7 <requirements>
8 <requirement type="package" version="@TOOL_VERSION@">icfree-ml</requirement> 8 <requirement type="package" version="@TOOL_VERSION@">icfree-ml</requirement>
9 </requirements> 9 </requirements>
10 <expand macro="stdio"/> 10 <expand macro="stdio"/>
11 <command detect_errors="exit_code"><![CDATA[ 11 <command detect_errors="exit_code"><![CDATA[
12 #import json
13 #set $components = {}
14 #for $x in $adv.rep
15 $components.__setitem__(str($x.component_name), str($x.component_value))
16 #end for
17
12 python -m icfree.sampler 18 python -m icfree.sampler
13 '$input_file' 19 '$input_file'
14 '$output_sampling' 20 '$output_sampling'
15 '$num_samples' 21 '$num_samples'
16 --step '$adv.step' 22 #if str($adv.range_cond.range_param) == 'ratios'
23 --ratios '$adv.range_cond.by_ratios'
24 #else
25 --step '$adv.range_cond.by_step'
26 #end if
17 #if str($adv.seed_cond.seed_param) == 'not_random' 27 #if str($adv.seed_cond.seed_param) == 'not_random'
18 --seed '$adv.seed_cond.seed' 28 --seed '$adv.seed_cond.seed'
29 #end if
30 #if len(components) > 0
31 --fixed_values '#echo json.dumps(components)#'
19 #end if 32 #end if
20 ]]></command> 33 ]]></command>
21 <inputs> 34 <inputs>
22 <param name="input_file" type="data" format="tabular" label="Input file with components and their max values." /> 35 <param name="input_file" type="data" format="tabular" label="Input file with components and their max values." />
23 <param name="num_samples" type="integer" value="99" min="1" max="198" label="Number of samples to generate" /> 36 <param name="num_samples" type="integer" min="1" label="Number of samples to generate" />
24 <section name="adv" title="Advanced Options" expanded="false"> 37 <section name="adv" title="Advanced Options" expanded="false">
25 <param name="step" type="float" value="2.5" min="1" max="10" label="Step size for creating discrete ranges" /> 38 <!-- Range -->
39 <conditional name="range_cond">
40 <param name="range_param" type="select" label="Seed" help="How to create the discrete range">
41 <option value="step" selected="true">step</option>
42 <option value="ratios">ratios</option>
43 </param>
44 <when value="step">
45 <param name="by_step" type="float" value="2.5" min="0" label="Step size for creating discrete ranges" />
46 </when>
47 <when value="ratios">
48 <param name="by_ratios" type="text" label="Ratios to be sampled">
49 <validator type="regex" message="List of float values, separated by a comma without of spaces">^(\d+(\.\d+)?)(,\d+(\.\d+)?)*$</validator>
50 </param>
51 </when>
52 </conditional>
53 <!-- Fixed values -->
54 <repeat name="rep" title="Fixed values for components as a dictionary">
55 <param name="component_name" type="text" value="" label="Component Name">
56 <validator type="empty_field" message="Not empty" />
57 </param>
58 <param name="component_value" type="integer" value="1" min="1" label="Value" />
59 </repeat>
60 <!-- Seed -->
26 <conditional name="seed_cond"> 61 <conditional name="seed_cond">
27 <param name="seed_param" type="select" label="Seed" help="Choose a seed or let it as random"> 62 <param name="seed_param" type="select" label="Seed" help="Choose a seed or let it as random">
28 <option value="random" selected="true">random</option> 63 <option value="random" selected="true">random</option>
29 <option value="not_random">fixed</option> 64 <option value="not_random">fixed</option>
30 </param> 65 </param>
48 <param name="num_samples" value="3" /> 83 <param name="num_samples" value="3" />
49 <param name="seed_param" value="not_random" /> 84 <param name="seed_param" value="not_random" />
50 <param name="seed" value="0" /> 85 <param name="seed" value="0" />
51 <output name="output_sampling" file="sampler/output/sampling.test-1.tsv" ftype="tabular" compare="diff" /> 86 <output name="output_sampling" file="sampler/output/sampling.test-1.tsv" ftype="tabular" compare="diff" />
52 </test> 87 </test>
53 <!-- test 1: check if identical outputs are produced with default parameters --> 88 <!-- test 2: with specific step -->
54 <test> 89 <test>
55 <param name="input_file" value="sampler/input/components.tsv" /> 90 <param name="input_file" value="sampler/input/components.tsv" />
56 <param name="num_samples" value="4" /> 91 <param name="num_samples" value="4" />
57 <param name="step" value="3.1" /> 92 <param name="step" value="3.1" />
58 <param name="seed_param" value="not_random" /> 93 <param name="seed_param" value="not_random" />
59 <param name="seed" value="0" /> 94 <param name="seed" value="0" />
60 <output name="output_sampling" file="sampler/output/sampling.test-2.tsv" ftype="tabular" compare="diff" /> 95 <output name="output_sampling" file="sampler/output/sampling.test-2.tsv" ftype="tabular" compare="diff" />
96 </test>
97 <!-- test 3: with fixed values -->
98 <test>
99 <param name="input_file" value="sampler/input/components.tsv" />
100 <param name="num_samples" value="3" />
101 <param name="seed_param" value="not_random" />
102 <param name="seed" value="0" />
103 <repeat name="rep">
104 <param name="component_name" value="Hela lysate" />
105 <param name="component_value" value="10" />
106 </repeat>
107 <repeat name="rep">
108 <param name="component_name" value="RNA 1ug/uL" />
109 <param name="component_value" value="20" />
110 </repeat>
111 <output name="output_sampling" file="sampler/output/sampling.test-3.tsv" ftype="tabular" compare="diff" />
112 </test>
113 <!-- test 4: with ratios -->
114 <test>
115 <param name="input_file" value="sampler/input/components.tsv" />
116 <param name="num_samples" value="4" />
117 <param name="seed_param" value="not_random" />
118 <param name="seed" value="0" />
119 <param name="range_param" value="ratios" />
120 <param name="by_ratios" value="0.5,0.1,0.3,0.2" />
121 <output name="output_sampling" file="sampler/output/sampling.test-4.tsv" ftype="tabular" compare="diff" />
61 </test> 122 </test>
62 </tests> 123 </tests>
63 <help><![CDATA[ 124 <help><![CDATA[
64 Sampler 125 Sampler
65 ======= 126 =======