comparison muspinsim.xml @ 2:136ed45d1ea9 draft

planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit 4f06b404d8b7fb83995f3052faa7e2ec7811f507
author muon-spectroscopy-computational-project
date Fri, 03 Feb 2023 15:39:01 +0000
parents b30217097125
children e002cee8f707
comparison
equal deleted inserted replaced
1:b30217097125 2:136ed45d1ea9
1 <tool id="muspinsim" name="MuSpinSim Simulate" version="@TOOL_VERSION@+galaxy@WRAPPER_VERSION@" python_template_version="3.5" profile="22.01"> 1 <tool id="muspinsim" name="MuSpinSim Simulate" version="@TOOL_VERSION@+galaxy@WRAPPER_VERSION@" python_template_version="3.5" profile="22.05" license="MIT">
2 <description>perform spin dynamics calculations for muon science experiments</description> 2 <description>perform spin dynamics calculations for muon science experiments</description>
3 <macros> 3 <macros>
4 <!-- version of underlying tool (PEP 440) --> 4 <!-- version of underlying tool (PEP 440) -->
5 <token name="@TOOL_VERSION@">1.1.0</token> 5 <token name="@TOOL_VERSION@">2.0.2</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 <token name="@TOOL_CITATION@">
11 @software{muspinsim, 11 @software{muspinsim,
12 author = {Sturniolo, Simone and Liborio, Leandro and Owen, Josh and Mudaraddi, Anish and {Muon Spectroscopy Computational Project}}, 12 author = {Sturniolo, Simone and Liborio, Leandro and Owen, Josh and Mudaraddi, Anish and Davies, Joel and Wilkinson, John and {Muon Spectroscopy Computational Project}},
13 license = {MIT}, 13 license = {MIT},
14 title = {{muspinsim}}, 14 title = {{muspinsim}},
15 url = {https://github.com/muon-spectroscopy-computational-project/muspinsim}, 15 url = {https://github.com/muon-spectroscopy-computational-project/muspinsim},
16 version = {v1.1.0}, 16 version = {v2.0.2},
17 month = {5}, 17 month = {1},
18 year = {2022}, 18 year = {2023}
19 doi = {10.5281/zenodo.6563074} 19 doi = {10.5281/zenodo.7568830}
20 } 20 }
21 </token> 21 </token>
22 </macros> 22 </macros>
23 <creator> 23 <creator>
24 <person givenName="Anish" familyName="Mudaraddi" identifier="https://orcid.org/0000-0002-2135-2705"/> 24 <person givenName="Anish" familyName="Mudaraddi" identifier="https://orcid.org/0000-0002-2135-2705"/>
25 <person givenName="Eli" familyName="Chadwick" url="https://github.com/elichad" identifier="https://orcid.org/0000-0002-0035-6475"/> 25 <person givenName="Eli" familyName="Chadwick" url="https://github.com/elichad" identifier="https://orcid.org/0000-0002-0035-6475"/>
26 <person givenName="Joel" familyName="Davies" url="https://github.com/joelvdavies" identifier="https://orcid.org/0000-0002-4153-6819"/>
26 <organization url="https://muon-spectroscopy-computational-project.github.io/index.html" name="The Muon Spectroscopy Computational Project"/> 27 <organization url="https://muon-spectroscopy-computational-project.github.io/index.html" name="The Muon Spectroscopy Computational Project"/>
27 </creator> 28 </creator>
28 <requirements> 29 <requirements>
29 <requirement type="package" version="@TOOL_VERSION@">muspinsim</requirement> 30 <requirement type="package" version="@TOOL_VERSION@">muspinsim</requirement>
30 </requirements> 31 </requirements>
31 <command detect_errors="exit_code"><![CDATA[ 32 <command detect_errors="exit_code"><![CDATA[
32 ## remove spaces in names 33 ## remove spaces in names
33 mu_sim_name=\$(sed 's/ //g' <<< "$mu_sim.name") && 34 mu_sim_name=\$(sed 's/ //g' <<< '$mu_sim.name') &&
35 ## input file name without extension
36 mu_in_name=\${mu_sim_name%.*} &&
34 ## create links 37 ## create links
35 ln -s $mu_sim \$mu_sim_name && 38 ln -s '$mu_sim' \$mu_sim_name &&
36 ## grab 'name' field from input file, if it doesn't exist, set name as 'muspinsim' 39 ## grab 'name' field from input file, if it doesn't exist, set name as 'muspinsim'
37 mu_out=\$(grep -A1 '^name' \$mu_sim_name | grep -v 'name' | sed -e 's/^[ \t]*//') && 40 mu_out=\$(grep -A1 '^name' \$mu_sim_name | grep -v 'name' | sed -e 's/^[ \t]*//') &&
38 fitreport_out=\${mu_out:-"fitting_data"}_fitreport.txt && 41 fit_report_out=\${mu_in_name:-"fitting_data"}_fit_report.txt &&
39 mu_out=\${mu_out:-"muspinsim"} && 42 mu_out=\${mu_out:-"muspinsim"} &&
40 log_out=\$(echo \$mu_sim_name | cut -d '.' -f1).log && 43 log_out=\$(echo \$mu_sim_name | cut -d '.' -f1).log &&
41 ## if fitting data required, check if fitting data exists 44 ## if fitting data required, check if fitting data exists
42 ## create symlink and change filepath in input file to point to symlink 45 ## create symlink and change filepath in input file to point to symlink
43 if grep '^fitting_data' $mu_sim; then 46 if grep '^fitting_data' '$mu_sim'; then
44 if [[ '$mu_exp_in.name' != 'None' ]]; then 47 if [[ '$mu_exp_in.name' != 'None' ]]; then
45 mu_exp_in_name=\$(sed 's/ //g' <<< "$mu_exp_in.name") && 48 mu_exp_in_name=\$(sed 's/ //g' <<< '$mu_exp_in.name') &&
46 ln -s $mu_exp_in \$mu_exp_in_name && 49 ln -s '$mu_exp_in' \$mu_exp_in_name &&
47 sed -iE "/^fitting_data/{n;s/([^)]*)/(\"\$mu_exp_in_name\")/g}" \$mu_sim_name; 50 sed -iE "/^fitting_data/{n;s/([^)]*)/(\"\$mu_exp_in_name\")/g}" \$mu_sim_name;
48 else 51 else
49 echo "fitting data required, but no experiment data given" && exit 64; 52 echo "Fitting data required, but no experiment data given" && exit 64;
50 fi; 53 fi;
51 fi && 54 fi &&
52 muspinsim \$mu_sim_name && 55 muspinsim \$mu_sim_name &&
53 mkdir data && 56 mkdir data &&
54 mv \$mu_out*.dat data && 57 mv \$mu_out*.dat data &&
55 if test -f \$fitreport_out; then mv -f \$fitreport_out fit_report.txt; fi && 58 if test -f \$fit_report_out; then mv -f \$fit_report_out fit_report.txt; fi &&
56 mv \$log_out log_out.log 59 mv \$log_out log_out.log
57 ]]></command> 60 ]]></command>
58 <inputs> 61 <inputs>
59 <param type="data" name="mu_sim" format="txt" label="Configuration file containing simulation parameters"/> 62 <param type="data" name="mu_sim" format="txt" label="Configuration file containing simulation parameters"/>
60 <param type="data" name="mu_exp_in" format="txt" optional="true" label="Experiment data to fit (.dat) (Optional)" help="Only required if the 'fitting_data' parameter is set in the configuration file above."/> 63 <param type="data" name="mu_exp_in" format="txt" optional="true" label="Experiment data to fit (.dat) (Optional)" help="Only required if the 'fitting_data' parameter is set in the configuration file above."/>
72 <!-- log files have a timestamp on each line, and .dat files vary by machine 75 <!-- log files have a timestamp on each line, and .dat files vary by machine
73 so use compare="re_match" or "contains" with some generalised test files --> 76 so use compare="re_match" or "contains" with some generalised test files -->
74 <test expect_num_outputs="2"> 77 <test expect_num_outputs="2">
75 <param name="mu_sim" value="hfine.in" ftype="txt"/> 78 <param name="mu_sim" value="hfine.in" ftype="txt"/>
76 <output_collection name="muspinsim_results" type="list"> 79 <output_collection name="muspinsim_results" type="list">
77 <element name="hfine.dat" file="hfine.dat" ftype="txt" lines_diff="4"/> 80 <element name="hfine.dat" file="hfine.dat" ftype="txt" compare="re_match"/>
78 </output_collection> 81 </output_collection>
79 <output name="log_out" file="hfine.log" ftype="txt" compare="re_match"/> 82 <output name="log_out" file="hfine.log" ftype="txt" compare="re_match"/>
80 </test> 83 </test>
81 <test expect_num_outputs="2"> 84 <test expect_num_outputs="2">
82 <param name="mu_sim" value="hfine_powder.in" ftype="txt"/> 85 <param name="mu_sim" value="hfine_powder.in" ftype="txt"/>
87 </assert_contents> 90 </assert_contents>
88 </element> 91 </element>
89 </output_collection> 92 </output_collection>
90 <output name="log_out" file="hfine_powder.log" ftype="txt" compare="re_match"> 93 <output name="log_out" file="hfine_powder.log" ftype="txt" compare="re_match">
91 <assert_contents> 94 <assert_contents>
92 <has_size value="802"/> 95 <has_size value="803" delta="2"/>
93 </assert_contents> 96 </assert_contents>
94 </output> 97 </output>
98 </test>
99 <test expect_num_outputs="2">
100 <param name="mu_sim" value="celio.in" ftype="txt"/>
101 <output_collection name="muspinsim_results" type="list">
102 <element name="celio.dat" file="generic_out.dat" ftype="txt" compare="re_match_multiline"/>
103 </output_collection>
104 <output name="log_out" file="celio.log" ftype="txt" compare="re_match"/>
95 </test> 105 </test>
96 <test expect_num_outputs="3"> 106 <test expect_num_outputs="3">
97 <param name="mu_sim" value="fitting.in" ftype="txt"/> 107 <param name="mu_sim" value="fitting.in" ftype="txt"/>
98 <param name="mu_exp_in" value="fitting_input.dat" ftype="txt"/> 108 <param name="mu_exp_in" value="fitting_input.dat" ftype="txt"/>
99 <output_collection name="muspinsim_results" type="list"> 109 <output_collection name="muspinsim_results" type="list">
102 <output name="log_out" file="fitting.log" ftype="txt" compare="contains"> 112 <output name="log_out" file="fitting.log" ftype="txt" compare="contains">
103 <assert_contents> 113 <assert_contents>
104 <has_size value="17145"/> 114 <has_size value="17145"/>
105 </assert_contents> 115 </assert_contents>
106 </output> 116 </output>
107 <output name="fit_report" file="fitting_fitreport.txt" ftype="txt" lines_diff="4"/> 117 <output name="fit_report" file="fitting_fit_report.txt" ftype="txt" lines_diff="2"/>
108 </test> 118 </test>
109 <test expect_num_outputs="2"> 119 <test expect_num_outputs="2">
110 <param name="mu_sim" value="multi_out.in" ftype="txt"/> 120 <param name="mu_sim" value="multi_out.in" ftype="txt"/>
111 <output_collection name="muspinsim_results" type="list"> 121 <output_collection name="muspinsim_results" type="list">
112 <element name="multi_out_0_0.dat" file="multi_out_0_0.dat" ftype="txt" compare="re_match_multiline"> 122 <element name="multi_out_0_0.dat" file="multi_out_0_0.dat" ftype="txt" compare="re_match_multiline">