Mercurial > repos > tduigou > icfree_sampler
comparison sampler.xml @ 5:b2dba600eb2b draft
planemo upload for repository https://github.com/brsynth/icfree-ml commit 1568ac8d21ca92c2325ef661498ee7a4b622ae5e
| author | tduigou |
|---|---|
| date | Tue, 21 Mar 2023 09:43:44 +0000 |
| parents | fe4c1eccb687 |
| children | 40b05ca455a9 |
comparison
equal
deleted
inserted
replaced
| 4:fe4c1eccb687 | 5:b2dba600eb2b |
|---|---|
| 4 <import>macros.xml</import> | 4 <import>macros.xml</import> |
| 5 </macros> | 5 </macros> |
| 6 <expand macro="requirements"/> | 6 <expand macro="requirements"/> |
| 7 <expand macro="stdio"/> | 7 <expand macro="stdio"/> |
| 8 <command detect_errors="exit_code"><![CDATA[ | 8 <command detect_errors="exit_code"><![CDATA[ |
| 9 #set ratios = [] | 9 echo '$adv.sampling_ratio' && |
| 10 #for $x in $adv.rep | |
| 11 #silent $ratios.append(str($x.ratio)) | |
| 12 #end for | |
| 13 #set sratios = ' '.join(['"' + $x + '"' for $x in $ratios]) | |
| 14 echo "${sratios}" && | |
| 15 python -m icfree.sampler | 10 python -m icfree.sampler |
| 16 '$cfps_file' | 11 '$cfps_file' |
| 17 #if len(ratios) > 0 | 12 --nb-sampling-steps '$adv.nb_sampling_steps' |
| 18 --sampling-ratios ${sratios} | 13 --nb-samples '$nb_samples' |
| 14 #if str($adv.sampling_ratio) != "" | |
| 15 #set ratios = ' '.join(['"' + $x + '"' for $x in $adv.sampling_ratio.split()]) | |
| 16 --sampling-ratios $ratios | |
| 19 #end if | 17 #end if |
| 20 --nb-sampling-steps '$adv.nb_sampling_steps' | 18 #if str($adv.seed_cond.seed_param) == 'not_random' |
| 21 --nb-samples '$adv.nb_samples' | 19 --seed '$adv.seed_cond.seed' |
| 22 --seed '0' | 20 #end if |
| 23 --output-format 'tsv' | 21 --output-format 'tsv' |
| 24 --output-folder . && | 22 --output-folder . && |
| 25 mv sampling.tsv '$output_sampling' | 23 mv sampling.tsv '$output_sampling' |
| 26 ]]></command> | 24 ]]></command> |
| 27 <inputs> | 25 <inputs> |
| 28 <param name="cfps_file" type="data" format="tabular" label="CFPS parameters and features" /> | 26 <param name="cfps_file" type="data" format="tabular" label="CFPS parameters and features" /> |
| 27 <param name="nb_samples" type="integer" value="99" min="1" max="198" label="Number of samples to generate" /> | |
| 29 <section name="adv" title="Advanced Options" expanded="false"> | 28 <section name="adv" title="Advanced Options" expanded="false"> |
| 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" /> | 29 <param name="nb_sampling_steps" type="integer" value="5" min="1" max="10" label="Number of values for all factors when performing the sampling" /> |
| 31 <param name="nb_samples" type="integer" value="99" min="1" max="198" label="Number of samples to generate" /> | 30 <param name="sampling_ratio" type="text" value="" label="Ratios associated for all factors" help="Only float, space separated, are allowed"> |
| 32 <repeat name="rep" title="Sampling ratio" min="0"> | 31 <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> |
| 33 <param name="ratio" type="float" value="0.1" min="0.0" max="1.0" label="Ratio associated to each factor" /> | 32 </param> |
| 34 </repeat> | 33 <conditional name="seed_cond"> |
| 34 <param name="seed_param" type="select" label="Seed" help="Choose a seed or let it as random"> | |
| 35 <option value="random" selected="true">random</option> | |
| 36 <option value="not_random">fixed</option> | |
| 37 </param> | |
| 38 <when value="random"/> | |
| 39 <when value="not_random"> | |
| 40 <param name="seed" type="text" value="0" label="Seed value" help="Only integer allowed"> | |
| 41 <validator type="empty_field" message="Not empty, select random"/> | |
| 42 <validator type="regex" message="Only integer allowed">^(?:\d+)$</validator> | |
| 43 </param> | |
| 44 </when> | |
| 45 </conditional> | |
| 35 </section> | 46 </section> |
| 36 </inputs> | 47 </inputs> |
| 37 <outputs> | 48 <outputs> |
| 38 <data name="output_sampling" format="tabular" label="${tool.name}" /> | 49 <data name="output_sampling" format="tabular" label="${tool.name}" /> |
| 39 </outputs> | 50 </outputs> |
| 40 <tests> | 51 <tests> |
| 41 <!-- test 1: check if identical outputs are produced with default parameters --> | 52 <!-- test 1: check if identical outputs are produced with default parameters --> |
| 42 <test> | 53 <test> |
| 43 <param name="cfps_file" value="converter_proCFPS_parameters.tsv" /> | 54 <param name="cfps_file" value="converter_proCFPS_parameters.tsv" /> |
| 55 <param name="seed_param" value="not_random" /> | |
| 56 <param name="seed" value="0" /> | |
| 44 <output name="sampling" file="sampler_sampling.test-1.tsv" ftype="tabular" compare="diff" /> | 57 <output name="sampling" file="sampler_sampling.test-1.tsv" ftype="tabular" compare="diff" /> |
| 45 </test> | 58 </test> |
| 46 <!-- test 2: advanced arguments --> | 59 <!-- test 2: advanced arguments --> |
| 47 <test> | 60 <test> |
| 48 <param name="cfps_file" value="converter_proCFPS_parameters.tsv" /> | 61 <param name="cfps_file" value="converter_proCFPS_parameters.tsv" /> |
| 49 <param name="nb_sampling_steps" value="3" /> | 62 <param name="nb_sampling_steps" value="3" /> |
| 50 <param name="nb_samples" value="100" /> | 63 <param name="nb_samples" value="100" /> |
| 51 <repeat name="rep"> | 64 <param name="sampling_ratio" value="0.4 0.2 0.3" /> |
| 52 <param name="ratio" value="0.4" /> | 65 <param name="seed_param" value="not_random" /> |
| 53 </repeat> | 66 <param name="seed" value="0" /> |
| 54 <repeat name="rep"> | |
| 55 <param name="ratio" value="0.2" /> | |
| 56 </repeat> | |
| 57 <repeat name="rep"> | |
| 58 <param name="ratio" value="0.3" /> | |
| 59 </repeat> | |
| 60 <param name="nb_samples" value="100" /> | 67 <param name="nb_samples" value="100" /> |
| 61 <output name="sampling" file="sampler_sampling.test-2.tsv" ftype="tabular" compare="diff" /> | 68 <output name="sampling" file="sampler_sampling.test-2.tsv" ftype="tabular" compare="diff" /> |
| 62 </test> | 69 </test> |
| 63 </tests> | 70 </tests> |
| 64 <help><