comparison pm_nq.xml @ 0:16ef6bc73b17 draft

planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_nq commit 4f06b404d8b7fb83995f3052faa7e2ec7811f507
author muon-spectroscopy-computational-project
date Fri, 03 Feb 2023 15:39:49 +0000
parents
children f08b8c705e74
comparison
equal deleted inserted replaced
-1:000000000000 0:16ef6bc73b17
1 <tool id="pm_nq" name="PyMuonSuite Quantum Averaging" version="@TOOL_VERSION@+galaxy@WRAPPER_VERSION@" python_template_version="3.5" profile="22.05">
2 <description>generate and average displaced structures</description>
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) -->
7 <token name="@WRAPPER_VERSION@">0</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{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 <import>muon_macros.xml</import>
23 </macros>
24 <creator>
25 <person givenName="Patrick" familyName="Austin" url="https://github.com/patrick-austin"/>
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@">pymuonsuite</requirement>
30 <requirement type="package" version="1.0.0">euphonic</requirement>
31 <requirement type="package" version="3.0">zip</requirement>
32 </requirements>
33 <command detect_errors="exit_code"><![CDATA[
34 structure_name=\$(sed 's/ //g' <<< '$structure.name') &&
35 #if $task.task == 'write':
36 out_folder=\$(sed 's/.$structure.extension/_displaced/g' <<< '$structure.name') &&
37 ln -s '$structure' \$structure_name &&
38 #if $task.phonon.phonon.phonon_source_type == "castep":
39 phonon_source_file_name=\$(sed 's/ //g' <<< '$task.phonon.phonon.phonon_source_castep.name') &&
40 ln -s '$task.phonon.phonon.phonon_source_castep' \$phonon_source_file_name &&
41 castep_file_name=\$(sed 's/ //g' <<< '$task.phonon.phonon.castep_file.name') &&
42 ln -s '$task.phonon.phonon.castep_file' \$castep_file_name &&
43 #else if $task.phonon.phonon.phonon_source_type == "dftb+":
44 phonon_source_file_name=\$(sed 's/ //g' <<< '$task.phonon.phonon.phonon_source_dftb.name') &&
45 ln -s '$task.phonon.phonon.phonon_source_dftb' \$phonon_source_file_name &&
46 gen_file_name=\$(sed 's/ //g' <<< '$task.phonon.phonon.gen_file.name') &&
47 ln -s '$task.phonon.phonon.gen_file' \$gen_file_name &&
48 #end if
49 #if $task.calculator.script_file:
50 script_file_name=\$(sed 's/ //g' <<< '$task.calculator.script_file.name') &&
51 ln -s '$task.calculator.script_file' \$script_file_name &&
52 #end if
53 #if $task.calculator.calculator.calculator == 'castep' and $task.calculator.calculator.castep_param:
54 castep_param_name=\$(sed 's/ //g' <<< '$task.calculator.calculator.castep_param.name') &&
55 ln -s '$task.calculator.calculator.castep_param' \$castep_param_name &&
56 #end if
57 ln -s '$params_yaml' params.yaml &&
58 pm-nq -t w \$structure_name params.yaml &&
59 find * > tree.txt &&
60 zip -r out_zip.zip *
61 #else if $task.task == 'read':
62 unzip '$task.zipped_input' &&
63 pm-nq -t r \$structure_name params.yaml &&
64 cat averages.dat
65 #end if
66 ]]></command>
67 <configfiles>
68 <configfile name="params_yaml">#if $task.task == 'write':
69 method: $task.sampling.method.method
70 mu_symbol: $task.mu_symbol
71 mu_index: $task.mu_index
72 grid_n: $task.sampling.grid_n
73 sigma_n: $task.sampling.sigma_n
74 #set $k_points_grid_formatted = $task.calculator.k_points_grid.replace('__ob__', '[').replace('__cb__', ']')
75 k_points_grid: $k_points_grid_formatted
76 avgprop: $task.sampling.avgprop
77 calculator: $task.calculator.calculator.calculator
78 write_allconf: $task.write_allconf
79 displace_T: $task.sampling.displace_T
80 #if $task.sampling.average_T:
81 average_T: $task.sampling.average_T
82 #end if
83 #if $task.sampling.method.method == 'montecarlo' and $task.sampling.method.random_seed:
84 random_seed: $task.sampling.random_seed
85 #end if
86 #if $task.calculator.calculator.calculator == 'dftb+':
87 dftb_set: $task.calculator.calculator.dftb_set
88 dftb_pbc: $task.calculator.calculator.dftb_pbc
89 #end if
90 phonon_source_type: $task.phonon.phonon.phonon_source_type
91 #if $task.phonon.phonon.phonon_source_type == 'castep':
92 #set $phonon_source_file_name = $task.phonon.phonon.phonon_source_castep.name.replace(' ', '')
93 #else if $task.phonon.phonon.phonon_source_type == 'dftb+':
94 #set $phonon_source_file_name = $task.phonon.phonon.phonon_source_dftb.name.replace(' ', '')
95 #end if
96 phonon_source_file: $phonon_source_file_name
97 #if $task.calculator.script_file:
98 #set $script_file_name = $task.calculator.script_file.name.replace(' ', '')
99 script_file: $script_file_name
100 #end if
101 #if $task.calculator.calculator.calculator == 'castep' and $task.calculator.calculator.castep_param:
102 #set $castep_param_name = $task.calculator.calculator.castep_param.name.replace(' ', '')
103 castep_param: $castep_param_name
104 #end if
105 #end if</configfile>
106 </configfiles>
107 <inputs>
108 <param argument="structure" type="data" format="cell, cif, xyz, extxyz" label="Structure File" help="The muonated structure to make displacements to. The original file will be preserved. Accepted file types: CELL, CIF, XYZ (standard or extended)."/>
109 <conditional name="task">
110 <param argument="task" type="select" display="radio" label="Task" help="Task to perform with pm-nq. Either generate (write) displaced structures, or average (read) those structures.">
111 <option value="write">Generate</option>
112 <option value="read">Average</option>
113 </param>
114 <when value="write">
115 <param argument="mu_symbol" type="text" value="H:mu" label="Muon Symbol" help="Custom label that will be used to identify muon in the structure file."/>
116 <param argument="mu_index" type="integer" value="-1" label="Muon Index" help="If the Muon Symbol is not present in the cell, then the atom in the cell with this index will be treated as the muon instead. Not used if the Muon Symbol is present. Defaults to the last atom in the structure."/>
117 <section name="phonon" expanded="true" title="Phonon Source">
118 <conditional name="phonon">
119 <param argument="phonon_source_type" type="select" display="radio" label="Phonon Type" help="The format of the phonon file.">
120 <option value="castep">CASTEP</option>
121 <option value="dftb+">DFTB+</option>
122 </param>
123 <when value="castep">
124 <param name="phonon_source_castep" type="data" format="txt" label="Phonon File" help="Source file for phonon modes of the muonated structure."/>
125 <param name="castep_file" type="data" format="castep" label="CASTEP Log (.castep)" help="The CASTEP log produced when generating the Phonon File."/>
126 </when>
127 <when value="dftb+">
128 <param name="phonon_source_dftb" type="data" format="binary" label="Phonon File" help="Source file for phonon modes of the muonated structure."/>
129 <param name="gen_file" type="data" format="txt" label="Gen File" help="GEN formatted geometry file for DFTB+."/>
130 </when>
131 </conditional>
132 </section>
133 <section name="calculator" expanded="true" title="Calculator Settings">
134 <conditional name="calculator">
135 <param argument="calculator" type="select" display="radio" label="Calculator Type" help="Which software to use to calculate the property.">
136 <option value="castep">CASTEP</option>
137 <option value="dftb+">DFTB+</option>
138 </param>
139 <when value="castep">
140 <param argument="castep_param" type="data" format="txt" optional="true" label="Castep Parameters File" help="For convenience, this file is copied to all output directories (optional)."/>
141 </when>
142 <when value="dftb+">
143 <expand macro="dftb+"/>
144 </when>
145 </conditional>
146 <expand macro="k_points_grid"/>
147 <param argument="script_file" type="data" format="txt" optional="true" label="Script File" help="For convenience when running CASTEP or DFTB+, this script file is copied to all output directories. Occurences of {seedname} will be replaced according to the directory name for each job. (optional) "/>
148 </section>
149 <section name="sampling" expanded="true" title="Sampling Settings">
150 <param argument="avgprop" type="select" display="radio" label="Averaged Property" help="Property to be calculated.">
151 <option value="hyperfine">Hyperfine</option>
152 <option value="charge">Charge</option>
153 </param>
154 <param argument="displace_T" type="float" value="0" min="0" label="Displacement Temperature" help="Temperature used to generate displacements."/>
155 <param argument="average_T" type="float" optional="true" min="0" label="Averaging Temperature" help="Temperature used when averaging property (optional). If unset, will use the same value as Displacement Temperature."/>
156
157 <conditional name="method">
158 <param argument="method" type="select" display="radio" label="Method" help="Method used to calculate thermal average. Either displaces independently along the three most significant phonon modes (sampling a 3D grid of values) or uses Monte Carlo to randomly sample a fixed number of points from multiple modes at the same time.">
159 <option value="independent">Independent</option>
160 <option value="montecarlo">Monte Carlo</option>
161 </param>
162 <when value="independent"/>
163 <when value="montecarlo">
164 <param argument="random_seed" type="integer" optional="true" label="Random Seed" help="Seed to use for sampling Monte Carlo distribution."/>
165 </when>
166 </conditional>
167
168 <param argument="grid_n" type="integer" value="20" min="1" label="Grid Points" help="Number of points to sample along each phonon mode or thermal line."/>
169 <param argument="sigma_n" type="float" value="3" min="0" label="Sigma Number" help="Number of sigmas to sample in the harmonic approximation."/>
170 </section>
171 <param argument="write_allconf" type="boolean" label="Write All Configurations" help="Whether to write a 'collective' file containing all the displaced positions."/>
172 </when>
173 <when value="read">
174 <param name="zipped_input" type="data" format="zip" label="Zipped Input" help="A zipped directory structure containing the output of the generate mode, and the results of running CASTEP or DFTB+ to generate the desired property."/>
175 </when>
176 </conditional>
177 <param type="hidden" name="testing" label="Test mode" value="false"/>
178 </inputs>
179 <outputs>
180 <data label="Displaced Structures" name="displaced_structures" format="zip" from_work_dir="out_zip.zip">
181 <filter>(task['task'] == 'write')</filter>
182 </data>
183 <data label="File tree (testing only)" name="file_tree" format="txt" from_work_dir="tree.txt" hidden="true">
184 <filter>(task['task'] == 'write' and testing == 'true')</filter>
185 </data>
186 <data label="Averaged Property" name="averaged_property" format="txt" from_work_dir="averages.dat">
187 <filter>(task['task'] == 'read')</filter>
188 </data>
189 </outputs>
190 <tests>
191 <!-- Test CASTEP without default values -->
192 <test expect_num_outputs="2">
193 <param name="testing" value="true"/>
194 <param name="structure" value="Si.cell" ftype="cell"/>
195 <conditional name="task">
196 <param name="task" value="write"/>
197 <section name="phonon">
198 <conditional name="phonon">
199 <param name="phonon_source_castep" value="Si.phonon" ftype="txt"/>
200 <param name="castep_file" value="Si.castep"/>
201 </conditional>
202 </section>
203 <section name="calculator">
204 </section>
205 <section name="sampling">
206 </section>
207 </conditional>
208 <output name="file_tree" file="tree.txt" ftype="txt" sort="true"/>
209 </test>
210 <!-- Test CASTEP with optional extra files -->
211 <test expect_num_outputs="2">
212 <param name="testing" value="true"/>
213 <param name="structure" value="Si.cell" ftype="cell"/>
214 <conditional name="task">
215 <param name="task" value="write"/>
216 <section name="phonon">
217 <conditional name="phonon">
218 <param name="phonon_source_castep" value="Si.phonon" ftype="txt"/>
219 <param name="castep_file" value="Si.castep"/>
220 </conditional>
221 </section>
222 <section name="calculator">
223 <param name="script_file" value="submit.sh" ftype="txt"/>
224 <conditional name="calculator">
225 <param name="castep_param" value="Si.param"/>
226 </conditional>
227 </section>
228 <section name="sampling">
229 </section>
230 </conditional>
231 <output name="file_tree" file="tree_extra_files.txt" ftype="txt" sort="true"/>
232 </test>
233 <!-- Test DFTB+ -->
234 <test expect_num_outputs="2">
235 <param name="testing" value="true"/>
236 <param name="structure" value="ethyleneMu_opt.xyz" ftype="xyz"/>
237 <conditional name="task">
238 <param name="task" value="write"/>
239 <section name="phonon">
240 <conditional name="phonon">
241 <param name="phonon_source_type" value="dftb+"/>
242 <param name="phonon_source_dftb" value="ethyleneMu_opt.phonons.pkl" ftype="auto"/>
243 <param name="gen_file" value="geo_end.gen" ftype="txt"/>
244 </conditional>
245 </section>
246 <section name="calculator">
247 <conditional name="calculator">
248 <param name="calculator" value="dftb+"/>
249 </conditional>
250 </section>
251 <section name="sampling">
252 <conditional name="method">
253 <param name="method" value="montecarlo"/>
254 </conditional>
255 </section>
256 </conditional>
257 <output name="file_tree" file="tree_dftb.txt" ftype="txt" sort="true"/>
258 </test>
259 <!-- Test Read Task -->
260 <test expect_num_outputs="1">
261 <param name="structure" value="Si.cell" ftype="cell"/>
262 <conditional name="task">
263 <param name="task" value="read"/>
264 <param name="zipped_input" value="zipped_input.zip" ftype="zip"/>
265 </conditional>
266 <output name="averaged_property" file="averages.dat" ftype="txt"/>
267 </test>
268 </tests>
269 <help><![CDATA[
270 Given an input muonated structure (containing a muon), displaces the muon along its normal modes and performs vibrational averaging. There are three steps to using this tool:
271 1. Generate displaced structures with `-t w` (write) flag
272 2. Calculate the property for all displaced structures using CASTEP or DFTB+
273 3. Average the proprty across all displaced structures with `-t r` (read) flag
274
275 Note that currently only steps 1 and 3 are possible in Galaxy. In order to perform step 2, download the zipped output of step 1, run CASTEP/DFTB+ elsewhere, re-zip the directories including the output properties, and finally run step 3 using this zip file as the input.
276
277 Command-line usage: pm-nq [-h] [-t {r,w}] structure parameter_file
278
279 All data is licensed under the Creative Commons Attribution-ShareAlike 4.0
280 International License. The full text of the license can be found at:
281
282 https://creativecommons.org/licenses/by-sa/4.0/legalcode
283
284 For specific data sets remember to cite the following papers, by element :
285
286 | **3-ob-1**
287
288 +--------------+------------------------------------------------+-----------------------------------+------------------------------------+
289 | [JCTC2013] | \ J. Chem. Theory Comput., 2013, 9, 338-354. | (O, N, C, H) | https://doi.org/10.1021/ct300849w |
290 +--------------+------------------------------------------------+-----------------------------------+------------------------------------+
291 | [JCTC2014] | \ J. Chem. Theory Comput., 2014, 10, 1518-1537.| (P,S-\*) | https://doi.org/10.1021/ct401002w |
292 +--------------+------------------------------------------------+-----------------------------------+------------------------------------+
293 | [JCTC2015-1] | \ J. Phys. Chem. B, 2015, 119, 1062-1082. | (Mg,Zn-\*) | https://doi.org/10.1021/jp506557r |
294 +--------------+------------------------------------------------+-----------------------------------+------------------------------------+
295 | [JCTC2015-2] | \ J. Chem. Theory Comput., 2015, 11, 332-342. | (Na,F,K,Ca,Cl,Br,I-\*) | https://doi.org/10.1021/ct5009137 |
296 +--------------+------------------------------------------------+-----------------------------------+------------------------------------+
297
298 |
299 | **pbc-0-3**
300
301 +------------+--------------------------------------------------------------------------------------------+---------+------------------------------------------------+
302 | [SiC] | \ E. Rauls, R. Gutierrez, J. Elsner, and Th. Frauenheim, Sol. State Comm. 111, 459 (1999) | (Si-C) | https://doi.org/10.1016/S0038-1098(99)00137-4 |
303 +------------+--------------------------------------------------------------------------------------------+---------+------------------------------------------------+
304 | [SiO] | \ C. Koehler, Z. Hajnal, P. Deak, Th. Frauenheim, S. Suhai, Phys. Rev. B 64, 085333 (2001) | (Si-O) | https://doi.org/10.1103/PhysRevB.64.085333 |
305 +------------+--------------------------------------------------------------------------------------------+---------+------------------------------------------------+
306 | [Silicon] | \ A. Sieck, Th. Frauenheim, and K. A. Jackson, phys. stat. sol. (b) 240, 537 (2003). | (Si) | https://doi.org/10.1002/pssb.200301886 |
307 +------------+--------------------------------------------------------------------------------------------+---------+------------------------------------------------+
308 | [Fluorine] | \ C. Koehler and Th. Frauenheim, Surf. Sci. 600, 453 (2006). | \ (F) | https://doi.org/10.1016/j.susc.2005.10.044 |
309 +------------+--------------------------------------------------------------------------------------------+---------+------------------------------------------------+
310 | [Iron] | \ C. Koehler, G. Seifert and Th. Frauenheim, Chem. Phys. 309, 23 (2005). | (Fe) | https://doi.org/10.1016/j.chemphys.2004.03.034 |
311 +------------+--------------------------------------------------------------------------------------------+---------+------------------------------------------------+
312 | [SiSi] | \ A. Sieck, PhD. Thesis, University of Paderborn, 2000. | (Si-Si) | https://www.osti.gov/etdeweb/biblio/20249635 |
313 +------------+--------------------------------------------------------------------------------------------+---------+------------------------------------------------+
314
315 |
316 | The full sets and all other data can be found at the following URLs:
317
318 +----------+------------------------------------------------------------+
319 | 3-ob-1 | https://www.dftb.org/parameters/download/3ob/3ob-3-1-cc/ |
320 +----------+------------------------------------------------------------+
321 | pbc-0-3 | https://www.dftb.org/parameters/download/pbc/pbc-0-3-cc/ |
322 +----------+------------------------------------------------------------+
323
324 |
325 .. _Generate muonated structures: /tool_runner?tool_id=pm_muairss_write
326 ]]></help>
327 <citations>
328 <citation type="bibtex">
329 @TOOL_CITATION@
330 </citation>
331 </citations>
332 </tool>