diff pm_uep_opt.xml @ 3:523d44fcd03f draft

planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 4f06b404d8b7fb83995f3052faa7e2ec7811f507
author muon-spectroscopy-computational-project
date Fri, 03 Feb 2023 15:40:08 +0000
parents 8f41a71fc710
children ec5f6b22417c
line wrap: on
line diff
--- a/pm_uep_opt.xml	Thu Sep 15 10:25:47 2022 +0000
+++ b/pm_uep_opt.xml	Fri Feb 03 15:40:08 2023 +0000
@@ -1,22 +1,22 @@
-<tool id="pm_uep_opt" name="PyMuonSuite AIRSS UEP Optimise" version="@TOOL_VERSION@+galaxy@WRAPPER_VERSION@" python_template_version="3.5" profile="22.01">
+<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">
     <description>run UEP optimisation</description>
     <macros>
         <!-- version of underlying tool (PEP 440) -->
-        <token name="@TOOL_VERSION@">0.2.1</token>
+        <token name="@TOOL_VERSION@">0.2.3</token>
         <!-- version of this tool wrapper (integer) -->
-        <token name="@WRAPPER_VERSION@">1</token>
+        <token name="@WRAPPER_VERSION@">0</token>
         <!-- citation should be updated with every underlying tool version -->
         <!-- typical fields to update are version, month, year, and doi -->
         <token name="@TOOL_CITATION@">
