changeset 2:dd3ca8457fcd draft

planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_asephonons commit 4f06b404d8b7fb83995f3052faa7e2ec7811f507
author muon-spectroscopy-computational-project
date Fri, 03 Feb 2023 15:39:17 +0000
parents 641fda3dfb62
children fd28cbdb134e
files muon_macros.xml pm_asephonons.xml
diffstat 2 files changed, 152 insertions(+), 73 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/muon_macros.xml	Fri Feb 03 15:39:17 2023 +0000
@@ -0,0 +1,20 @@
+<macros>
+    <xml name="dftb_set">
+        <param type="select" name="dftb_set" value="3ob-3-1" display="radio" label="DFTB parameter set" help="The parameter set to use for DFTB+. Currently supported are: 3ob-3-1 and pbc-0-3. See help section at the bottom of the page for details.">
+            <option value="3ob-3-1">3ob-3-1</option>
+            <option value="pbc-0-3">pbc-0-3</option>
+        </param>
+    </xml>
+    <xml name="dftb+">
+        <expand macro="dftb_set"/>
+        <param type="boolean" name="dftb_pbc" label="Use periodic boundary conditions" help="Whether to turn on periodic boundary conditions in DFTB+." checked="true"/>
+    </xml>
+    <xml name="dftb_optionals">
+        <param type="text" argument="dftb_optionals" value="[]" optional="true" label="DFTB optional files" help="Additional optional json files to activate for DFTBArgs (for example, dftd3.json will use DFTD3 dispersion forces for 3ob-3-1 if DFTB+ has been compiled to support them)."/>
+    </xml>
+    <xml name="k_points_grid">
+        <param type="text" argument="k_points_grid" value="[1,1,1]" label="K-points grid" help="List of three integer k-points. Default is [1,1,1].">
+            <validator type="regex" message="Input should only contain whitespace, '[', ']', ',' and digits.">^[\s\d,\[\]]+$</validator>
+        </param>
+    </xml>
+</macros>
\ No newline at end of file
--- a/pm_asephonons.xml	Thu Sep 15 10:24:36 2022 +0000
+++ b/pm_asephonons.xml	Fri Feb 03 15:39:17 2023 +0000
@@ -1,20 +1,25 @@
-<tool id="pm_asephonons" name="PyMuonSuite Phonons" version="0.1.1" python_template_version="3.5" profile="22.01">
+<tool id="pm_asephonons" name="PyMuonSuite Phonons" version="@TOOL_VERSION@+galaxy@WRAPPER_VERSION@" python_template_version="3.5" profile="22.05" license="MIT">
     <description>calculate phonons using ASE and DFTB+</description>
     <macros>
+        <!-- version of underlying tool (PEP 440) -->
+        <token name="@TOOL_VERSION@">0.2.3</token>
+        <!-- version of this tool wrapper (integer) -->
+        <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="@PYMUONSUITE_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>
+        <import>muon_macros.xml</import>
     </macros>
     <creator>
         <person givenName="Jyothish" familyName="Thomas" identifier="https://orcid.org/0000-0003-4724-6924"/>
@@ -23,51 +28,92 @@
     </creator>
     <requirements>
         <!-- note versioning is different due to multiple dependencies -->
