Mercurial > repos > muon-spectroscopy-computational-project > muspinsim
comparison muspinsim.xml @ 0:64e6816a6727 draft
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
author | muon-spectroscopy-computational-project |
---|---|
date | Thu, 25 Aug 2022 16:16:19 +0000 |
parents | |
children | b30217097125 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:64e6816a6727 |
---|---|
1 <tool id="muspinsim" name="MuSpinSim Simulate" version="@TOOL_VERSION@+galaxy@WRAPPER_VERSION@" python_template_version="3.5" profile="22.01"> | |
2 <description>perform spin dynamics calculations for muon science experiments</description> | |
3 <macros> | |
4 <!-- version of underlying tool (PEP 440) --> | |
5 <token name="@TOOL_VERSION@">1.1.0</token> | |
6 <!-- version of this tool wrapper (integer) --> | |
7 <token name="@WRAPPER_VERSION@">1</token> | |
8 <!-- citation should be updated with every underlying tool version --> | |
9 <!-- typical fields to update are version, month, year, and doi --> | |
10 <token name="@TOOL_CITATION@"> | |
11 @software{muspinsim, | |
12 author = {Sturniolo, Simone and Liborio, Leandro and Owen, Josh and Mudaraddi, Anish and {Muon Spectroscopy Computational Project}}, | |
13 license = {MIT}, | |
14 title = {{muspinsim}}, | |
15 url = {https://github.com/muon-spectroscopy-computational-project/muspinsim}, | |
16 version = {v1.1.0}, | |
17 month = {5}, | |
18 year = {2022}, | |
19 doi = {10.5281/zenodo.6563074} | |
20 } | |
21 </token> | |
22 </macros> | |
23 <creator> | |
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"/> | |
26 <organization url="https://muon-spectroscopy-computational-project.github.io/index.html" name="The Muon Spectroscopy Computational Project"/> | |
27 </creator> | |
28 <requirements> | |
29 <requirement type="package" version="@TOOL_VERSION@">muspinsim</requirement> | |
30 </requirements> | |
31 <command detect_errors="exit_code"><![CDATA[ | |
32 ## remove spaces in names | |
33 mu_sim_name=\$(sed 's/ //g' <<< "$mu_sim.name") && | |
34 ## create links | |
35 ln -s $mu_sim \$mu_sim_name && | |
36 ## 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]*//') && | |
38 fitreport_out=\${mu_out:-"fitting_data"}_fitreport.txt && | |
39 mu_out=\${mu_out:-"muspinsim"} && | |
40 log_out=\$(echo \$mu_sim_name | cut -d '.' -f1).log && | |
41 ## if fitting data required, check if fitting data exists | |
42 ## create symlink and change filepath in input file to point to symlink | |
43 if grep '^fitting_data' $mu_sim; then | |
44 if [[ '$mu_exp_in.name' != 'None' ]]; then | |
45 mu_exp_in_name=\$(sed 's/ //g' <<< "$mu_exp_in.name") && | |
46 ln -s $mu_exp_in \$mu_exp_in_name && | |
47 sed -iE "/^fitting_data/{n;s/([^)]*)/(\"\$mu_exp_in_name\")/g}" \$mu_sim_name; | |
48 else | |
49 echo "fitting data required, but no experiment data given" && exit 64; | |
50 fi; | |
51 fi && | |
52 muspinsim \$mu_sim_name && | |
53 mkdir data && | |
54 mv \$mu_out*.dat data && | |
55 if test -f \$fitreport_out; then mv -f \$fitreport_out fit_report.txt; fi && | |
56 mv \$log_out log_out.log | |
57 ]]></command> | |
58 <inputs> | |
59 <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."/> | |
61 </inputs> | |
62 <outputs> | |
63 <collection name="muspinsim_results" type="list" label="Muspinsim output collection"> | |
64 <discover_datasets pattern="__name__" directory="data" format="txt"/> | |
65 </collection> | |
66 <data label="muspinsim log for $mu_sim.name" name="log_out" format="txt" from_work_dir="log_out.log"/> | |
67 <data label="fit report for $mu_sim.name" name="fit_report" format="txt" from_work_dir="fit_report.txt"> | |
68 <filter>mu_exp_in</filter> | |
69 </data> | |
70 </outputs> | |
71 <tests> | |
72 <!-- 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 --> | |
74 <test> | |
75 <param name="mu_sim" value="hfine.in" ftype="txt"/> | |
76 <output_collection name="muspinsim_results" type="list"> | |
77 <element name="hfine.dat" file="hfine.dat" ftype="txt" lines_diff="4"/> | |
78 </output_collection> | |
79 <output name="log_out" file="hfine.log" ftype="txt" compare="re_match"/> | |
80 </test> | |
81 <test> | |
82 <param name="mu_sim" value="hfine_powder.in" ftype="txt"/> | |
83 <output_collection name="muspinsim_results" type="list"> | |
84 <element name="muspinsim.dat" file="generic_out.dat" ftype="txt" compare="re_match_multiline"> | |
85 <assert_contents> | |
86 <has_size value="5100" delta="100"/> | |
87 </assert_contents> | |
88 </element> | |
89 </output_collection> | |
90 <output name="log_out" file="hfine_powder.log" ftype="txt" compare="re_match"> | |
91 <assert_contents> | |
92 <has_size value="802"/> | |
93 </assert_contents> | |
94 </output> | |
95 </test> | |
96 <test> | |
97 <param name="mu_sim" value="fitting.in" ftype="txt"/> | |
98 <param name="mu_exp_in" value="fitting_input.dat" ftype="txt"/> | |
99 <output_collection name="muspinsim_results" type="list"> | |
100 <element name="fitting_data.dat" file="fitting_data.dat" ftype="txt" lines_diff="4"/> | |
101 </output_collection> | |
102 <output name="log_out" file="fitting.log" ftype="txt" compare="contains"> | |
103 <assert_contents> | |
104 <has_size value="17145"/> | |
105 </assert_contents> | |
106 </output> | |
107 <output name="fit_report" file="fitting_fitreport.txt" ftype="txt" lines_diff="4"/> | |
108 </test> | |
109 <test> | |
110 <param name="mu_sim" value="multi_out.in" ftype="txt"/> | |
111 <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"> | |
113 <assert_contents> | |
114 <has_size value="1164" delta="100"/> | |
115 </assert_contents> | |
116 </element> | |
117 <element name="multi_out_0_1.dat" file="multi_out_0_1.dat" ftype="txt" compare="re_match_multiline"> | |
118 <assert_contents> | |
119 <has_size value="1164" delta="100"/> | |
120 </assert_contents> | |
121 </element> | |
122 <element name="multi_out_1_0.dat" file="multi_out_1_0.dat" ftype="txt" compare="re_match_multiline"> | |
123 <assert_contents> | |
124 <has_size value="1164" delta="100"/> | |
125 </assert_contents> | |
126 </element> | |
127 <element name="multi_out_1_1.dat" file="multi_out_1_1.dat" ftype="txt" compare="re_match_multiline"> | |
128 <assert_contents> | |
129 <has_size value="1164" delta="100"/> | |
130 </assert_contents> | |
131 </element> | |
132 </output_collection> | |
133 <output name="log_out" file="multi_out.log" ftype="txt" compare="re_match"/> | |
134 </test> | |
135 </tests> | |
136 <help><![CDATA[ | |
137 MuSpinSim is a program designed to carry out spin dynamics calculations. | |
138 | |
139 Tool requires an input (.in) file which describes system and experiment details. | |
140 This is a text file containing keywords and values in indented blocks. | |
141 | |
142 Full documentation: https://muon-spectroscopy-computational-project.github.io/muspinsim/ | |
143 | |
144 Command-line usage: muspinsim muspinsim.in | |
145 ]]></help> | |
146 <citations> | |
147 <citation type="bibtex"> | |
148 @TOOL_CITATION@ | |
149 </citation> | |
150 </citations> | |
151 </tool> |