Mercurial > repos > muon-spectroscopy-computational-project > pm_uep_opt
comparison pm_uep_opt.xml @ 4:ec5f6b22417c draft
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
author | muon-spectroscopy-computational-project |
---|---|
date | Tue, 18 Jul 2023 13:27:15 +0000 |
parents | 523d44fcd03f |
children | eea73e1f65cb |
comparison
equal
deleted
inserted
replaced
3:523d44fcd03f | 4:ec5f6b22417c |
---|---|
1 <tool id="pm_uep_opt" name="PyMuonSuite AIRSS UEP Optimise" version="@TOOL_VERSION@+galaxy@WRAPPER_VERSION@" python_template_version="3.5" profile="22.05" license="MIT"> | 1 <tool id="pm_uep_opt" name="PyMuonSuite AIRSS UEP Optimise" version="@PYMUONSUITE_VERSION@+galaxy@WRAPPER_VERSION@" python_template_version="3.5" profile="22.05" license="MIT"> |
2 <description>run UEP optimisation</description> | 2 <description>run UEP optimisation</description> |
3 <macros> | 3 <macros> |
4 <!-- version of underlying tool (PEP 440) --> | |
5 <token name="@TOOL_VERSION@">0.2.3</token> | |
6 <!-- version of this tool wrapper (integer) --> | 4 <!-- version of this tool wrapper (integer) --> |
7 <token name="@WRAPPER_VERSION@">0</token> | 5 <token name="@WRAPPER_VERSION@">0</token> |
8 <!-- citation should be updated with every underlying tool version --> | 6 <import>muon_macros.xml</import> |
9 <!-- typical fields to update are version, month, year, and doi --> | |
10 <token name="@TOOL_CITATION@"> | |
11 @software{Sturniolo_pymuon-suite_2022, | |
12 author = {Sturniolo, Simone and Liborio, Leandro and Chadwick, Eli and Murgatroyd, Laura and Laverack, Adam and Mudaraddi, Anish and {Muon Spectroscopy Computational Project}}, | |
13 license = {GPL-3.0}, | |
14 month = {8}, | |
15 title = {{pymuon-suite}}, | |
16 url = {https://github.com/muon-spectroscopy-computational-project/pymuon-suite}, | |
17 version = {v0.2.3}, | |
18 doi = {10.5281/zenodo.7025644}, | |
19 year = {2022} | |
20 } | |
21 </token> | |
22 </macros> | 7 </macros> |
23 <creator> | 8 <creator> |
24 <person givenName="Jyothish" familyName="Thomas" identifier="https://orcid.org/0000-0003-4724-6924"/> | 9 <person givenName="Jyothish" familyName="Thomas" identifier="https://orcid.org/0000-0003-4724-6924"/> |
25 <person givenName="Eli" familyName="Chadwick" url="https://github.com/elichad" identifier="https://orcid.org/0000-0002-0035-6475"/> | 10 <person givenName="Eli" familyName="Chadwick" url="https://github.com/elichad" identifier="https://orcid.org/0000-0002-0035-6475"/> |
11 <person givenName="Patrick" familyName="Austin" url="https://github.com/patrick-austin" identifier="https://orcid.org/0000-0002-6279-7823"/> | |
26 <organization url="https://muon-spectroscopy-computational-project.github.io/index.html" name="The Muon Spectroscopy Computational Project"/> | 12 <organization url="https://muon-spectroscopy-computational-project.github.io/index.html" name="The Muon Spectroscopy Computational Project"/> |
27 </creator> | 13 </creator> |
28 <requirements> | 14 <requirements> |
29 <requirement type="package" version="@TOOL_VERSION@">pymuonsuite</requirement> | 15 <requirement type="package" version="@PYMUONSUITE_VERSION@">pymuonsuite</requirement> |
30 <requirement type="package" version="3.0">zip</requirement> | 16 <requirement type="package" version="3.0">zip</requirement> |
31 </requirements> | 17 </requirements> |
32 <required_files> | 18 <required_files> |
33 <include type="literal" path="run.sh"/> | 19 <include type="literal" path="run.sh"/> |
34 <include type="literal" path="get_out_folder.py"/> | 20 <include type="literal" path="get_out_folder.py"/> |
35 </required_files> | 21 </required_files> |
36 <command detect_errors="exit_code"><![CDATA[ | 22 <command detect_errors="exit_code"><![CDATA[ |
37 unzip '$muonated_structures' && | 23 cat $params_yaml > params.yaml && |
38 if test -f "params.yaml"; then echo "params.yaml present"; else echo "params.yaml missing" && exit 64; fi && | 24 structure_name_internal='input_structure.$structure.ext' && |
39 if ( test -f input_structure.* ) ; then echo "input structure present"; else echo "input structure missing" && exit 64; fi && | 25 ln -s '$structure' \$structure_name_internal && |
40 ## PyMuonSuite will attempt to load '<chden_seed>.den_fmt' and | 26 pm-muairss -t w \$structure_name_internal params.yaml && |
41 ## '<chden_seed>.castep', but $charge_density.name may or may not end | 27 #if $generation_params.allpos_ext != "none": |
42 ## with '.den_fmt' so strip any extension and manually include 'den_fmt' | 28 mv allpos.$generation_params.allpos_ext $allpos_file && |
43 ## and '.castep' in the linked file names | 29 #end if |
44 charge_density_name=\$(sed 's/ //g' <<< '$charge_density.name') && | 30 ln -s '$charge_density' input_structure.den_fmt && |
45 charge_density_seed=\${charge_density_name%%.*} && | 31 ln -s '$castep_log' input_structure.castep && |
46 echo "Calculated seed name \$charge_density_seed" && | |
47 ln -s '$charge_density' \$charge_density_seed.den_fmt && | |
48 ln -s '$castep_log' \$charge_density_seed.castep && | |
49 out_folder="`python '${__tool_directory__}/get_out_folder.py'`" && | 32 out_folder="`python '${__tool_directory__}/get_out_folder.py'`" && |
50 find \$out_folder -type f -name "*.yaml" | xargs sed -i "s#^chden_path: .*#chden_path: .\/#g" && | 33 find \$out_folder -type f -name "*.yaml" | xargs sed -i "s#^chden_path: .*#chden_path: .\/#g" && |
51 find \$out_folder -type f -name "*.yaml" | xargs sed -i "s#^chden_seed: .*#chden_seed: \$charge_density_seed#g" && | 34 find \$out_folder -type f -name "*.yaml" | xargs sed -i "s#^chden_seed: .*#chden_seed: input_structure#g" && |
52 bash '${__tool_directory__}/run.sh' \$out_folder && | 35 bash '${__tool_directory__}/run.sh' \$out_folder && |
53 zip -r out_zip.zip \$out_folder params.yaml input_structure.* && | 36 zip -r out_zip.zip \$out_folder params.yaml \$structure_name_internal && |
54 find \$out_folder > tree.txt | 37 find \$out_folder > tree.txt |
55 ]]></command> | 38 ]]></command> |
39 <configfiles> | |
40 <configfile name="params_yaml">poisson_r: $generation_params.poisson_r | |
41 vdw_scale: $generation_params.vdw_scale | |
42 #if $generation_params.random_seed: | |
43 random_seed: $generation_params.random_seed | |
44 #end if | |
45 #if $generation_params.allpos_ext!="none": | |
46 allpos_filename: allpos.$generation_params.allpos_ext | |
47 #end if | |
48 calculator: uep | |
49 charged: true | |
50 geom_steps: $optimisation_params.geom_steps | |
51 geom_force_tol: $optimisation_params.geom_force_tol | |
52 uep_gw_factor: $optimisation_params.uep_gw_factor</configfile> | |
53 </configfiles> | |
56 <inputs> | 54 <inputs> |
57 <param type="data" name="muonated_structures" label="Muonated structures (.zip)" format="zip" help="A zip folder containing muonated structures, as generated by the 'Generate muonated structures' tool or pm-muairss."/> | 55 <param type="data" name="structure" label="Structure file" format="cell, cif, extxyz" help="The structure to add muons to. The original file will be preserved. Accepted file types: CELL, CIF, XYZ (extended only)."/> |
58 <param type="data" name="charge_density" label="Charge density file (.den_fmt)" format="den_fmt" help="The charge density file created by CASTEP during your initial DFT simulation for the structure."/> | 56 <param type="data" name="charge_density" label="Charge density file (.den_fmt)" format="den_fmt" help="The charge density file created by CASTEP during your initial DFT simulation for the structure."/> |
59 <param type="data" name="castep_log" label="CASTEP log (.castep)" format="castep" help="The CASTEP log for your initial DFT simulation for the structure."/> | 57 <param type="data" name="castep_log" label="CASTEP log (.castep)" format="castep" help="The CASTEP log for your initial DFT simulation for the structure."/> |
58 <section name="generation_params" expanded="true" title="Generation Parameters"> | |
59 <param type="float" argument="poisson_r" value="0.8" min="0.0" label="Poisson radius" help=" Poisson sphere radius to use for random generation. No two starting muon positions will be closer than this distance. Smaller values make for bigger structure sets."/> | |
60 <param type="float" argument="vdw_scale" value="0.5" min="0.0" label="Van der Waals scale" help="Van der Waals scaling factor to use when generating muon sites to avoid existing atoms. Smaller values will allow muons to get closer to the other ions."/> | |
61 <param type="integer" argument="random_seed" label="Random Seed" optional="true" help="Seed used to randomise the positions of the muons in the generated structures."/> | |
62 <param type="select" name="allpos_ext" value="none" label="Format for file containing all muon positions (optional)" help="If set, generates an extra output file containing all the muon positions using the specified file type."> | |
63 <option value="none">Do not generate</option> | |
64 <option value="cell">CELL</option> | |
65 <option value="cif">CIF</option> | |
66 <option value="xyz">XYZ</option> | |
67 </param> | |
68 </section> | |
69 <section name="optimisation_params" expanded="true" title="Optimisation Parameters"> | |
70 <param type="integer" argument="geom_steps" value="30" min="0" label="Geometry optimization steps" help="Maximum number of geometry optimisation steps."/> | |
71 <param type="float" argument="geom_force_tol" value="0.05" min="0.0" label="Geometry optimization tolerance" help="Tolerance on geometry optimisation in units of eV/Å."/> | |
72 <param type="float" argument="uep_gw_factor" optional="true" value="5.0" min="0.0" label="Gaussian width factor" help="Gaussian width factor for UEP calculation. Higher values will make the potential of atomic nuclei closer to the point-like approximation but may introduce artifacts."/> | |
73 </section> | |
60 <param type="hidden" name="testing" label="Test mode" value="false"/> | 74 <param type="hidden" name="testing" label="Test mode" value="false"/> |
61 </inputs> | 75 </inputs> |
62 <outputs> | 76 <outputs> |
63 <data label="UEP results for $muonated_structures.name" name="uep_results" format="zip" from_work_dir="out_zip.zip"/> | 77 <data name="uep_results" format="zip" from_work_dir="out_zip.zip"/> |
78 <data label="File containing the positions of all muon sites" name="allpos_file" auto_format="true"> | |
79 <filter>(generation_params["allpos_ext"] != "none")</filter> | |
80 </data> | |
64 <data label="File tree (testing only)" name="file_tree" format="txt" from_work_dir="tree.txt" hidden="true"> | 81 <data label="File tree (testing only)" name="file_tree" format="txt" from_work_dir="tree.txt" hidden="true"> |
65 <filter>(testing == "true")</filter> | 82 <filter>(testing == "true")</filter> |
66 </data> | 83 </data> |
67 </outputs> | 84 </outputs> |
68 <tests> | 85 <tests> |
69 <test expect_num_outputs="2"> | 86 <!-- UEP with CELL --> |
70 <param name="testing" value="true"/> | 87 <test expect_num_outputs="3"> |
71 <param name="muonated_structures" value="muonated.zip" ftype="zip"/> | 88 <param name="testing" value="true"/> |
72 <param name="charge_density" value="Si.den_fmt" ftype="den_fmt"/> | 89 <param name="structure" value="Si.cell" ftype="cell"/> |
73 <param name="castep_log" value="Si.castep" ftype="castep"/> | 90 <param name="charge_density" value="Si.den_fmt" ftype="den_fmt"/> |
74 <output name="file_tree" file="tree.txt" ftype="txt" sort="true"> | 91 <param name="castep_log" value="Si.castep" ftype="castep"/> |
75 <assert_contents> | 92 <section name="generation_params"> |
76 <has_size value="1780"/> | 93 <param name="poisson_r" value="1.18"/> |
77 </assert_contents> | 94 <param name="vdw_scale" value="0.25"/> |
78 </output> | 95 <param name="random_seed" value="7357"/> |
79 </test> | 96 <param name="allpos_ext" value="cell"/> |
80 <test expect_num_outputs="2"> | 97 </section> |
81 <param name="testing" value="true"/> | 98 <section name="optimisation_params"> |
82 <param name="muonated_structures" value="muonated-default-folder.zip" ftype="zip"/> | 99 <param name="geom_steps" value="300"/> |
83 <param name="charge_density" value="Si.den_fmt" ftype="den_fmt"/> | 100 <param name="uep_gw_factor" value="4.0"/> |
84 <param name="castep_log" value="Si.castep" ftype="castep"/> | 101 </section> |
85 <output name="file_tree" file="tree-default-folder.txt" sort="true"/> | 102 <output name="allpos_file" file="allpos.cell"/> |
86 </test> | 103 <output name="file_tree" file="tree.txt" ftype="txt" sort="true"> |
104 <assert_contents> | |
105 <has_size value="3280"/> | |
106 </assert_contents> | |
107 </output> | |
108 </test> | |
109 <!-- UEP with XYZ --> | |
87 <test expect_failure="true"> | 110 <test expect_failure="true"> |
88 <param name="testing" value="true"/> | 111 <param name="testing" value="true"/> |
89 <param name="muonated_structures" value="muonated-default-folder.zip" ftype="zip"/> | 112 <param name="structure" value="Si.xyz" ftype="xyz"/> |
113 <param name="charge_density" value="Si.den_fmt" ftype="den_fmt"/> | |
114 <param name="castep_log" value="Si.castep" ftype="castep"/> | |
115 <section name="generation_params"> | |
116 <param name="poisson_r" value="1.18"/> | |
117 <param name="vdw_scale" value="0.25"/> | |
118 <param name="random_seed" value="7357"/> | |
119 </section> | |
120 <section name="optimisation_params"> | |
121 <param name="geom_steps" value="300"/> | |
122 <param name="uep_gw_factor" value="4.0"/> | |
123 </section> | |
124 <assert_stderr> | |
125 <has_text text="TypeError: cannot unpack non-iterable NoneType object"/> | |
126 </assert_stderr> | |
127 </test> | |
128 <!-- UEP with extended XYZ --> | |
129 <test expect_num_outputs="3"> | |
130 <param name="testing" value="true"/> | |
131 <param name="structure" value="Si.extxyz" ftype="extxyz"/> | |
132 <param name="charge_density" value="Si.den_fmt" ftype="den_fmt"/> | |
133 <param name="castep_log" value="Si.castep" ftype="castep"/> | |
134 <section name="generation_params"> | |
135 <param name="poisson_r" value="1.18"/> | |
136 <param name="vdw_scale" value="0.25"/> | |
137 <param name="random_seed" value="7357"/> | |
138 <param name="allpos_ext" value="xyz"/> | |
139 </section> | |
140 <section name="optimisation_params"> | |
141 <param name="geom_steps" value="300"/> | |
142 <param name="uep_gw_factor" value="4.0"/> | |
143 </section> | |
144 <output name="allpos_file" file="allpos.xyz"/> | |
145 <output name="file_tree" file="tree.txt" ftype="txt" sort="true"> | |
146 <assert_contents> | |
147 <has_size value="3280"/> | |
148 </assert_contents> | |
149 </output> | |
150 </test> | |
151 <!-- UEP with CIF --> | |
152 <test expect_num_outputs="3"> | |
153 <param name="testing" value="true"/> | |
154 <param name="structure" value="Si.cif" ftype="cif"/> | |
155 <param name="charge_density" value="Si.den_fmt" ftype="den_fmt"/> | |
156 <param name="castep_log" value="Si.castep" ftype="castep"/> | |
157 <section name="generation_params"> | |
158 <param name="poisson_r" value="1.18"/> | |
159 <param name="vdw_scale" value="0.25"/> | |
160 <param name="random_seed" value="7357"/> | |
161 <param name="allpos_ext" value="cif"/> | |
162 </section> | |
163 <section name="optimisation_params"> | |
164 <param name="geom_steps" value="300"/> | |
165 <param name="uep_gw_factor" value="4.0"/> | |
166 </section> | |
167 <output name="allpos_file" file="allpos.cif"/> | |
168 <output name="file_tree" file="tree.txt" ftype="txt" sort="true"> | |
169 <assert_contents> | |
170 <has_size value="3280"/> | |
171 </assert_contents> | |
172 </output> | |
173 </test> | |
174 <!-- Expect total failure for badly formatted den_fmt --> | |
175 <test expect_failure="true"> | |
176 <param name="testing" value="true"/> | |
177 <param name="structure" value="Si.cell" ftype="cell"/> | |
90 <param name="castep_log" value="Si.castep" ftype="castep"/> | 178 <param name="castep_log" value="Si.castep" ftype="castep"/> |
91 <param name="charge_density" value="Sifail.den_fmt" ftype="den_fmt"/> | 179 <param name="charge_density" value="Sifail.den_fmt" ftype="den_fmt"/> |
92 <assert_stderr> | 180 <assert_stderr> |
93 <has_text text="Error: FMT file has no header"/> | 181 <has_text text="Error: FMT file has no header"/> |
182 <has_text text="ERROR: All optimisations failed"/> | |
94 </assert_stderr> | 183 </assert_stderr> |
95 </test> | 184 </test> |
96 <!-- check that file_tree filter works --> | 185 <!-- check that file_tree filter works --> |
97 <test expect_num_outputs="1"> | 186 <test expect_num_outputs="1"> |
98 <param name="testing" value="false"/> | 187 <param name="testing" value="false"/> |
99 <param name="muonated_structures" value="muonated.zip" ftype="zip"/> | 188 <param name="structure" value="Si.cell" ftype="cell"/> |
100 <param name="charge_density" value="Si.den_fmt" ftype="den_fmt"/> | 189 <param name="charge_density" value="Si.den_fmt" ftype="den_fmt"/> |
101 <param name="castep_log" value="Si.castep" ftype="castep"/> | 190 <param name="castep_log" value="Si.castep" ftype="castep"/> |
191 <section name="generation_params"> | |
192 <param name="poisson_r" value="1.18"/> | |
193 <param name="vdw_scale" value="0.25"/> | |
194 <param name="random_seed" value="7357"/> | |
195 </section> | |
196 <section name="optimisation_params"> | |
197 <param name="geom_steps" value="300"/> | |
198 <param name="uep_gw_factor" value="4.0"/> | |
199 </section> | |
102 </test> | 200 </test> |
103 <!-- Check that the chden parameters are set correctly when $charge_density.name does not have the .den_fmt extension --> | 201 <!-- Check that the chden parameters are set correctly when $charge_density.name does not have the .den_fmt extension --> |
104 <test expect_num_outputs="2"> | 202 <test expect_num_outputs="2"> |
105 <param name="testing" value="true"/> | 203 <param name="testing" value="true"/> |
106 <param name="muonated_structures" value="muonated.zip" ftype="zip"/> | 204 <param name="structure" value="Si.cell" ftype="cell"/> |
107 <param name="charge_density" value="Si_den_fmt" ftype="den_fmt"/> | 205 <param name="charge_density" value="Si_den_fmt" ftype="den_fmt"/> |
108 <param name="castep_log" value="Si.castep" ftype="castep"/> | 206 <param name="castep_log" value="Si.castep" ftype="castep"/> |
109 <output name="file_tree" file="tree.txt" ftype="txt" sort="true"> | 207 <section name="generation_params"> |
110 <assert_contents> | 208 <param name="poisson_r" value="1.18"/> |
111 <has_size value="1780"/> | 209 <param name="vdw_scale" value="0.25"/> |
210 <param name="random_seed" value="7357"/> | |
211 </section> | |
212 <section name="optimisation_params"> | |
213 <param name="geom_steps" value="300"/> | |
214 <param name="uep_gw_factor" value="4.0"/> | |
215 </section> | |
216 <output name="file_tree" file="tree.txt" ftype="txt" sort="true"> | |
217 <assert_contents> | |
218 <has_size value="3280"/> | |
112 </assert_contents> | 219 </assert_contents> |
113 </output> | 220 </output> |
114 </test> | 221 </test> |
115 </tests> | 222 </tests> |
116 <help><![CDATA[ | 223 <help><![CDATA[ |
117 Given a set of input muonated structures (structures containing a muon), applies UEP optimisation to refine them. | 224 Given an input structure, this tool generates a set of duplicate structures, |
118 | 225 each with a single muon added in a random location. |
119 This tool requires CASTEP inputs for the UEP method, meaning your initial DFT simulation must have been done with CASTEP. | 226 These are known as "muonated" structures. |
120 The structure you used as input to the '`Generate muonated structures`_' tool or pm-muairss beforehand should come from the same simulation run. | 227 Following this, UEP optimisation is used to refine the positions of the muons. |
121 | 228 |
122 Command-line usage: pm-uep-opt [-h] [-t {r,w}] structures parameter_file | 229 This tool requires CASTEP inputs in order to perform the UEP method, |
123 | 230 meaning your initial DFT simulation must have been done with CASTEP. |
124 .. _Generate muonated structures: /tool_runner?tool_id=pm_muairss_write | 231 This simulation should have used the same structure as is used here. |
125 | 232 |
126 PyMuonSuite is distributed under the GPLv3 license. This tool wrapper is distributed under the MIT license. | 233 Following this, the individual refined positions can be clustered to |
234 represent potential stopping sites by using '`PyMuonSuite AIRSS Cluster`_'. | |
235 | |
236 Command-line usage (generation): pm-muairss [-h] -t w structures parameter_file | |
237 | |
238 Command-line usage (optimisation): pm-uep-opt [-h] parameter_file | |
239 | |
240 .. _PyMuonSuite AIRSS Cluster: /tool_runner?tool_id=pm_muairss_read | |
241 | |
242 PyMuonSuite is distributed under the GPLv3 license. | |
243 This tool wrapper is distributed under the MIT license. | |
127 ]]></help> | 244 ]]></help> |
128 <citations> | 245 <citations> |
129 <citation type="bibtex"> | 246 <citation type="doi">@PYMUONSUITE_CITATION@</citation> |
130 @TOOL_CITATION@ | |
131 </citation> | |
132 <citation type="doi">10.1063/1.5024450</citation> | 247 <citation type="doi">10.1063/1.5024450</citation> |
133 <citation type="doi">10.1063/1.5085197</citation> | 248 <citation type="doi">10.1063/1.5085197</citation> |
134 <citation type="doi">10.1063/5.0012381</citation> | 249 <citation type="doi">10.1063/5.0012381</citation> |
135 <citation type="bibtex"> | 250 <citation type="bibtex"> |
136 @article {castep, | 251 @article {castep, |