-        <requirement type="package" version="0.2.1">pymuonsuite</requirement>
+        <requirement type="package" version="@TOOL_VERSION@">pymuonsuite</requirement>
         <requirement type="package" version="21.2">dftbplus</requirement>
         <requirement type="package" version="1.22.4">numpy</requirement> <!-- pinned due to numpy/ASE/DFTB+ incompatibility https://github.com/dftbplus/dftbplus/issues/1064 -->
         <requirement type="package" version="3.0">zip</requirement>
     </requirements>
     <command detect_errors="exit_code"><![CDATA[
-        structure_name_internal="input_structure.$structure.ext" &&
-        touch pho_params.yaml &&
-        ([[ ! -z "$name" ]] && printf "name: $name \n">>pho_params.yaml || ( >&2 echo "name empty" && exit 2)) &&
-        ([[ ! -z "$phonon_kpoint_grid" ]] && ( printf "phonon_kpoint_grid: $phonon_kpoint_grid \n" | sed "s/__ob__/[/g" | sed "s/__cb__/]/g" )>>pho_params.yaml || ( >&2 echo "phonon_kpoint_grid empty" && exit 2)) &&
-        ([[ ! -z "$kpoint_grid" ]] && ( printf "kpoint_grid: $kpoint_grid \n" | sed "s/__ob__/[/g" | sed "s/__cb__/]/g" )>>pho_params.yaml || ( >&2 echo "kpoint_grid empty" && exit 2)) &&
-        ([[ ! -z "$force_tol" ]] && printf "force_tol: $force_tol \n">>pho_params.yaml || ( >&2 echo "force_tol empty" && exit 2)) &&
-        ([[ ! -z "$dftb_set" ]] && printf "dftb_set: $dftb_set \n">>pho_params.yaml || ( >&2 echo "dftb_set empty" && exit 2)) &&
-        ([[ ! -z "$pbc" ]] && printf "pbc: $pbc \n">>pho_params.yaml || ( >&2 echo "pbc empty" && exit 2)) &&
-        printf "force_clean: false \n">>pho_params.yaml &&
-        ln -s $structure \$structure_name_internal &&
+        structure_name_internal='input_structure.$pbc.structure.ext' &&
+        ln -s '$pho_params' pho_params.yaml &&
+        ln -s '$pbc.structure' \$structure_name_internal &&
         cat pho_params.yaml &&
-        pm-asephonons \$structure_name_internal pho_params.yaml ; err=\$? &&
+        err=0 &&
+        pm-asephonons \$structure_name_internal pho_params.yaml || err=\$? &&
         echo "Asephonons output:" &&
         cat asephonons.out &&
         if [ \$err != 0 ] ; then echo "errored" && exit 24 ; fi &&
-        ln -s "${name}_phonons.txt" phonon_report.txt &&
-        zip -r out_zip.zip $name "${name}_phonons.txt" asephonons.out band.out pho_params.yaml
+        ln -s '${name}_phonons.txt' phonon_report.txt &&
+        zip -r out_zip.zip '$name' '${name}_phonons.txt' asephonons.out band.out pho_params.yaml
     ]]></command>
+    <configfiles>
+        <configfile name="pho_params">name: $name
+phonon_kpoint_grid: $phonon_kpoint_grid.replace('__ob__', '[').replace('__cb__', ']')
+kpoint_grid: $kpoint_grid.replace('__ob__', '[').replace('__cb__', ']')
+force_tol: $force_tol
+dftb_set: $dftb_set
+pbc: $pbc.pbc
+force_clean: false</configfile>
+    </configfiles>
     <inputs>
-        <param type="data" name="structure" label="Structure file" format="cell" help="The structure to generate the phonon report from. Accepted file types: cell."/>
-        <param type="text" name="name" label="Structure name" help="Name of the structure." value="struct"/>
-        <param type="text" name="phonon_kpoint_grid" label="Phonon k-points" value="[1, 1, 1]"/>
-        <param type="text" name="kpoint_grid" label="K-points used for DFTB+ calculation" value="[1, 1, 1]"/>
-        <param type="float" name="force_tol" label="Force tolerance for optimisation" value="0.01"/>
-        <param type="select" name="dftb_set" label="DFTB set to use" value="3ob-3-1">
-            <option value="3ob-3-1">3ob-3-1</option>
-            <option value="pbc-0-3">pbc-0-3</option>
+        <param argument="name" type="text" value="struct" label="Structure name" help="Name of the structure."/>
+        <param argument="phonon_kpoint_grid" type="text" value="[1, 1, 1]" label="Phonon k-points">
+            <validator type="regex" message="Input should only contain whitespace, '[', ']', ',' and digits.">^[\s\d,\[\]]+$</validator>
+        </param>
+        <param argument="kpoint_grid" type="text" value="[1, 1, 1]" label="K-points used for DFTB+ calculation">
+            <validator type="regex" message="Input should only contain whitespace, '[', ']', ',' and digits.">^[\s\d,\[\]]+$</validator>
         </param>
