annotate sampler.xml @ 4:fe4c1eccb687 draft

planemo upload for repository https://github.com/brsynth/icfree-ml commit 79b4751f34792a1a346ada38f7b6f64571dd51e9
author tduigou
date Thu, 09 Mar 2023 16:46:15 +0000
parents d919d5c6f458
children b2dba600eb2b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
1 <tool id="icfree_sampler" name="iCFree sampler" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" license="@LICENCE@">
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
2 <description>Generate data points using latin hypercube sampling (LHS)</description>
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
3 <macros>
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
4 <import>macros.xml</import>
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
5 </macros>
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
6 <expand macro="requirements"/>
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
7 <expand macro="stdio"/>
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
8 <command detect_errors="exit_code"><![CDATA[
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
9 #set ratios = []
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
10 #for $x in $adv.rep
2
d919d5c6f458 planemo upload for repository https://github.com/brsynth/icfree-ml commit 85162aa9b21ff6b297c164f127ed2ca2be2d90dd
tduigou
parents: 1
diff changeset
11 #silent $ratios.append(str($x.ratio))
0
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
12 #end for
2
d919d5c6f458 planemo upload for repository https://github.com/brsynth/icfree-ml commit 85162aa9b21ff6b297c164f127ed2ca2be2d90dd
tduigou
parents: 1
diff changeset
13 #set sratios = ' '.join(['"' + $x + '"' for $x in $ratios])
d919d5c6f458 planemo upload for repository https://github.com/brsynth/icfree-ml commit 85162aa9b21ff6b297c164f127ed2ca2be2d90dd
tduigou
parents: 1
diff changeset
14 echo "${sratios}" &&
0
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
15 python -m icfree.sampler
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
16 '$cfps_file'
1
80f5b5db4bb0 planemo upload for repository https://github.com/brsynth/icfree-ml commit 13e7cacbe8d65c6e798625de6bba986e89def461
tduigou
parents: 0
diff changeset
17 #if len(ratios) > 0
2
d919d5c6f458 planemo upload for repository https://github.com/brsynth/icfree-ml commit 85162aa9b21ff6b297c164f127ed2ca2be2d90dd
tduigou
parents: 1
diff changeset
18 --sampling-ratios ${sratios}
0
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
19 #end if
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
20 --nb-sampling-steps '$adv.nb_sampling_steps'
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
21 --nb-samples '$adv.nb_samples'
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
22 --seed '0'
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
23 --output-format 'tsv'
4
fe4c1eccb687 planemo upload for repository https://github.com/brsynth/icfree-ml commit 79b4751f34792a1a346ada38f7b6f64571dd51e9
tduigou
parents: 2
diff changeset
24 --output-folder . &&
fe4c1eccb687 planemo upload for repository https://github.com/brsynth/icfree-ml commit 79b4751f34792a1a346ada38f7b6f64571dd51e9
tduigou
parents: 2
diff changeset
25 mv sampling.tsv '$output_sampling'
0
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
26 ]]></command>
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
27 <inputs>
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
28 <param name="cfps_file" type="data" format="tabular" label="CFPS parameters and features" />
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
29 <section name="adv" title="Advanced Options" expanded="false">
1
80f5b5db4bb0 planemo upload for repository https://github.com/brsynth/icfree-ml commit 13e7cacbe8d65c6e798625de6bba986e89def461
tduigou
parents: 0
diff changeset
30 <param name="nb_sampling_steps" type="integer" value="5" min="1" max="10" label="Number of values for all factors when performing the sampling" />
80f5b5db4bb0 planemo upload for repository https://github.com/brsynth/icfree-ml commit 13e7cacbe8d65c6e798625de6bba986e89def461
tduigou
parents: 0
diff changeset
31 <param name="nb_samples" type="integer" value="99" min="1" max="198" label="Number of samples to generate" />
80f5b5db4bb0 planemo upload for repository https://github.com/brsynth/icfree-ml commit 13e7cacbe8d65c6e798625de6bba986e89def461
tduigou
parents: 0
diff changeset
32 <repeat name="rep" title="Sampling ratio" min="0">
0
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
33 <param name="ratio" type="float" value="0.1" min="0.0" max="1.0" label="Ratio associated to each factor" />
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
34 </repeat>
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
35 </section>
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
36 </inputs>
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
37 <outputs>
4
fe4c1eccb687 planemo upload for repository https://github.com/brsynth/icfree-ml commit 79b4751f34792a1a346ada38f7b6f64571dd51e9
tduigou
parents: 2
diff changeset
38 <data name="output_sampling" format="tabular" label="${tool.name}" />
0
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
39 </outputs>
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
40 <tests>
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
41 <!-- test 1: check if identical outputs are produced with default parameters -->
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
42 <test>
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
43 <param name="cfps_file" value="converter_proCFPS_parameters.tsv" />
4
fe4c1eccb687 planemo upload for repository https://github.com/brsynth/icfree-ml commit 79b4751f34792a1a346ada38f7b6f64571dd51e9
tduigou
parents: 2
diff changeset
44 <output name="sampling" file="sampler_sampling.test-1.tsv" ftype="tabular" compare="diff" />
0
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
45 </test>
2
d919d5c6f458 planemo upload for repository https://github.com/brsynth/icfree-ml commit 85162aa9b21ff6b297c164f127ed2ca2be2d90dd
tduigou
parents: 1
diff changeset
46 <!-- test 2: advanced arguments -->
d919d5c6f458 planemo upload for repository https://github.com/brsynth/icfree-ml commit 85162aa9b21ff6b297c164f127ed2ca2be2d90dd
tduigou
parents: 1
diff changeset
47 <test>
d919d5c6f458 planemo upload for repository https://github.com/brsynth/icfree-ml commit 85162aa9b21ff6b297c164f127ed2ca2be2d90dd
tduigou
parents: 1
diff changeset
48 <param name="cfps_file" value="converter_proCFPS_parameters.tsv" />
d919d5c6f458 planemo upload for repository https://github.com/brsynth/icfree-ml commit 85162aa9b21ff6b297c164f127ed2ca2be2d90dd
tduigou
parents: 1
diff changeset
49 <param name="nb_sampling_steps" value="3" />
d919d5c6f458 planemo upload for repository https://github.com/brsynth/icfree-ml commit 85162aa9b21ff6b297c164f127ed2ca2be2d90dd
tduigou
parents: 1
diff changeset
50 <param name="nb_samples" value="100" />
d919d5c6f458 planemo upload for repository https://github.com/brsynth/icfree-ml commit 85162aa9b21ff6b297c164f127ed2ca2be2d90dd
tduigou
parents: 1
diff changeset
51 <repeat name="rep">
d919d5c6f458 planemo upload for repository https://github.com/brsynth/icfree-ml commit 85162aa9b21ff6b297c164f127ed2ca2be2d90dd
tduigou
parents: 1
diff changeset
52 <param name="ratio" value="0.4" />
d919d5c6f458 planemo upload for repository https://github.com/brsynth/icfree-ml commit 85162aa9b21ff6b297c164f127ed2ca2be2d90dd
tduigou
parents: 1
diff changeset
53 </repeat>
d919d5c6f458 planemo upload for repository https://github.com/brsynth/icfree-ml commit 85162aa9b21ff6b297c164f127ed2ca2be2d90dd
tduigou
parents: 1
diff changeset
54 <repeat name="rep">
d919d5c6f458 planemo upload for repository https://github.com/brsynth/icfree-ml commit 85162aa9b21ff6b297c164f127ed2ca2be2d90dd
tduigou
parents: 1
diff changeset
55 <param name="ratio" value="0.2" />
d919d5c6f458 planemo upload for repository https://github.com/brsynth/icfree-ml commit 85162aa9b21ff6b297c164f127ed2ca2be2d90dd
tduigou
parents: 1
diff changeset
56 </repeat>
d919d5c6f458 planemo upload for repository https://github.com/brsynth/icfree-ml commit 85162aa9b21ff6b297c164f127ed2ca2be2d90dd
tduigou
parents: 1
diff changeset
57 <repeat name="rep">
d919d5c6f458 planemo upload for repository https://github.com/brsynth/icfree-ml commit 85162aa9b21ff6b297c164f127ed2ca2be2d90dd
tduigou
parents: 1
diff changeset
58 <param name="ratio" value="0.3" />
d919d5c6f458 planemo upload for repository https://github.com/brsynth/icfree-ml commit 85162aa9b21ff6b297c164f127ed2ca2be2d90dd
tduigou
parents: 1
diff changeset
59 </repeat>
d919d5c6f458 planemo upload for repository https://github.com/brsynth/icfree-ml commit 85162aa9b21ff6b297c164f127ed2ca2be2d90dd
tduigou
parents: 1
diff changeset
60 <param name="nb_samples" value="100" />
4
fe4c1eccb687 planemo upload for repository https://github.com/brsynth/icfree-ml commit 79b4751f34792a1a346ada38f7b6f64571dd51e9
tduigou
parents: 2
diff changeset
61 <output name="sampling" file="sampler_sampling.test-2.tsv" ftype="tabular" compare="diff" />
2
d919d5c6f458 planemo upload for repository https://github.com/brsynth/icfree-ml commit 85162aa9b21ff6b297c164f127ed2ca2be2d90dd
tduigou
parents: 1
diff changeset
62 </test>
0
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
63 </tests>
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
64 <help><![CDATA[
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
65 Sampler
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
66 =======
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
67
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
68 This module generates a list of values for all parameters given in the input file.
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
69 The values are generated using a Latin Hypercube Sampling (LHS) method (lhs function from the pyDOE package).
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
70 The number of values generated is given by the user and the values are saved in csv or tsv file.
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
71
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
72 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.
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
73 To avoid this, we have set some filters to select the appropriate sampling method:
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
74
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
75 * If the result sampling contain duplicates, then we replace them by random samples.
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
76 * Proceed with full random sampling.
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
77 * Generate all the combinations.
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
78
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
79 Input
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
80 -----
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
81 * **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.
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
82
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
83 Advanced options:
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
84 -----------------
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
85 * **Number of sampling steps**: Number of values for all factors when performing the sampling (default: 5)
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
86 * **Sampling ratios**: Ratios for all factors when performing the sampling
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
87 * **Number of samples**: Number of samples to generate for all factors when performing the sampling (default: 99)
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
88
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
89 Output
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
90 ------
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
91 * a TSV file with the sampling values for each parameter
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
92 ]]></help>
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
93 <expand macro="creator"/>
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
94 <expand macro="citation"/>
a71884785dcc planemo upload for repository https://github.com/brsynth/icfree-ml commit d87d4a4d7c894f2d884a71a2acc35f93bc5bbe4b
tduigou
parents:
diff changeset
95 </tool>