Mercurial > repos > tduigou > doe_synbio_sampler
comparison sampler.xml @ 0:164616ec7f18 draft
planemo upload for repository ['https://github.com/brsynth/icfree-ml', 'https://github.com/pablocarb/doebase'] commit 6c01728900e4ebd1a833a7e7d697f61561d86dc6-dirty
author | tduigou |
---|---|
date | Tue, 28 Mar 2023 12:32:38 +0000 |
parents | |
children | cd6d2c983e69 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:164616ec7f18 |
---|---|
1 <tool id="doe_synbio_sampler" name="iCFree sampler" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" license="@LICENCE@"> | |
2 <description>Generate data points using latin hypercube sampling (LHS)</description> | |
3 <macros> | |
4 <import>macros.xml</import> | |
5 <token name="@TOOL_VERSION@">2.1.1</token> | |
6 </macros> | |
7 <requirements> | |
8 <requirement type="package" version="@TOOL_VERSION@">icfree</requirement> | |
9 </requirements> | |
10 <expand macro="stdio"/> | |
11 <command detect_errors="exit_code"><![CDATA[ | |
12 python -m icfree.sampler | |
13 '$cfps_file' | |
14 --nb-sampling-steps '$adv.nb_sampling_steps' | |
15 --nb-samples '$nb_samples' | |
16 #if str($adv.sampling_ratio) != "" | |
17 #set ratios = ' '.join(['"' + $x + '"' for $x in $adv.sampling_ratio.split()]) | |
18 --sampling-ratios $ratios | |
19 #end if | |
20 #if str($adv.seed_cond.seed_param) == 'not_random' | |
21 --seed '$adv.seed_cond.seed' | |
22 #end if | |
23 --output-format 'tsv' | |
24 --output-folder . && | |
25 mv sampling.tsv '$output_sampling' | |
26 ]]></command> | |
27 <inputs> | |
28 <param name="cfps_file" type="data" format="tabular" label="CFPS parameters and features" /> | |
29 <param name="nb_samples" type="integer" value="99" min="1" max="198" label="Number of samples to generate" /> | |
30 <section name="adv" title="Advanced Options" expanded="false"> | |
31 <param name="nb_sampling_steps" type="integer" value="5" min="1" max="10" label="Number of values for all factors when performing the sampling" /> | |
32 <param name="sampling_ratio" type="text" value="" label="Ratios associated for all factors" help="Only float, space separated, are allowed"> | |
33 <validator type="regex" message="Float separated by a space between in the range: 0.0 - 1.0">^(?:(0.\d+|1\.0)(\s0?\.\d+|1\.0)*)*$</validator> | |
34 </param> | |
35 <conditional name="seed_cond"> | |
36 <param name="seed_param" type="select" label="Seed" help="Choose a seed or let it as random"> | |
37 <option value="random" selected="true">random</option> | |
38 <option value="not_random">fixed</option> | |
39 </param> | |
40 <when value="random"/> | |
41 <when value="not_random"> | |
42 <param name="seed" type="text" value="0" label="Seed value" help="Only integer allowed"> | |
43 <validator type="empty_field" message="Not empty, select random"/> | |
44 <validator type="regex" message="Only integer allowed">^(?:\d+)$</validator> | |
45 </param> | |
46 </when> | |
47 </conditional> | |
48 </section> | |
49 </inputs> | |
50 <outputs> | |
51 <data name="output_sampling" format="tabular" label="${tool.name}" /> | |
52 </outputs> | |
53 <tests> | |
54 <!-- test 1: check if identical outputs are produced with default parameters --> | |
55 <test> | |
56 <param name="cfps_file" value="converter_proCFPS_parameters.tsv" /> | |
57 <param name="seed_param" value="not_random" /> | |
58 <param name="seed" value="0" /> | |
59 <output name="output_sampling" file="sampler_sampling.test-1.tsv" ftype="tabular" compare="diff" /> | |
60 </test> | |
61 <!-- test 2: advanced arguments --> | |
62 <test> | |
63 <param name="cfps_file" value="converter_proCFPS_parameters.tsv" /> | |
64 <param name="nb_sampling_steps" value="3" /> | |
65 <param name="nb_samples" value="100" /> | |
66 <param name="sampling_ratio" value="0.4 0.2 0.3" /> | |
67 <param name="seed_param" value="not_random" /> | |
68 <param name="seed" value="0" /> | |
69 <param name="nb_samples" value="100" /> | |
70 <output name="output_sampling" file="sampler_sampling.test-2.tsv" ftype="tabular" compare="diff" /> | |
71 </test> | |
72 </tests> | |
73 <help><![CDATA[ | |
74 Sampler | |
75 ======= | |
76 | |
77 This module generates a list of values for all parameters given in the input file. | |
78 The values are generated using a Latin Hypercube Sampling (LHS) method (lhs function from the pyDOE package). | |
79 The number of values generated is given by the user and the values are saved in csv or tsv file. | |
80 | |
81 It is important to note that the user can pass some values that he whishes to combine. In this case, we are dealing with discrete space, and because LHS is working on continuous space the result sampling can contain duplicates. | |
82 To avoid this, we have set some filters to select the appropriate sampling method: | |
83 | |
84 * If the result sampling contain duplicates, then we replace them by random samples. | |
85 * Proceed with full random sampling. | |
86 * Generate all the combinations. | |
87 | |
88 Input | |
89 ----- | |
90 * **CFPS Parameters File**: The first column is the parameter (or factor) names. The second column is the maxValue of the parameter that will be used in the sampling. The third column is the concnetration of the stock. The fourth column is the deadVolume of the parameter. This is used to calculate the volume of the parameter that will not be pipetted by the robot (because of viscosity). The fifth column is the specific ratios we want to have for this parameter. If nothing defined, then take ratios given in program options. If one single number is given, then take this number as a const value. | |
91 | |
92 Advanced options: | |
93 ----------------- | |
94 * **Number of sampling steps**: Number of values for all factors when performing the sampling (default: 5) | |
95 * **Sampling ratios**: Ratios for all factors when performing the sampling | |
96 * **Number of samples**: Number of samples to generate for all factors when performing the sampling (default: 99) | |
97 | |
98 Output | |
99 ------ | |
100 * a TSV file with the sampling values for each parameter | |
101 ]]></help> | |
102 <expand macro="creator"/> | |
103 <citations> | |
104 <citation type="bibtex"> | |
105 @unpublished{icfree | |
106 author = {Joan Hérisson, Yorgo El Moubayed}, | |
107 title = {{icfree}}, | |
108 url = {https://github.com/brsynth/icfree-ml/}, | |
109 } | |
110 </citation> | |
111 </citations> | |
112 </tool> |