-            @software{pymuon-suite,
-                author = {Sturniolo, Simone and Liborio, Leandro and Chadwick, Eli and Murgatroyd, Laura and Laverack, Adam and {Muon Spectroscopy Computational Project}},
+            @software{Sturniolo_pymuon-suite_2022,
+                author = {Sturniolo, Simone and Liborio, Leandro and Chadwick, Eli and Murgatroyd, Laura and Laverack, Adam and Mudaraddi, Anish and {Muon Spectroscopy Computational Project}},
                 license = {GPL-3.0},
+                month = {8},
                 title = {{pymuon-suite}},
                 url = {https://github.com/muon-spectroscopy-computational-project/pymuon-suite},
-                version = {v0.2.1},
-                month = {2},
-                year = {2022},
-                doi = {}
+                version = {v0.2.3},
+                doi = {10.5281/zenodo.7025644},
+                year = {2022}
             }
         </token>
     </macros>
@@ -34,25 +34,29 @@
         <include type="literal" path="get_out_folder.py"/>
     </required_files>
     <command detect_errors="exit_code"><![CDATA[
-        unzip "$muonated_structures" &&
+        unzip '$muonated_structures' &&
         if test -f "params.yaml"; then echo "params.yaml present"; else echo "params.yaml missing" && exit 64; fi &&
         if ( test -f input_structure.* ) ; then echo "input structure present"; else echo "input structure missing" && exit 64; fi &&
-        charge_density_name=\$(sed 's/ //g' <<< "$charge_density.name") &&
-        ln -s $charge_density \$charge_density_name &&
-        x="\$charge_density_name" &&
-        echo "calculated seed name \$x" &&
-        ln -s $castep_log "\${x%%.*}.castep" &&
-        out_folder="`python ${__tool_directory__}/get_out_folder.py`" &&
+        ## PyMuonSuite will attempt to load '<chden_seed>.den_fmt' and
+        ## '<chden_seed>.castep', but $charge_density.name may or may not end
+        ## with '.den_fmt' so strip any extension and manually include 'den_fmt'
+        ## and '.castep' in the linked file names
+        charge_density_name=\$(sed 's/ //g' <<< '$charge_density.name') &&
+        charge_density_seed=\${charge_density_name%%.*} &&
+        echo "Calculated seed name \$charge_density_seed" &&
+        ln -s '$charge_density' \$charge_density_seed.den_fmt && 
+        ln -s '$castep_log' \$charge_density_seed.castep &&
+        out_folder="`python '${__tool_directory__}/get_out_folder.py'`" &&
         find \$out_folder -type f -name "*.yaml" | xargs sed -i "s#^chden_path: .*#chden_path: .\/#g" &&
-        find \$out_folder -type f -name "*.yaml" | xargs sed -i "s#^chden_seed: .*#chden_seed: \${x%%.*}#g" &&
-        bash ${__tool_directory__}/run.sh \$out_folder &&
+        find \$out_folder -type f -name "*.yaml" | xargs sed -i "s#^chden_seed: .*#chden_seed: \$charge_density_seed#g" &&
+        bash '${__tool_directory__}/run.sh' \$out_folder &&
         zip -r out_zip.zip \$out_folder params.yaml input_structure.* &&
         find \$out_folder > tree.txt
     ]]></command>
     <inputs>
         <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."/>
-        <param type="data" name="charge_density" label="Charge density file (.den_fmt)" format="txt" help="The charge density file created by CASTEP during your initial DFT simulation for the structure."/>
-        <param type="data" name="castep_log" label="CASTEP log (.castep)" format="txt" help="The CASTEP log for your initial DFT simulation for the structure."/>
+        <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."/>
+        <param type="data" name="castep_log" label="CASTEP log (.castep)" format="castep" help="The CASTEP log for your initial DFT simulation for the structure."/>
         <param type="hidden" name="testing" label="Test mode" value="false"/>
     </inputs>
     <outputs>
@@ -65,8 +69,8 @@
         <test expect_num_outputs="2">
             <param name="testing" value="true"/>
             <param name="muonated_structures" value="muonated.zip" ftype="zip"/>
-            <param name="charge_density" value="Si.den_fmt" ftype="txt"/>
-            <param name="castep_log" value="Si.castep" ftype="txt"/>
+            <param name="charge_density" value="Si.den_fmt" ftype="den_fmt"/>
+            <param name="castep_log" value="Si.castep" ftype="castep"/>
             <output name="file_tree" file="tree.txt" ftype="txt" sort="true">
                 <assert_contents>
                     <has_size value="1780"/>
@@ -76,15 +80,15 @@
         <test expect_num_outputs="2">
             <param name="testing" value="true"/>
             <param name="muonated_structures" value="muonated-default-folder.zip" ftype="zip"/>
-            <param name="charge_density" value="Si.den_fmt" ftype="txt"/>
-            <param name="castep_log" value="Si.castep" ftype="txt"/>
+            <param name="charge_density" value="Si.den_fmt" ftype="den_fmt"/>
+            <param name="castep_log" value="Si.castep" ftype="castep"/>
             <output name="file_tree" file="tree-default-folder.txt" sort="true"/>
         </test>
         <test expect_failure="true">
             <param name="testing" value="true"/>
             <param name="muonated_structures" value="muonated-default-folder.zip" ftype="zip"/>
-            <param name="castep_log" value="Si.castep" ftype="txt"/>
-            <param name="charge_density" value="Sifail.den_fmt" ftype="txt"/>
+            <param name="castep_log" value="Si.castep" ftype="castep"/>
+            <param name="charge_density" value="Sifail.den_fmt" ftype="den_fmt"/>
             <assert_stderr>
                 <has_text text="Error:  FMT file has no header"/>
             </assert_stderr>
@@ -93,8 +97,20 @@
         <test expect_num_outputs="1">
             <param name="testing" value="false"/>
             <param name="muonated_structures" value="muonated.zip" ftype="zip"/>
-            <param name="charge_density" value="Si.den_fmt" ftype="txt"/>
-            <param name="castep_log" value="Si.castep" ftype="txt"/>
+            <param name="charge_density" value="Si.den_fmt" ftype="den_fmt"/>
+            <param name="castep_log" value="Si.castep" ftype="castep"/>
+        </test>
+        <!-- Check that the chden parameters are set correctly when $charge_density.name does not have the .den_fmt extension -->
+        <test expect_num_outputs="2">
+            <param name="testing" value="true"/>
+            <param name="muonated_structures" value="muonated.zip" ftype="zip"/>
+            <param name="charge_density" value="Si_den_fmt" ftype="den_fmt"/>
+            <param name="castep_log" value="Si.castep" ftype="castep"/>
+            <output name="file_tree" file="tree.txt" ftype="txt" sort="true">
+                <assert_contents>
+                    <has_size value="1780"/>
+                </assert_contents>
+            </output>
         </test>
     </tests>
     <help><![CDATA[
@@ -106,65 +122,16 @@
         Command-line usage: pm-uep-opt [-h] [-t {r,w}] structures parameter_file
 
         .. _Generate muonated structures: /tool_runner?tool_id=pm_muairss_write
+
+        PyMuonSuite is distributed under the GPLv3 license. This tool wrapper is distributed under the MIT license.
     ]]></help>
     <citations>
         <citation type="bibtex">
             @TOOL_CITATION@
         </citation>
-        <citation type="bibtex">
-            @article{airss,
-                author = {Liborio, L. and Sturniolo, S. and Jochym, D.},
-                title = {Computational prediction of muon stopping sites using ab initio random structure searching (AIRSS)},
-                journal = {The Journal of Chemical Physics},
-                volume = {148},
-                pages = {134114},
-                year = {2018},
-                doi={10.1063/1.5024450},
-                URL={
-                    https://doi.org/10.1063/1.5024450
-                },
-                eprint={
-                    https://doi.org/10.1063/1.5024450
-                }
-            }
-        </citation>
-        <citation type="bibtex">
-            @article{doi:10.1063/1.5085197,
-                author = {Sturniolo,Simone  and Liborio,Leandro  and Jackson,Samuel },
-                title = {Comparison between density functional theory and density functional tight binding approaches for finding the muon stopping site in organic molecular crystals},
-                journal = {The Journal of Chemical Physics},
-                volume = {150},
-                number = {15},
-                pages = {154301},
-                year = {2019},
-                doi = {10.1063/1.5085197},
-                URL = {
-                        https://doi.org/10.1063/1.5085197
-                },
-                eprint = {
-                        https://doi.org/10.1063/1.5085197
-                }
-            }
-        </citation>
-        <citation type="bibtex">
-            @article{doi:10.1063/5.0012381,
-                author = {Sturniolo,Simone  and Liborio,Leandro },
-                title = {Computational prediction of muon stopping sites: A novel take on the unperturbed electrostatic potential method},
-                journal = {The Journal of Chemical Physics},
-                volume = {153},
-                number = {4},
-                pages = {044111},
-                year = {2020},
-                doi = {10.1063/5.0012381},
-                URL = {
-                        https://doi.org/10.1063/5.0012381
-                },
-                eprint = {
-                        https://doi.org/10.1063/5.0012381
-                },
-                abstract = { Finding the stopping site of the muon in a muon-spin relaxation experiment is one of the main problems of muon spectroscopy, and computational techniques that make use of quantum chemistry simulations can be of great help when looking for this stopping site. The most thorough approach would require the use of simulations, such as Density Functional Theory (DFT), to test and optimise multiple possible sites, accounting for the effect that the added muon has on its surroundings. However, this can be computationally expensive and sometimes unnecessary. Hence, in this work, we present a software implementation of the Unperturbed Electrostatic Potential (UEP) Method: an approach used for finding the muon stopping site in crystalline materials. The UEP method requires only one DFT calculation, necessary to compute the electronic density. This, in turn, is used to calculate the minima of the crystalline material’s electrostatic potential and the estimates of the muon stopping site, relying on the approximation that the muon’s presence does not significantly affect its surroundings. One of the main UEP’s assumptions is that the muon stopping site will be one of the crystalline material’s electrostatic potential minima. In this regard, we also propose some symmetry-based considerations about the properties of this crystalline material’s electrostatic potential, in particular, which sites are more likely to be its minima and why the unperturbed approximation may be sufficiently robust for them. We introduce the Python software package pymuon-suite and the various utilities it provides to facilitate these calculations, and finally, we demonstrate the effectiveness of the method with some chosen example systems. }
-            }
-        </citation>
+        <citation type="doi">10.1063/1.5024450</citation>
+        <citation type="doi">10.1063/1.5085197</citation>
+        <citation type="doi">10.1063/5.0012381</citation>
         <citation type="bibtex">
             @article {castep,
                 author = {Clark, S. J. and Segall, M. D. and Pickard, C. J. and Hasnip, P. J. and Probert, M. I. J. and Refson, K. and Payne, M. C.},