comparison larch_athena.xml @ 2:a1e26990131c draft

planemo upload for repository https://github.com/MaterialsGalaxy/larch-tools/tree/main/larch_athena commit 0f66842e802430e887d1c6cb7be1cc5436408fd2
author muon-spectroscopy-computational-project
date Mon, 04 Mar 2024 11:43:19 +0000
parents 2b3115342fef
children 82e9dd980916
comparison
equal deleted inserted replaced
1:2b3115342fef 2:a1e26990131c
1 <tool id="larch_athena" name="Larch Athena" version="@TOOL_VERSION@+galaxy@WRAPPER_VERSION@" python_template_version="3.5" profile="22.05" license="MIT"> 1 <tool id="larch_athena" name="Larch Athena" version="@TOOL_VERSION@+galaxy@WRAPPER_VERSION@" python_template_version="3.5" profile="22.05" license="MIT">
2 <description>generate Athena projects from XAFS data</description> 2 <description>generate Athena 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.71</token> 5 <token name="@TOOL_VERSION@">0.9.74</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="format"> 11 <xml name="format">
12 <param name="format" type="select" display="radio" label="Input format" help="Whether data is in plaintext or already saved as an Athena project"> 12 <param name="format" type="select" display="radio" label="Input format" help="Whether data is in plaintext or already saved as an Athena project">
118 </when> 118 </when>
119 </conditional> 119 </conditional>
120 <expand macro="columns"/> 120 <expand macro="columns"/>
121 </when> 121 </when>
122 <when value="athena"> 122 <when value="athena">
123 <param name="dat_file" type="data" format="prj" multiple="true" label="Athena project" help="X-ray Absorption Spectroscopy (XAS) data, which will be merged, in Athena project format"/> 123 <param name="dat_file" type="data" format="prj" multiple="true" label="Athena project" help="X-ray Absorption Spectroscopy (XAS) data, which will be merged, in Athena project format. Note that when merging Athena groups, background parameters set in file will be lost, and automatic default used unless defined below."/>
124 <expand macro="extract_group"/> 124 <expand macro="extract_group"/>
125 </when> 125 </when>
126 </conditional> 126 </conditional>
127 </when> 127 </when>
128 </conditional> 128 </conditional>
149 <when value=""/> 149 <when value=""/>
150 <when value="true"> 150 <when value="true">
151 <param argument="e0" type="float" label="Edge energy (eV)" optional="true" help="If set, normalization will use this as the location of the edge rather than automatically determining it."/> 151 <param argument="e0" type="float" label="Edge energy (eV)" optional="true" help="If set, normalization will use this as the location of the edge rather than automatically determining it."/>
152 <param argument="pre1" type="float" max="0" label="Pre-edge fit lower energy (eV)" optional="true" help="The lower end of the region used for the pre-edge fitting, relative to the edge energy (and therefore negative)."/> 152 <param argument="pre1" type="float" max="0" label="Pre-edge fit lower energy (eV)" optional="true" help="The lower end of the region used for the pre-edge fitting, relative to the edge energy (and therefore negative)."/>
153 <param argument="pre2" type="float" max="0" label="Pre-edge fit upper energy (eV)" optional="true" help="The upper end of the region used for the pre-edge fitting, relative to the edge energy (and therefore negative)."/> 153 <param argument="pre2" type="float" max="0" label="Pre-edge fit upper energy (eV)" optional="true" help="The upper end of the region used for the pre-edge fitting, relative to the edge energy (and therefore negative)."/>
154 <param argument="norm1" type="float" min="0" label="Post-edge fit lower energy (eV)" optional="true" help="The lower end of the region used for the post-edge fitting, relative to the edge energy (and therefore positive)."/>
155 <param argument="norm2" type="float" min="0" label="Post-edge fit upper energy (eV)" optional="true" help="The upper end of the region used for the post-edge fitting, relative to the edge energy (and therefore positive)."/>
156 <param argument="nnorm" type="integer" min="0" max="5" label="Post-edge fit polynomial degree" optional="true" help="The degree of the polynomial used to fit in the post-edge region."/>
157 <param argument="step" type="float" min="0" label="Edge step" optional="true" help="Magnitude of the step in μ between the pre and post-edge regions at the edge energy."/>
154 <param argument="nvict" type="integer" label="Energy exponent" optional="true" help="Edge fitting will be performed against μ*E**n where n is defined here. This is 0 by default."/> 158 <param argument="nvict" type="integer" label="Energy exponent" optional="true" help="Edge fitting will be performed against μ*E**n where n is defined here. This is 0 by default."/>
155 </when> 159 </when>
156 </conditional> 160 </conditional>
157 <conditional name="xftf"> 161 <conditional name="xftf">
158 <param name="xftf" type="select" label="XFTF" help="If set, will (re)perform forward Fourier Transform using provided values."> 162 <param name="xftf" type="select" label="XFTF" help="If set, will (re)perform forward Fourier Transform using provided values.">
185 <filter>zip_outputs</filter> 189 <filter>zip_outputs</filter>
186 </data> 190 </data>
187 <!-- Single outputs of different types if merging, or not using a zip --> 191 <!-- Single outputs of different types if merging, or not using a zip -->
188 <data name="athena_project_file" format="prj" from_work_dir="prj/out.prj" label="Athena project ${annotation} ${on_string}"> 192 <data name="athena_project_file" format="prj" from_work_dir="prj/out.prj" label="Athena project ${annotation} ${on_string}">
189 <filter>not zip_outputs</filter> 193 <filter>not zip_outputs</filter>
190 <filter>not (merge_inputs["merge_inputs"] == "" and (merge_inputs["format"]["format"] == "plaintext" and merge_inputs["format"]["is_zipped"]["is_zipped"]) or (merge_inputs["format"]["format"] == "athena" and merge_inputs["format"]["extract_group"]["extract_group"] != "single"))</filter> 194 <filter>not (merge_inputs["merge_inputs"] == "" and ((merge_inputs["format"]["format"] == "plaintext" and merge_inputs["format"]["is_zipped"]["is_zipped"]) or (merge_inputs["format"]["format"] == "athena" and merge_inputs["format"]["extract_group"]["extract_group"] != "single")))</filter>
191 </data> 195 </data>
192 <data name="edge_plot" format="png" from_work_dir="edge/out.png" label="Edge fitting ${annotation} ${on_string}"> 196 <data name="edge_plot" format="png" from_work_dir="edge/out.png" label="Edge fitting ${annotation} ${on_string}">
193 <filter>plot_graph</filter> 197 <filter>plot_graph</filter>
194 <filter>not zip_outputs</filter> 198 <filter>not zip_outputs</filter>
195 <filter>not (merge_inputs["merge_inputs"] == "" and (merge_inputs["format"]["format"] == "plaintext" and merge_inputs["format"]["is_zipped"]["is_zipped"]) or (merge_inputs["format"]["format"] == "athena" and merge_inputs["format"]["extract_group"]["extract_group"] != "single"))</filter> 199 <filter>not (merge_inputs["merge_inputs"] == "" and ((merge_inputs["format"]["format"] == "plaintext" and merge_inputs["format"]["is_zipped"]["is_zipped"]) or (merge_inputs["format"]["format"] == "athena" and merge_inputs["format"]["extract_group"]["extract_group"] != "single")))</filter>
196 </data> 200 </data>
197 <data name="flat_plot" format="png" from_work_dir="flat/out.png" label="Flattened plot ${annotation} ${on_string}"> 201 <data name="flat_plot" format="png" from_work_dir="flat/out.png" label="Flattened plot ${annotation} ${on_string}">
198 <filter>plot_graph</filter> 202 <filter>plot_graph</filter>
199 <filter>not zip_outputs</filter> 203 <filter>not zip_outputs</filter>
200 <filter>not (merge_inputs["merge_inputs"] == "" and (merge_inputs["format"]["format"] == "plaintext" and merge_inputs["format"]["is_zipped"]["is_zipped"]) or (merge_inputs["format"]["format"] == "athena" and merge_inputs["format"]["extract_group"]["extract_group"] != "single"))</filter> 204 <filter>not (merge_inputs["merge_inputs"] == "" and ((merge_inputs["format"]["format"] == "plaintext" and merge_inputs["format"]["is_zipped"]["is_zipped"]) or (merge_inputs["format"]["format"] == "athena" and merge_inputs["format"]["extract_group"]["extract_group"] != "single")))</filter>
201 </data> 205 </data>
202 <data name="derivative_plot" format="png" from_work_dir="derivative/out.png" label="Derivative plot ${annotation} ${on_string}"> 206 <data name="derivative_plot" format="png" from_work_dir="derivative/out.png" label="Derivative plot ${annotation} ${on_string}">
203 <filter>plot_graph</filter> 207 <filter>plot_graph</filter>
204 <filter>not zip_outputs</filter> 208 <filter>not zip_outputs</filter>
205 <filter>not (merge_inputs["merge_inputs"] == "" and (merge_inputs["format"]["format"] == "plaintext" and merge_inputs["format"]["is_zipped"]["is_zipped"]) or (merge_inputs["format"]["format"] == "athena" and merge_inputs["format"]["extract_group"]["extract_group"] != "single"))</filter> 209 <filter>not (merge_inputs["merge_inputs"] == "" and ((merge_inputs["format"]["format"] == "plaintext" and merge_inputs["format"]["is_zipped"]["is_zipped"]) or (merge_inputs["format"]["format"] == "athena" and merge_inputs["format"]["extract_group"]["extract_group"] != "single")))</filter>
206 </data> 210 </data>
207 <!-- Directories of outputs if using single, non-merged zip as input or extracting multiple/all Athena groups --> 211 <!-- Directories of outputs if using single, non-merged zip as input or extracting multiple/all Athena groups -->
208 <collection name="athena_project_file_collection" format="prj" type="list" label="Athena projects ${annotation} ${on_string}"> 212 <collection name="athena_project_file_collection" format="prj" type="list" label="Athena projects ${annotation} ${on_string}">
209 <discover_datasets pattern="__name_and_ext__" directory="prj"/> 213 <discover_datasets pattern="__name_and_ext__" directory="prj"/>
210 <filter>not zip_outputs</filter> 214 <filter>not zip_outputs</filter>
211 <filter>merge_inputs["merge_inputs"] == "" and (merge_inputs["format"]["format"] == "plaintext" and merge_inputs["format"]["is_zipped"]["is_zipped"]) or (merge_inputs["format"]["format"] == "athena" and merge_inputs["format"]["extract_group"]["extract_group"] != "single")</filter> 215 <filter>merge_inputs["merge_inputs"] == "" and ((merge_inputs["format"]["format"] == "plaintext" and merge_inputs["format"]["is_zipped"]["is_zipped"]) or (merge_inputs["format"]["format"] == "athena" and merge_inputs["format"]["extract_group"]["extract_group"] != "single"))</filter>
212 </collection> 216 </collection>
213 <collection name="edge_plot_collection" format="png" type="list" label="Edge fittings ${annotation} ${on_string}"> 217 <collection name="edge_plot_collection" format="png" type="list" label="Edge fittings ${annotation} ${on_string}">
214 <discover_datasets pattern="__name_and_ext__" directory="edge"/> 218 <discover_datasets pattern="__name_and_ext__" directory="edge"/>
215 <filter>plot_graph</filter> 219 <filter>plot_graph</filter>
216 <filter>not zip_outputs</filter> 220 <filter>not zip_outputs</filter>
217 <filter>merge_inputs["merge_inputs"] == "" and (merge_inputs["format"]["format"] == "plaintext" and merge_inputs["format"]["is_zipped"]["is_zipped"]) or (merge_inputs["format"]["format"] == "athena" and merge_inputs["format"]["extract_group"]["extract_group"] != "single")</filter> 221 <filter>merge_inputs["merge_inputs"] == "" and ((merge_inputs["format"]["format"] == "plaintext" and merge_inputs["format"]["is_zipped"]["is_zipped"]) or (merge_inputs["format"]["format"] == "athena" and merge_inputs["format"]["extract_group"]["extract_group"] != "single"))</filter>
218 </collection> 222 </collection>
219 <collection name="flat_plot_collection" format="png" type="list" label="Flattened plots ${annotation} ${on_string}"> 223 <collection name="flat_plot_collection" format="png" type="list" label="Flattened plots ${annotation} ${on_string}">
220 <discover_datasets pattern="__name_and_ext__" directory="flat"/> 224 <discover_datasets pattern="__name_and_ext__" directory="flat"/>
221 <filter>plot_graph</filter> 225 <filter>plot_graph</filter>
222 <filter>not zip_outputs</filter> 226 <filter>not zip_outputs</filter>
223 <filter>merge_inputs["merge_inputs"] == "" and (merge_inputs["format"]["format"] == "plaintext" and merge_inputs["format"]["is_zipped"]["is_zipped"]) or (merge_inputs["format"]["format"] == "athena" and merge_inputs["format"]["extract_group"]["extract_group"] != "single")</filter> 227 <filter>merge_inputs["merge_inputs"] == "" and ((merge_inputs["format"]["format"] == "plaintext" and merge_inputs["format"]["is_zipped"]["is_zipped"]) or (merge_inputs["format"]["format"] == "athena" and merge_inputs["format"]["extract_group"]["extract_group"] != "single"))</filter>
224 </collection> 228 </collection>
225 <collection name="derivative_plot_collection" format="png" type="list" label="Derivative plots ${annotation} ${on_string}"> 229 <collection name="derivative_plot_collection" format="png" type="list" label="Derivative plots ${annotation} ${on_string}">
226 <discover_datasets pattern="__name_and_ext__" directory="derivative"/> 230 <discover_datasets pattern="__name_and_ext__" directory="derivative"/>
227 <filter>plot_graph</filter> 231 <filter>plot_graph</filter>
228 <filter>not zip_outputs</filter> 232 <filter>not zip_outputs</filter>
229 <filter>merge_inputs["merge_inputs"] == "" and (merge_inputs["format"]["format"] == "plaintext" and merge_inputs["format"]["is_zipped"]["is_zipped"]) or (merge_inputs["format"]["format"] == "athena" and merge_inputs["format"]["extract_group"]["extract_group"] != "single")</filter> 233 <filter>merge_inputs["merge_inputs"] == "" and ((merge_inputs["format"]["format"] == "plaintext" and merge_inputs["format"]["is_zipped"]["is_zipped"]) or (merge_inputs["format"]["format"] == "athena" and merge_inputs["format"]["extract_group"]["extract_group"] != "single"))</filter>
230 </collection> 234 </collection>
231 </outputs> 235 </outputs>
232 <tests> 236 <tests>
233 <!-- 1 --> 237 <!-- 1 -->
234 <test expect_num_outputs="1"> 238 <test expect_num_outputs="1">
235 <param name="dat_file" value="test.xmu"/> 239 <param name="dat_file" value="test.xmu"/>
236 <output name="athena_project_file"> 240 <output name="athena_project_file">
237 <assert_contents> 241 <assert_contents>
238 <has_size value="5405" delta="10"/> 242 <has_size value="5400" delta="100"/>
239 </assert_contents> 243 </assert_contents>
240 </output> 244 </output>
241 </test> 245 </test>
242 <!-- 2 --> 246 <!-- 2 -->
243 <test expect_num_outputs="1"> 247 <test expect_num_outputs="1">
385 <assert_contents> 389 <assert_contents>
386 <has_size value="18000" delta="50"/> 390 <has_size value="18000" delta="50"/>
387 </assert_contents> 391 </assert_contents>
388 </output> 392 </output>
389 </test> 393 </test>
390 <!-- 13 --> 394 <!-- 13: Test merging and plotting multiple prj inputs -->
395 <test expect_num_outputs="4">
396 <param name="merge_inputs" value="true"/>
397 <param name="format" value="athena"/>
398 <param name="dat_file" value="test.prj,test.prj"/>
399 <param name="plot_graph" value="true"/>
400 <output name="athena_project_file">
401 <assert_contents>
402 <has_size value="4500" delta="100"/>
403 </assert_contents>
404 </output>
405 <output name="edge_plot">
406 <assert_contents>
407 <has_size value="54200" delta="100"/>
408 </assert_contents>
409 </output>
410 <output name="flat_plot">
411 <assert_contents>
412 <has_size value="39400" delta="100"/>
413 </assert_contents>
414 </output>
415 <output name="derivative_plot">
416 <assert_contents>
417 <has_size value="41800" delta="100"/>
418 </assert_contents>
419 </output>
420 </test>
421 <!-- 14 -->
391 <test expect_num_outputs="1"> 422 <test expect_num_outputs="1">
392 <param name="format" value="athena"/> 423 <param name="format" value="athena"/>
393 <param name="dat_file" value="test.prj"/> 424 <param name="dat_file" value="test.prj"/>
394 <output name="athena_project_file"> 425 <output name="athena_project_file">
395 <assert_contents> 426 <assert_contents>
396 <has_size value="5400" delta="200"/> 427 <has_size value="5400" delta="200"/>
397 </assert_contents> 428 </assert_contents>
398 </output> 429 </output>
399 </test> 430 </test>
400 <!-- 14: Extract multiple groups from Athena .prj --> 431 <!-- 15: Extract multiple groups from Athena .prj -->
401 <test expect_num_outputs="1"> 432 <test expect_num_outputs="1">
402 <param name="format" value="athena"/> 433 <param name="format" value="athena"/>
403 <param name="extract_group" value="multiple"/> 434 <param name="extract_group" value="multiple"/>
404 <param name="group_name" value="merge"/> 435 <param name="group_name" value="merge"/>
405 <param name="group_name" value="d__Ref_PtSn_OC_MERGE_CALIBRATE"/> 436 <param name="group_name" value="d_Ref_PtSn_OC_MERGE_CALIBRATE"/>
406 <param name="dat_file" value="multiple.prj"/> 437 <param name="dat_file" value="multiple.prj"/>
407 <output_collection name="athena_project_file_collection" type="list" count="2"/> 438 <output_collection name="athena_project_file_collection" type="list" count="2"/>
408 </test> 439 </test>
409 <!-- 15: Extract all groups from Athena .prj --> 440 <!-- 16: Extract all groups from Athena .prj -->
410 <test expect_num_outputs="1"> 441 <test expect_num_outputs="1">
411 <param name="format" value="athena"/> 442 <param name="format" value="athena"/>
412 <param name="extract_group" value="all"/> 443 <param name="extract_group" value="all"/>
413 <param name="dat_file" value="multiple.prj"/> 444 <param name="dat_file" value="multiple.prj"/>
414 <output_collection name="athena_project_file_collection" type="list" count="9"/> 445 <output_collection name="athena_project_file_collection" type="list" count="9"/>
446 </test>
447 <!-- 17: Extract and merge all groups from Athena .prj -->
448 <test expect_num_outputs="1">
449 <param name="merge_inputs" value="true"/>
450 <param name="format" value="athena"/>
451 <param name="extract_group" value="all"/>
452 <param name="dat_file" value="multiple.prj"/>
453 <output name="athena_project_file">
454 <assert_contents>
455 <has_size value="26000" delta="100"/>
456 </assert_contents>
457 </output>
415 </test> 458 </test>
416 </tests> 459 </tests>
417 <help><![CDATA[ 460 <help><![CDATA[
418 Using Larch, create an Athena project file from the input X-ray Absorption Fine Structure (XAFS) data file. 461 Using Larch, create an Athena project file from the input X-ray Absorption Fine Structure (XAFS) data file.
419 462