-        <param type="boolean" name="pbc" label="Use periodic boundary conditions" help="Whether to turn on periodic boundary conditions in DFTB+." value="true"/>
+        <param argument="force_tol" type="float" min="0.0" value="0.01" label="Force tolerance for optimisation"/>
+        <expand macro="dftb_set"/>
+        <conditional name="pbc">
+            <param argument="pbc" type="select" display="radio" multiple="false" label="Use periodic boundary conditions (PBC)" help="Whether to turn on PBC conditions in DFTB+. Note that XYZ files cannot be used with PBC.">
+                <option selected="true" value="true">Yes</option>
+                <option value="false">No</option>
+            </param>
+            <when value="true">
+                <param name="structure" type="data" format="cell, cif, extxyz" label="Structure file" help="The structure to generate the phonon report from. Accepted file types: CELL, CIF, XYZ (extended ONLY)."/>
+            </when>
+            <when value="false">
+                <param name="structure" type="data" format="cell, cif, extxyz, xyz" label="Structure file" help="The structure to generate the phonon report from. Accepted file types: CELL, CIF, XYZ (standard or extended)."/>
+            </when>
+        </conditional>
     </inputs>
     <outputs>
-        <data label="phonons outputs of $structure.name" name="phonon_outputs" format="zip" from_work_dir="out_zip.zip"/>
-        <data label="phonon report for $structure.name" name="phonon_report" format="txt" from_work_dir="phonon_report.txt"/>
+        <data label="phonons outputs of $pbc.structure.name" name="phonon_outputs" format="zip" from_work_dir="out_zip.zip"/>
+        <data label="phonon report for $pbc.structure.name" name="phonon_report" format="txt" from_work_dir="phonon_report.txt"/>
     </outputs>
     <tests>
         <test expect_num_outputs="2">
-            <param name="structure" value="Si.cell" ftype="cell"/>
+            <param name="name" value="Si"/>
+            <param name="dftb_set" value="pbc-0-3"/>
+            <conditional name="pbc">
+                <param name="structure" value="Si.cell" ftype="cell"/>
+            </conditional>
+            <output name="phonon_report" file="test_out.txt" ftype="txt" compare="re_match">
+                <assert_contents>
+                    <has_size value="8255" delta="20"/>
+                </assert_contents>
+            </output>
+        </test>
+        <test expect_num_outputs="2">
             <param name="name" value="Si"/>
             <param name="dftb_set" value="pbc-0-3"/>
+            <conditional name="pbc">
+                <param name="structure" value="Si.cif" ftype="cif"/>
+            </conditional>
+            <output name="phonon_report" file="test_out.txt" ftype="txt" compare="re_match">
+                <assert_contents>
+                    <has_size value="8255" delta="20"/>
+                </assert_contents>
+            </output>
+        </test>
+        <test expect_num_outputs="2">
+            <param name="name" value="Si"/>
+            <param name="dftb_set" value="pbc-0-3"/>
+            <conditional name="pbc">
+                <param name="pbc" value="false"/>
+                <param name="structure" value="Si.xyz" ftype="xyz"/>
+            </conditional>
             <output name="phonon_report" file="test_out.txt" ftype="txt" compare="re_match">
                 <assert_contents>
                     <has_size value="8155" delta="20"/>
@@ -75,32 +121,14 @@
             </output>
         </test>
         <test expect_num_outputs="2">
-            <param name="structure" value="Si.cif" ftype="cif"/>
-            <param name="name" value="Si"/>
-            <param name="dftb_set" value="pbc-0-3"/>
-            <output name="phonon_report" file="test_out.txt" ftype="txt" compare="re_match">
-                <assert_contents>
-                    <has_size value="8155" delta="20"/>
-                </assert_contents>
-            </output>
-        </test>
-        <test expect_num_outputs="2">
-            <param name="structure" value="Si.xyz" ftype="xyz"/>
             <param name="name" value="Si"/>
             <param name="dftb_set" value="pbc-0-3"/>
+            <conditional name="pbc">
+                <param name="structure" value="Si.extxyz" ftype="extxyz"/>
+            </conditional>
             <output name="phonon_report" file="test_out.txt" ftype="txt" compare="re_match">
                 <assert_contents>
-                    <has_size value="8155" delta="20"/>
-                </assert_contents>
-            </output>
-        </test>
-        <test expect_num_outputs="2">
-            <param name="structure" value="Si.extxyz" ftype="extxyz"/>
-            <param name="name" value="Si"/>
-            <param name="dftb_set" value="pbc-0-3"/>
-            <output name="phonon_report" file="test_out.txt" ftype="txt" compare="re_match">
-                <assert_contents>
-                    <has_size value="8155" delta="20"/>
+                    <has_size value="8255" delta="20"/>
                 </assert_contents>
             </output>
         </test>
