comparison larch_artemis.xml @ 5:7acb53ffb96f draft

planemo upload for repository https://github.com/MaterialsGalaxy/larch-tools/tree/main/larch_artemis commit 4814f53888643f1d3667789050914675fffb7d59
author muon-spectroscopy-computational-project
date Fri, 23 Aug 2024 13:46:13 +0000
parents 39ab361e6d59
children d17c5d62802f
comparison
equal deleted inserted replaced
4:39ab361e6d59 5:7acb53ffb96f
1 <tool id="larch_artemis" name="Larch Artemis" version="@TOOL_VERSION@+galaxy@WRAPPER_VERSION@" python_template_version="3.5" profile="22.05" license="MIT"> 1 <tool id="larch_artemis" name="Larch Artemis" version="@TOOL_VERSION@+galaxy@WRAPPER_VERSION@" python_template_version="3.5" profile="22.05" license="MIT">
2 <description>generate Artemis projects from XAFS data</description> 2 <description>generate Artemis projects from XAFS data</description>
3 <macros> 3 <macros>
4 <!-- version of underlying tool (PEP 440) --> 4 <!-- version of underlying tool (PEP 440) -->
5 <token name="@TOOL_VERSION@">0.9.75</token> 5 <token name="@TOOL_VERSION@">0.9.80</token>
6 <!-- version of this tool wrapper (integer) --> 6 <!-- version of this tool wrapper (integer) -->
7 <token name="@WRAPPER_VERSION@">1</token> 7 <token name="@WRAPPER_VERSION@">0</token>
8 <!-- citation should be updated with every underlying tool version --> 8 <!-- citation should be updated with every underlying tool version -->
9 <!-- typical fields to update are version, month, year, and doi --> 9 <!-- typical fields to update are version, month, year, and doi -->
10 <token name="@TOOL_CITATION@">10.1088/1742-6596/430/1/012007</token> 10 <token name="@TOOL_CITATION@">10.1088/1742-6596/430/1/012007</token>
11 <xml name="series_options">
12 <param name="stop_on_error" type="boolean" label="Stop on error" help="Whether to stop gracefully or continue with subsequent projects if an error is encountered when fitting."/>
13 <repeat name="report_criteria" title="Report Criteria">
14 <param name="variable" type="text" label="Variable" help="Name of the variable of that appears in the statistics or variables sections of the report."/>
15 <conditional name="action">
16 <param name="action" type="select" display="radio" label="Action" help="What to do with the named variable.">
17 <option value="log" selected="true">Log</option>
18 <option value="warn">Warn</option>
19 <option value="stop">Early stopping</option>
20 </param>
21 <when value="log"/>
22 <when value="warn">
23 <param name="threshold" type="float" value="0.0" min="0.0" label="Warning threshold" help="In addition to logging, a warning will be printed if the absolute value of this variable goes above this threshold."/>
24 </when>
25 <when value="stop">
26 <param name="threshold" type="float" value="0.0" min="0.0" label="Early stopping threshold" help="In addition to logging, execution will stop if the absolute value of this variable goes above this threshold."/>
27 </when>
28 </conditional>
29 </repeat>
30 </xml>
31 <import>macros.xml</import> 11 <import>macros.xml</import>
32 </macros> 12 </macros>
33 <creator> 13 <creator>
34 <person givenName="Patrick" familyName="Austin" url="https://github.com/patrick-austin" identifier="https://orcid.org/0000-0002-6279-7823"/> 14 <person givenName="Patrick" familyName="Austin" url="https://github.com/patrick-austin" identifier="https://orcid.org/0000-0002-6279-7823"/>
35 </creator> 15 </creator>
43 <include type="literal" path="common.py"/> 23 <include type="literal" path="common.py"/>
44 </required_files> 24 </required_files>
45 <command detect_errors="exit_code"><![CDATA[ 25 <command detect_errors="exit_code"><![CDATA[
46 unzip '$feff_paths' 26 unzip '$feff_paths'
47 && mkdir report rmr chikr 27 && mkdir report rmr chikr
48 #if $execution.execution=="zipped": 28 #if $execution.execution=="series":
49 && unzip '$execution.prj_file' 29 #if $execution.format.format=="zipped":
50 && python '${__tool_directory__}/larch_artemis.py' prj '$gds_file' '$sp_file' '$inputs' 30 && unzip '$execution.format.prj_file'
31 && python '${__tool_directory__}/larch_artemis.py' prj '$gds_file' '$sp_file' '$inputs'
32 #else
33 && python '${__tool_directory__}/larch_artemis.py' '$execution.format.prj_file' '$gds_file' '$sp_file' '$inputs'
34 #end if
35 #elif $execution.execution=="simultaneous":
36 && python '${__tool_directory__}/larch_artemis.py' _ '$gds_file' '$sp_file' '$inputs'
51 #else 37 #else
52 && python '${__tool_directory__}/larch_artemis.py' '$execution.prj_file' '$gds_file' '$sp_file' '$inputs' 38 && python '${__tool_directory__}/larch_artemis.py' '$execution.prj_file' '$gds_file' '$sp_file' '$inputs'
53 #end if 39 #end if
54 #if $zip_outputs: 40 #if $zip_outputs:
55 && zip out_zip.zip report/* rmr/* chikr/* >/dev/null 41 && zip out_zip.zip report/* rmr/* chikr/* >/dev/null
56 #end if 42 #end if
57 ]]></command> 43 ]]></command>
58 <configfiles> 44 <configfiles>
59 <inputs name="inputs"/> 45 <inputs name="inputs" data_style="paths"/>
60 </configfiles> 46 </configfiles>
61 <inputs> 47 <inputs>
62 <conditional name="execution" > 48 <conditional name="execution">
63 <param name="execution" type="select" display="radio" label="Execution mode" help="Whether to execute: on individual Athena projects as parallel jobs, as one job with each project fit occurring in series, or as one job using a zipped input."> 49 <param name="execution" type="select" display="radio" label="Execution mode" help="Whether to execute: on individual Athena projects as parallel jobs, on several projects using a simultaneous fit, or as one job with each project fit occurring in series.">
64 <option value="parallel" selected="true">Parallel</option> 50 <option value="parallel" selected="true">Parallel</option>
51 <option value="simultaneous">Simultaneous</option>
65 <option value="series">Series</option> 52 <option value="series">Series</option>
66 <option value="zipped">Zipped</option>
67 </param> 53 </param>
68 <when value="parallel"> 54 <when value="parallel">
69 <param name="prj_file" type="data" format="prj" label="Athena project file" help="Normalised X-ray Absorption Fine Structure (XAFS) data, in Athena project format. If a collection of files is provided, these will be submitted and executed in parallel."/> 55 <param name="prj_file" type="data" format="prj" label="Athena project file" help="Normalised X-ray Absorption Fine Structure (XAFS) data, in Athena project format. If a collection of files is provided, these will be submitted and executed in parallel."/>
70 </when> 56 </when>
57 <when value="simultaneous">
58 <repeat name="simultaneous" title="Simultaneous datasets" min="1" default="1">
59 <param name="prj_file" type="data" format="prj" label="Athena project files" help="Normalised X-ray Absorption Fine Structure (XAFS) data, in Athena project format. These will be submitted as a single job performing a simultaneous fit."/>
60 <repeat name="paths" title="Path IDs to select" min="1" default="1">
61 <param name="path_id" type="integer" min="1" label="Path ID"/>
62 </repeat>
63 </repeat>
64 </when>
71 <when value="series"> 65 <when value="series">
72 <param name="prj_file" type="data" format="prj" multiple="true" label="Athena project files" help="Normalised X-ray Absorption Fine Structure (XAFS) data, in Athena project format. These will be submitted as a single job working in series, enabling early stopping criteria."/> 66 <conditional name="format">
73 <expand macro="series_options"/> 67 <param name="format" type="select" display="radio" label="Data format">
74 </when> 68 <option value="prj" selected="true">Athena projects (.prj)</option>
75 <when value="zipped"> 69 <option value="zipped">Zipped</option>
76 <param name="prj_file" type="data" format="zip" label="Zipped Athena outputs" help="Normalised X-ray Absorption Fine Structure (XAFS) data, in Athena project format, and zipped. These will be submitted as a single job working in series, enabling early stopping criteria."/> 70 </param>
77 <expand macro="series_options"/> 71 <when value="prj">
72 <param name="prj_file" type="data" format="prj" multiple="true" label="Athena project files" help="Normalised X-ray Absorption Fine Structure (XAFS) data, in Athena project format. These will be submitted as a single job working in series, enabling early stopping criteria."/>
73 </when>
74 <when value="zipped">
75 <param name="prj_file" type="data" format="zip" label="Zipped Athena outputs" help="Normalised X-ray Absorption Fine Structure (XAFS) data, in Athena project format, and zipped. These will be submitted as a single job working in series, enabling early stopping criteria."/>
76 </when>
77 </conditional>
78 <param name="stop_on_error" type="boolean" label="Stop on error" help="Whether to stop gracefully or continue with subsequent projects if an error is encountered when fitting."/>
79 <repeat name="report_criteria" title="Report Criteria">
80 <param name="variable" type="text" label="Variable" help="Name of the variable of that appears in the statistics or variables sections of the report."/>
81 <conditional name="action">
82 <param name="action" type="select" display="radio" label="Action" help="What to do with the named variable.">
83 <option value="log" selected="true">Log</option>
84 <option value="warn">Warn</option>
85 <option value="stop">Early stopping</option>
86 </param>
87 <when value="log"/>
88 <when value="warn">
89 <param name="threshold" type="float" value="0.0" min="0.0" label="Warning threshold" help="In addition to logging, a warning will be printed if the absolute value of this variable goes above this threshold."/>
90 </when>
91 <when value="stop">
92 <param name="threshold" type="float" value="0.0" min="0.0" label="Early stopping threshold" help="In addition to logging, execution will stop if the absolute value of this variable goes above this threshold."/>
93 </when>
94 </conditional>
95 </repeat>
78 </when> 96 </when>
79 </conditional> 97 </conditional>
80 <param name="feff_paths" type="data" format="zip" label="FEFF paths file" help="Zipped directory of the FEFF paths."/> 98 <param name="feff_paths" type="data" format="zip" label="FEFF paths file" help="Zipped directory of the FEFF paths."/>
81 <param name="gds_file" type="data" format="gds" label="GDS parameters file" help="File defining the fitting parameters as a `guess` (to be varied in the fit), `def` (defined by an expression evaluated throughout fitting) or `set` (evaluated at the start of fitting, then left unchanged)."/> 99 <param name="gds_file" type="data" format="gds" label="GDS parameters file" help="File defining the fitting parameters as a `guess` (to be varied in the fit), `def` (defined by an expression evaluated throughout fitting) or `set` (evaluated at the start of fitting, then left unchanged)."/>
82 <param name="sp_file" type="data" format="sp" label="SP parameters file" help="File defining the scattering paths."/> 100 <param name="sp_file" type="data" format="sp" label="SP parameters file" help="File defining the scattering paths."/>
108 <outputs> 126 <outputs>
109 <data name="out_zip" format="zip" from_work_dir="out_zip.zip" label="Zipped Artemis outputs on ${on_string}"> 127 <data name="out_zip" format="zip" from_work_dir="out_zip.zip" label="Zipped Artemis outputs on ${on_string}">
110 <filter>zip_outputs</filter> 128 <filter>zip_outputs</filter>
111 </data> 129 </data>
112 <data name="fit_report" format="feffit" from_work_dir="report/fit_report.txt" label="Fit report on ${on_string}"> 130 <data name="fit_report" format="feffit" from_work_dir="report/fit_report.txt" label="Fit report on ${on_string}">
113 <filter>execution["execution"]=="parallel"</filter> 131 <filter>execution["execution"]!="series"</filter>
114 <filter>not zip_outputs</filter> 132 <filter>not zip_outputs</filter>
115 </data> 133 </data>
116 <data name="rmr" format="png" from_work_dir="rmr/rmr.png" label="RMR plot on ${on_string}"> 134 <data name="rmr" format="png" from_work_dir="rmr/rmr.png" label="RMR plot on ${on_string}">
117 <filter>execution["execution"]=="parallel"</filter> 135 <filter>execution["execution"]!="series"</filter>
118 <filter>plot_graph</filter> 136 <filter>plot_graph</filter>
119 <filter>not zip_outputs</filter> 137 <filter>not zip_outputs</filter>
120 </data> 138 </data>
121 <data name="chikr" format="png" from_work_dir="chikr/chikr.png" label="ChiKR plot on ${on_string}"> 139 <data name="chikr" format="png" from_work_dir="chikr/chikr.png" label="ChiKR plot on ${on_string}">
122 <filter>execution["execution"]=="parallel"</filter> 140 <filter>execution["execution"]!="series"</filter>
123 <filter>plot_graph</filter> 141 <filter>plot_graph</filter>
124 <filter>not zip_outputs</filter> 142 <filter>not zip_outputs</filter>
125 </data> 143 </data>
126 <collection name="fit_report_collection" format="feffit" type="list" label="Fit reports on ${on_string}"> 144 <collection name="fit_report_collection" format="feffit" type="list" label="Fit reports on ${on_string}">
127 <discover_datasets pattern="__name_and_ext__" directory="report"/> 145 <discover_datasets pattern="__name_and_ext__" directory="report"/>
128 <filter>execution["execution"]!="parallel"</filter> 146 <filter>execution["execution"]=="series"</filter>
129 <filter>not zip_outputs</filter> 147 <filter>not zip_outputs</filter>
130 </collection> 148 </collection>
131 <collection name="rmr_collection" format="png" type="list" label="RMR plots on ${on_string}"> 149 <collection name="rmr_collection" format="png" type="list" label="RMR plots on ${on_string}">
132 <discover_datasets pattern="__name_and_ext__" directory="rmr"/> 150 <discover_datasets pattern="__name_and_ext__" directory="rmr"/>
133 <filter>execution["execution"]!="parallel"</filter> 151 <filter>execution["execution"]=="series"</filter>
134 <filter>plot_graph</filter> 152 <filter>plot_graph</filter>
135 <filter>not zip_outputs</filter> 153 <filter>not zip_outputs</filter>
136 </collection> 154 </collection>
137 <collection name="chikr_collection" format="png" type="list" label="ChiKR plots on ${on_string}"> 155 <collection name="chikr_collection" format="png" type="list" label="ChiKR plots on ${on_string}">
138 <discover_datasets pattern="__name_and_ext__" directory="chikr"/> 156 <discover_datasets pattern="__name_and_ext__" directory="chikr"/>
139 <filter>execution["execution"]!="parallel"</filter> 157 <filter>execution["execution"]=="series"</filter>
140 <filter>plot_graph</filter> 158 <filter>plot_graph</filter>
141 <filter>not zip_outputs</filter> 159 <filter>not zip_outputs</filter>
142 </collection> 160 </collection>
143 <data name="criteria_report" format="csv" from_work_dir="criteria_report.csv" label="Selected criteria from ${on_string}"> 161 <data name="criteria_report" format="csv" from_work_dir="criteria_report.csv" label="Selected criteria from ${on_string}">
144 <filter>execution["execution"]!="parallel"</filter> 162 <filter>execution["execution"]=="series"</filter>
145 <filter>len(execution["report_criteria"])>0</filter> 163 <filter>len(execution["report_criteria"])>0</filter>
146 </data> 164 </data>
147 </outputs> 165 </outputs>
148 <tests> 166 <tests>
149 <!-- Parallel, no plot --> 167 <!-- Parallel, no plot -->
180 <param name="rmax" value="3.0"/> 198 <param name="rmax" value="3.0"/>
181 <param name="plot_graph" value="true"/> 199 <param name="plot_graph" value="true"/>
182 <output name="fit_report" file="fit_report.txt" compare="re_match"/> 200 <output name="fit_report" file="fit_report.txt" compare="re_match"/>
183 <output name="rmr"> 201 <output name="rmr">
184 <assert_contents> 202 <assert_contents>
185 <has_size value="55000" delta="1000"/> 203 <has_size value="50000" delta="10000"/>
186 </assert_contents> 204 </assert_contents>
187 </output> 205 </output>
188 <output name="chikr"> 206 <output name="chikr">
189 <assert_contents> 207 <assert_contents>
190 <has_size value="65000" delta="1000"/> 208 <has_size value="70000" delta="10000"/>
191 </assert_contents> 209 </assert_contents>
192 </output> 210 </output>
193 </test> 211 </test>
194 <!-- Series, no plot --> 212 <!-- Series, no plot -->
195 <test expect_num_outputs="1"> 213 <test expect_num_outputs="1">
292 <output_collection name="fit_report_collection" type="list" count="1"/> 310 <output_collection name="fit_report_collection" type="list" count="1"/>
293 <output name="criteria_report" file="criteria_report.csv" compare="re_match"/> 311 <output name="criteria_report" file="criteria_report.csv" compare="re_match"/>
294 </test> 312 </test>
295 <!-- Zipped --> 313 <!-- Zipped -->
296 <test expect_num_outputs="1"> 314 <test expect_num_outputs="1">
297 <param name="execution" value="zipped"/> 315 <param name="execution" value="series"/>
316 <param name="format" value="zipped"/>
298 <param name="prj_file" value="test.zip"/> 317 <param name="prj_file" value="test.zip"/>
299 <param name="feff_paths" value="[FEFF_paths_of_test.inp].zip"/> 318 <param name="feff_paths" value="[FEFF_paths_of_test.inp].zip"/>
300 <param name="gds_file" value="gds.csv"/> 319 <param name="gds_file" value="gds.csv"/>
301 <param name="sp_file" value="sp.csv"/> 320 <param name="sp_file" value="sp.csv"/>
302 <param name="fitspace" value="r"/> 321 <param name="fitspace" value="r"/>
309 <param name="rmax" value="3.0"/> 328 <param name="rmax" value="3.0"/>
310 <param name="plot_graph" value="true"/> 329 <param name="plot_graph" value="true"/>
311 <param name="zip_outputs" value="true"/> 330 <param name="zip_outputs" value="true"/>
312 <output name="out_zip"> 331 <output name="out_zip">
313 <assert_contents> 332 <assert_contents>
314 <has_size value="230000" delta="500"/> 333 <has_size value="250000" delta="10000"/>
315 </assert_contents> 334 </assert_contents>
316 </output> 335 </output>
317 </test> 336 </test>
318 <!-- 7: Zipped numerical sort --> 337 <!-- 7: Zipped numerical sort -->
319 <test expect_num_outputs="2"> 338 <test expect_num_outputs="2">
320 <param name="execution" value="zipped"/> 339 <param name="execution" value="series"/>
340 <param name="format" value="zipped"/>
321 <param name="prj_file" value="numeric_sort.zip"/> 341 <param name="prj_file" value="numeric_sort.zip"/>
322 <param name="variable" value="rfactor"/> 342 <param name="variable" value="rfactor"/>
323 <param name="action" value="log"/> 343 <param name="action" value="log"/>
324 <param name="feff_paths" value="[FEFF_paths_of_test.inp].zip"/> 344 <param name="feff_paths" value="[FEFF_paths_of_test.inp].zip"/>
325 <param name="gds_file" value="gds.csv"/> 345 <param name="gds_file" value="gds.csv"/>
332 <param name="window" value="hanning"/> 352 <param name="window" value="hanning"/>
333 <param name="rmin" value="1.4"/> 353 <param name="rmin" value="1.4"/>
334 <param name="rmax" value="3.0"/> 354 <param name="rmax" value="3.0"/>
335 <output_collection name="fit_report_collection" type="list" count="3"/> 355 <output_collection name="fit_report_collection" type="list" count="3"/>
336 <output name="criteria_report" file="numeric_sort_criteria_report.csv" compare="re_match"/> 356 <output name="criteria_report" file="numeric_sort_criteria_report.csv" compare="re_match"/>
357 </test>
358 <!-- 8: Simultaneous -->
359 <test expect_num_outputs="1">
360 <param name="execution" value="simultaneous"/>
361 <repeat name="simultaneous">
362 <param name="prj_file" value="test.prj"/>
363 <repeat name="paths">
364 <param name="path_id" value="1"/>
365 <param name="path_id" value="2"/>
366 <param name="path_id" value="3"/>
367 <param name="path_id" value="4"/>
368 </repeat>
369 </repeat>
370 <repeat name="simultaneous">
371 <param name="prj_file" value="test.prj"/>
372 <repeat name="paths">
373 <param name="path_id" value="1"/>
374 <param name="path_id" value="2"/>
375 <param name="path_id" value="3"/>
376 <param name="path_id" value="4"/>
377 </repeat>
378 </repeat>
379 <param name="feff_paths" value="[FEFF_paths_of_test.inp].zip"/>
380 <param name="gds_file" value="gds.csv"/>
381 <param name="sp_file" value="sp.csv"/>
382 <param name="fitspace" value="r"/>
383 <param name="kmin" value="3"/>
384 <param name="kmax" value="14"/>
385 <param name="kweight" value="2"/>
386 <param name="dk" value="1"/>
387 <param name="window" value="hanning"/>
388 <param name="rmin" value="1.4"/>
389 <param name="rmax" value="3.0"/>
390 <output name="fit_report" file="fit_report.txt" compare="re_match"/>
337 </test> 391 </test>
338 </tests> 392 </tests>
339 <help><![CDATA[ 393 <help><![CDATA[
340 Using Larch, perform fitting on an Athena project file, originally from the input X-ray Absorption Fine Structure (XAFS) data file. 394 Using Larch, perform fitting on an Athena project file, originally from the input X-ray Absorption Fine Structure (XAFS) data file.
341 395