@@ -110,29 +138,60 @@
 
         Given an input structure, this tool generates a phonon report for that structure using the parameters provided.
 
+        PyMuonSuite is distributed under the GPLv3 license. This tool wrapper is distributed under the MIT license.
+
+        All data is licensed under the Creative Commons Attribution-ShareAlike 4.0
+        International License. The full text of the license can be found at:
+
+        https://creativecommons.org/licenses/by-sa/4.0/legalcode
+
+        For specific data sets remember to cite the following papers, by element :
+
+        | **3-ob-1**
+
+        +--------------+------------------------------------------------+-----------------------------------+------------------------------------+
+        | [JCTC2013]   | \ J. Chem. Theory Comput., 2013, 9, 338-354.   | (O, N, C, H)                      | https://doi.org/10.1021/ct300849w  |
+        +--------------+------------------------------------------------+-----------------------------------+------------------------------------+
+        | [JCTC2014]   | \ J. Chem. Theory Comput., 2014, 10, 1518-1537.| (P,S-\*)                          | https://doi.org/10.1021/ct401002w  |
+        +--------------+------------------------------------------------+-----------------------------------+------------------------------------+
+        | [JCTC2015-1] | \ J. Phys. Chem. B, 2015, 119, 1062-1082.      | (Mg,Zn-\*)                        | https://doi.org/10.1021/jp506557r  |
+        +--------------+------------------------------------------------+-----------------------------------+------------------------------------+
+        | [JCTC2015-2] | \ J. Chem. Theory Comput., 2015, 11, 332-342.  | (Na,F,K,Ca,Cl,Br,I-\*)            | https://doi.org/10.1021/ct5009137  |
+        +--------------+------------------------------------------------+-----------------------------------+------------------------------------+
+
+        |
+        | **pbc-0-3**
+
+        +------------+--------------------------------------------------------------------------------------------+---------+------------------------------------------------+
+        |   [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  |
+        +------------+--------------------------------------------------------------------------------------------+---------+------------------------------------------------+
+        |   [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     |
+        +------------+--------------------------------------------------------------------------------------------+---------+------------------------------------------------+
+        | [Silicon]  | \ A. Sieck, Th. Frauenheim, and K. A. Jackson, phys. stat. sol. (b) 240, 537 (2003).       |  (Si)   | https://doi.org/10.1002/pssb.200301886         |
+        +------------+--------------------------------------------------------------------------------------------+---------+------------------------------------------------+
+        | [Fluorine] | \ C. Koehler and Th. Frauenheim, Surf. Sci. 600, 453 (2006).                               | \ (F)   | https://doi.org/10.1016/j.susc.2005.10.044     |
+        +------------+--------------------------------------------------------------------------------------------+---------+------------------------------------------------+
+        |   [Iron]   | \ C. Koehler, G. Seifert and Th. Frauenheim, Chem. Phys. 309, 23 (2005).                   |   (Fe)  | https://doi.org/10.1016/j.chemphys.2004.03.034 |
+        +------------+--------------------------------------------------------------------------------------------+---------+------------------------------------------------+
+        |   [SiSi]   | \ A. Sieck, PhD. Thesis, University of Paderborn, 2000.                                    | (Si-Si) | https://www.osti.gov/etdeweb/biblio/20249635   |
+        +------------+--------------------------------------------------------------------------------------------+---------+------------------------------------------------+
+
+        |
+        | The full sets and all other data can be found at the following URLs:
+
+        +----------+------------------------------------------------------------+
+        |  3-ob-1  |   https://www.dftb.org/parameters/download/3ob/3ob-3-1-cc/ |
+        +----------+------------------------------------------------------------+
+        | pbc-0-3  |  https://www.dftb.org/parameters/download/pbc/pbc-0-3-cc/  |
+        +----------+------------------------------------------------------------+
+
+        |
     ]]></help>
     <citations>
         <citation type="bibtex">
             @PYMUONSUITE_CITATION@
         </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="doi">10.1063/1.5085197</citation>
         <citation type="bibtex">
             @article{larsen2017atomic,
                 title={The atomic simulation environment—a Python library for working with atoms},