changeset 2:8e5dbded3070 draft default tip

planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_muairss_write commit 4f06b404d8b7fb83995f3052faa7e2ec7811f507
author muon-spectroscopy-computational-project
date Fri, 03 Feb 2023 15:39:39 +0000
parents 150301c057b0
children
files pm_muairss_write.xml test-data/S i.param test-data/allpos.cell test-data/allpos.cif test-data/allpos.xyz test-data/configcastep_t_with_script_file.yaml test-data/s u b m i t.sh test-data/submit.sh test-data/tree_castep_t_with_script_file.txt
diffstat 9 files changed, 334 insertions(+), 96 deletions(-) [+]
line wrap: on
line diff
--- a/pm_muairss_write.xml	Thu Sep 15 10:20:27 2022 +0000
+++ b/pm_muairss_write.xml	Fri Feb 03 15:39:39 2023 +0000
@@ -1,22 +1,22 @@
-<tool id="pm_muairss_write" name="PyMuonSuite AIRSS Generate" version="@TOOL_VERSION@+galaxy@WRAPPER_VERSION@" python_template_version="3.5" profile="22.01">
+<tool id="pm_muairss_write" name="PyMuonSuite AIRSS Generate" version="@TOOL_VERSION@+galaxy@WRAPPER_VERSION@" python_template_version="3.5" profile="22.05" license="MIT">
     <description>generate muonated structures</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>
@@ -33,22 +33,34 @@
         <include type="literal" path="get_out_folder.py"/>
     </required_files>
     <command detect_errors="exit_code"><![CDATA[
-        structure_name_internal="input_structure.$structure.ext" &&
-        ln -s $structure \$structure_name_internal &&
-        ln -s $params params.yaml &&
-        #if str($iscastep.iscastep_sel)=="true":
-            castep_param_name=\$(sed 's/ //g' <<< "$castep_param.name") &&
-            ln -s $castep_param \$castep_param_name &&
-            sed -i '/^castep_param: /{h;s/:.*/: $castep_param.name/};\${x;/^$/{s//castep_param: $castep_param.name/;H};x}' params.yaml &&
+        structure_name_internal='input_structure.$structure.ext' &&
+        ln -s '$structure' \$structure_name_internal &&
+        ln -s '$params' params.yaml &&
+        echo '$castep_param' &&
+        #if $castep_param:
+            castep_param_name=\$(sed 's/ //g' <<< '$castep_param.name') &&
+            ln -s '$castep_param' \$castep_param_name &&
+            sed -i '/^castep_param: /{h;s/:.*/: '"\$castep_param_name"'/};\${x;/^$/{s//castep_param: '"\$castep_param_name"'/;H};x}' params.yaml &&
+            #if $script_file:
+                script_file_name=\$(sed 's/ //g' <<< '$script_file.name') &&
+                ln -s '$script_file' \$script_file_name &&
+                sed -i '/^script_file: /{h;s/:.*/: '"\$script_file_name"'/};\${x;/^$/{s//script_file: '"\$script_file_name"'/;H};x}' params.yaml &&
+            #end if
+        #end if
+        #if $allpos_ext!="none":
+            sed -i '/^allpos_filename: /{h;s/:.*/: allpos.$allpos_ext/};\${x;/^$/{s//allpos_filename: allpos.$allpos_ext/;H};x}' params.yaml &&
         #end if
         pm-muairss -t w \$structure_name_internal params.yaml &&
-        out_folder="`python ${__tool_directory__}/get_out_folder.py`" &&
-        #if str($iscastep.iscastep_sel)=="true":
+        out_folder="`python '${__tool_directory__}/get_out_folder.py'`" &&
+        #if $castep_param:
             zip -r out_zip.zip \$out_folder params.yaml \$structure_name_internal \$castep_param_name &&
-        #else if str($iscastep.iscastep_sel)=="false":
+        #else:
             zip -r out_zip.zip \$out_folder params.yaml \$structure_name_internal &&
         #end if
-        #if $testing=="true" and str($iscastep.iscastep_sel)=="true":
+        #if $allpos_ext!="none":
+            mv allpos.$allpos_ext allpos &&
+        #end if
+        #if $testing=="true" and $castep_param:
             grep "castep_param" params.yaml > tree.txt &&
         #end if
         find \$out_folder >> tree.txt
@@ -57,20 +69,21 @@
     <inputs>
         <param type="data" name="structure" label="Structure file" format="cell, cif, xyz, extxyz" help="The structure to add muons to. The original file will be preserved. Accepted file types: CELL, CIF, XYZ (standard or extended)."/>
         <param type="data" name="params" label="YAML parameter file" format="yaml" help="YAML parameters for this and subsequent tools. You can create this file using the [YAML config generator] tool."/>
-        <conditional name="iscastep">
-            <param type="boolean" value="false" name="iscastep_sel" label="Does your configuration use the CASTEP calculator?" help="Select 'Yes' if the 'calculator' parameter is set to 'castep' in your chosen YAML file (not case sensitive).">
-                <option value="false">no</option>
-                <option value="true">yes</option>
-            </param>
-            <when value="true">
-                <param type="data" name="castep_param" label="CASTEP parameter file" format="txt,yaml" help="CASTEP parameters (.param file) for the optimisation stage. These parameters will be copied for each muonated structure."/>
-            </when>
-            <when value="false"/>
-        </conditional>
+        <param type="data" name="castep_param" optional="true" label="CASTEP parameter file" format="param" help="CASTEP parameters (.param file) for the optimisation stage. These parameters will be copied for each muonated structure. Only required when the 'calculator' parameter is set to 'castep' in your chosen YAML file."/>
+        <param type="data" name="script_file" label="Submission script template (optional)" format="txt" help="Template script for submitting to an HPC job scheduler. Occurences of {seedname} will be replaced with the unique input directory for each job." optional="true"/>
+        <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.">
+            <option value="none">Do not generate</option>
+            <option value="cell">CELL</option>
+            <option value="cif">CIF</option>
+            <option value="xyz">XYZ</option>
+        </param>
         <param type="hidden" name="testing" label="Test mode" value="false"/>
     </inputs>
     <outputs>
         <data label="Muonated $structure.name using $params.name" name="muonated_structures" format="zip" from_work_dir="out_zip.zip"/>
+        <data label="File containing the positions of all muon sites" name="allpos_file" from_work_dir="allpos" auto_format="true">
+            <filter>(allpos_ext != "none")</filter>
+        </data>
         <data label="File tree (testing only)" name="file_tree" format="txt" from_work_dir="tree.txt" hidden="true">
             <filter>(testing == "true")</filter>
         </data>
@@ -81,10 +94,7 @@
             <param name="structure" value="Si.cell" ftype="cell"/>
             <param name="testing" value="true"/>
             <param name="params" value="configcastep_t_with_out_folder_and_castep_param.yaml" ftype="yaml"/>
-            <conditional name="iscastep">
-                <param name="iscastep_sel" value="true"/>
-                <param name="castep_param" value="Si.param" ftype="txt"/>
-            </conditional>
+            <param name="castep_param" value="Si.param" ftype="param"/>
             <output name="file_tree" file="tree_castep_t_with_out_folder_and_castep_param.txt" ftype="txt" sort="true" />
         </test>
         <!-- CASTEP with out_folder and castep_param specified, param as yaml -->
@@ -92,10 +102,15 @@
             <param name="structure" value="Si.cell" ftype="cell"/>
             <param name="testing" value="true"/>
             <param name="params" value="configcastep_t_with_out_folder_and_castep_param.yaml" ftype="yaml"/>
-            <conditional name="iscastep">
-                <param name="iscastep_sel" value="true"/>
-                <param name="castep_param" value="Si.param" ftype="yaml"/>
-            </conditional>
+            <param name="castep_param" value="Si.param" ftype="param"/>
+            <output name="file_tree" file="tree_castep_t_with_out_folder_and_castep_param.txt" ftype="txt" sort="true" />
+        </test>
+        <!-- CASTEP with spaces in param name -->
+        <test expect_num_outputs="2">
+            <param name="structure" value="Si.cell" ftype="cell"/>
+            <param name="testing" value="true"/>
+            <param name="params" value="configcastep_t_with_out_folder_and_castep_param.yaml" ftype="yaml"/>
+            <param name="castep_param" value="S i.param" ftype="param"/>
             <output name="file_tree" file="tree_castep_t_with_out_folder_and_castep_param.txt" ftype="txt" sort="true" />
         </test>
         <!-- CASTEP with no out_folder and no castep_param specified in yaml file -->
@@ -103,12 +118,57 @@
             <param name="structure" value="Si.cell" ftype="cell"/>
             <param name="testing" value="true"/>
             <param name="params" value="configcastep_t_no_out_folder_no_castep_param.yaml" ftype="yaml"/>
-            <conditional name="iscastep">
-                <param name="iscastep_sel" value="true"/>
-                <param name="castep_param" value="Si.param"/>
-            </conditional>
+            <param name="castep_param" value="Si.param" ftype="param"/>
             <output name="file_tree" file="tree_castep_t_no_outfolder_and_castep_param.txt" ftype="txt" sort="true" />
         </test>
+        <!-- CASTEP with allpos_ext xyz -->
+        <test expect_num_outputs="3">
+            <param name="structure" value="Si.cell" ftype="cell"/>
+            <param name="testing" value="true"/>
+            <param name="params" value="configcastep_t_with_out_folder_and_castep_param.yaml" ftype="yaml"/>
+            <param name="allpos_ext" value="xyz"/>
+            <param name="castep_param" value="Si.param" ftype="param"/>
+            <output name="file_tree" file="tree_castep_t_with_out_folder_and_castep_param.txt" ftype="txt" sort="true" />
+            <output name="allpos_file" file="allpos.xyz" />
+        </test>
+        <!-- CASTEP with allpos_ext cell -->
+        <test expect_num_outputs="3">
+            <param name="structure" value="Si.cell" ftype="cell"/>
+            <param name="testing" value="true"/>
+            <param name="params" value="configcastep_t_with_out_folder_and_castep_param.yaml" ftype="yaml"/>
+            <param name="allpos_ext" value="cell"/>
+            <param name="castep_param" value="Si.param" ftype="param"/>
+            <output name="file_tree" file="tree_castep_t_with_out_folder_and_castep_param.txt" ftype="txt" sort="true" />
+            <output name="allpos_file" file="allpos.cell" />
+        </test>
+        <!-- CASTEP with allpos_ext cif -->
+        <test expect_num_outputs="3">
+            <param name="structure" value="Si.cell" ftype="cell"/>
+            <param name="testing" value="true"/>
+            <param name="params" value="configcastep_t_with_out_folder_and_castep_param.yaml" ftype="yaml"/>
+            <param name="allpos_ext" value="cif"/>
+            <param name="castep_param" value="Si.param" ftype="param"/>
+            <output name="file_tree" file="tree_castep_t_with_out_folder_and_castep_param.txt" ftype="txt" sort="true" />
+            <output name="allpos_file" file="allpos.cif" />
+        </test>
+        <!-- CASTEP with script_file not specified in YAML file -->
+        <test expect_num_outputs="2">
+            <param name="structure" value="Si.cell" ftype="cell"/>
+            <param name="testing" value="true"/>
+            <param name="params" value="configcastep_t_with_out_folder_and_castep_param.yaml" ftype="yaml"/>
+            <param name="castep_param" value="Si.param" ftype="param"/>
+            <param name="script_file" value="submit.sh" ftype="txt"/>
+            <output name="file_tree" file="tree_castep_t_with_script_file.txt" ftype="txt" sort="true" />
+        </test>
+        <!-- CASTEP with script_file specified in YAML file -->
+        <test expect_num_outputs="2">
+            <param name="structure" value="Si.cell" ftype="cell"/>
+            <param name="testing" value="true"/>
+            <param name="params" value="configcastep_t_with_script_file.yaml" ftype="yaml"/>
+            <param name="castep_param" value="Si.param" ftype="param"/>
+            <param name="script_file" value="s u b m i t.sh" ftype="txt"/>
+            <output name="file_tree" file="tree_castep_t_with_script_file.txt" ftype="txt" sort="true" />
+        </test>
         <!-- DFTB+ -->
         <test expect_num_outputs="2">
             <param name="structure" value="Si.cell" ftype="cell"/>
@@ -177,6 +237,8 @@
         .. _pm-muairss documentation: https://github.com/muon-spectroscopy-computational-project/pymuon-suite/blob/master/docs/muairss-gen-docs.md
         .. _YAML config generator: /tool_runner?tool_id=pm_yaml_config
         .. _Generate UEP outputs: /tool_runner?tool_id=pm_uep_opt_write
+
+        PyMuonSuite is distributed under the GPLv3 license. This tool wrapper is distributed under the MIT license.
     ]]></help>
     <citations>
         <citation type="bibtex">
@@ -188,60 +250,9 @@
                 url = {https://github.com/muon-spectroscopy-computational-project/pymuon-suite/}
             }
         </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 optimize 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">
             @TOOL_CITATION@
         </citation>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/S i.param	Fri Feb 03 15:39:39 2023 +0000
@@ -0,0 +1,13 @@
+task : geometryoptimisation
+opt_strategy : speed
+num_dump_cycles : 0
+cutoff_energy : 450 eV
+elec_energy_tol : 1.0e-9 eV
+write_cell_structure : true
+max_scf_cycles : 100
+xc_functional : pbe
+geom_max_iter : 100
+geom_force_tol : 0.05
+backup_interval : 3600
+continuation : default 
+write_formatted_density : true 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/allpos.cell	Fri Feb 03 15:39:39 2023 +0000
@@ -0,0 +1,38 @@
+#######################################################
+#CASTEP cell file: allpos.cell
+#Created using the Atomic Simulation Environment (ASE)#
+#######################################################
+
+%BLOCK LATTICE_CART
+ 5.475382  0.000000 -0.000000
+ 0.000000  5.475382  0.000000
+-0.000000  0.000000  5.475382
+%ENDBLOCK LATTICE_CART
+
+%BLOCK POSITIONS_ABS
+Si  0.000000  0.000000  0.000000
+Si -0.000000  2.737691  2.737691
+Si  1.368845  1.368845  1.368845
+Si  2.737691  0.000000  2.737691
+Si  1.368845  4.106536  4.106536
+Si  4.106536  1.368845  4.106536
+Si  4.106536  4.106536  1.368845
+Si  2.737691  2.737691 -0.000000
+H:mu  3.125152  3.041799  2.994236
+H:mu  4.170048  2.685234  3.919204
+H:mu  2.896190  3.055878  1.069474
+H:mu  2.499357  2.738732  5.011782
+H:mu  1.856384  1.305645  0.684300
+H:mu  0.710100  1.663543  1.366143
+H:mu  2.926805  4.554958  3.173796
+H:mu  4.041556  2.285971  2.357787
+H:mu  2.153772  1.685845  2.712357
+H:mu  3.369247  0.881320  2.641127
+H:mu  4.631185  3.830276  4.640470
+H:mu  2.828731  1.963913  1.697286
+H:mu  2.176625  2.144297  3.912156
+H:mu  1.805850  2.882961  2.746759
+H:mu  1.403305  0.559980  1.522521
+H:mu  3.251047  3.565876  4.157223
+%ENDBLOCK POSITIONS_ABS
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/allpos.cif	Fri Feb 03 15:39:39 2023 +0000
@@ -0,0 +1,49 @@
+data_image0
+_chemical_formula_structural       Si8H16
+_chemical_formula_sum              "Si8 H16"
+_cell_length_a       5.47538
+_cell_length_b       5.47538
+_cell_length_c       5.47538
+_cell_angle_alpha    90
+_cell_angle_beta     90
+_cell_angle_gamma    90
+
+_space_group_name_H-M_alt    "P 1"
+_space_group_IT_number       1
+
+loop_
+  _space_group_symop_operation_xyz
+  'x, y, z'
+
+loop_
+  _atom_site_type_symbol
+  _atom_site_label
+  _atom_site_symmetry_multiplicity
+  _atom_site_fract_x
+  _atom_site_fract_y
+  _atom_site_fract_z
+  _atom_site_occupancy
+  Si  Si1       1.0  0.00000  0.00000  0.00000  1.0000
+  Si  Si2       1.0  0.00000  0.50000  0.50000  1.0000
+  Si  Si3       1.0  0.25000  0.25000  0.25000  1.0000
+  Si  Si4       1.0  0.50000  0.00000  0.50000  1.0000
+  Si  Si5       1.0  0.25000  0.75000  0.75000  1.0000
+  Si  Si6       1.0  0.75000  0.25000  0.75000  1.0000
+  Si  Si7       1.0  0.75000  0.75000  0.25000  1.0000
+  Si  Si8       1.0  0.50000  0.50000  0.00000  1.0000
+  H   H1        1.0  0.57076  0.55554  0.54685  1.0000
+  H   H2        1.0  0.76160  0.49042  0.71579  1.0000
+  H   H3        1.0  0.52895  0.55811  0.19532  1.0000
+  H   H4        1.0  0.45647  0.50019  0.91533  1.0000
+  H   H5        1.0  0.33904  0.23846  0.12498  1.0000
+  H   H6        1.0  0.12969  0.30382  0.24951  1.0000
+  H   H7        1.0  0.53454  0.83190  0.57965  1.0000
+  H   H8        1.0  0.73813  0.41750  0.43062  1.0000
+  H   H9        1.0  0.39336  0.30790  0.49537  1.0000
+  H   H10       1.0  0.61534  0.16096  0.48236  1.0000
+  H   H11       1.0  0.84582  0.69955  0.84752  1.0000
+  H   H12       1.0  0.51663  0.35868  0.30999  1.0000
+  H   H13       1.0  0.39753  0.39163  0.71450  1.0000
+  H   H14       1.0  0.32981  0.52653  0.50166  1.0000
+  H   H15       1.0  0.25629  0.10227  0.27807  1.0000
+  H   H16       1.0  0.59376  0.65126  0.75926  1.0000
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/allpos.xyz	Fri Feb 03 15:39:39 2023 +0000
@@ -0,0 +1,26 @@
+24
+Lattice="5.47538171155659 5.3076732197316e-36 -1.31324260787022e-35 5.3076732197316e-36 5.47538171155659 3.13104997179767e-36 -1.31324260787022e-35 3.13104997179767e-36 5.47538171155659" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:castep_labels:S:1:masses:R:1:castep_custom_species:S:1 pbc="T T T"
+Si       0.00000000       0.00000000       0.00000000       0.00000000 NULL      28.08500000 Si
+Si      -0.00000000       2.73769086       2.73769086       0.00000000 NULL      28.08500000 Si
+Si       1.36884543       1.36884543       1.36884543       0.00000000 NULL      28.08500000 Si
+Si       2.73769086       0.00000000       2.73769086       0.00000000 NULL      28.08500000 Si
+Si       1.36884543       4.10653628       4.10653628       0.00000000 NULL      28.08500000 Si
+Si       4.10653628       1.36884543       4.10653628       0.00000000 NULL      28.08500000 Si
+Si       4.10653628       4.10653628       1.36884543       0.00000000 NULL      28.08500000 Si
+Si       2.73769086       2.73769086      -0.00000000       0.00000000 NULL      28.08500000 Si
+H        3.12515243       3.04179871       2.99423600       0.00000000          0.11342893 H:mu
+H        4.17004836       2.68523378       3.91920412       0.00000000          0.11342893 H:mu
+H        2.89619003       3.05587786       1.06947402       0.00000000          0.11342893 H:mu
+H        2.49935677       2.73873164       5.01178210       0.00000000          0.11342893 H:mu
+H        1.85638414       1.30564543       0.68430012       0.00000000          0.11342893 H:mu
+H        0.71010028       1.66354263       1.36614343       0.00000000          0.11342893 H:mu
+H        2.92680506       4.55495797       3.17379562       0.00000000          0.11342893 H:mu
+H        4.04155613       2.28597057       2.35778713       0.00000000          0.11342893 H:mu
+H        2.15377218       1.68584529       2.71235746       0.00000000          0.11342893 H:mu
+H        3.36924728       0.88132020       2.64112709       0.00000000          0.11342893 H:mu
+H        4.63118531       3.83027598       4.64047037       0.00000000          0.11342893 H:mu
+H        2.82873101       1.96391263       1.69728627       0.00000000          0.11342893 H:mu
+H        2.17662455       2.14429680       3.91215608       0.00000000          0.11342893 H:mu
+H        1.80584952       2.88296106       2.74675920       0.00000000          0.11342893 H:mu
+H        1.40330495       0.55998017       1.52252130       0.00000000          0.11342893 H:mu
+H        3.25104718       3.56587562       4.15722314       0.00000000          0.11342893 H:mu
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/configcastep_t_with_script_file.yaml	Fri Feb 03 15:39:39 2023 +0000
@@ -0,0 +1,15 @@
+poisson_r: 1.18
+name: Si
+charged: true
+geom_steps: 300
+vdw_scale: 0.25
+calculator: castep
+geom_force_tol: 0.05
+clustering_method: hier
+clustering_hier_t: 0.2
+out_folder: Si-out
+castep_command: castep.serial
+castep_param: test.param
+mu_symbol: H:mu
+random_seed: 7357
+script_file: s u b m i t.sh
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/s u b m i t.sh	Fri Feb 03 15:39:39 2023 +0000
@@ -0,0 +1,9 @@
+#!/bin/sh
+#SBATCH -o %J.o
+#SBATCH -e %J.e
+#SBATCH -t 24:00:00
+#SBATCH -n 16
+#SBATCH --job-name= {seedname}
+#SBATCH --exclusive
+module load castep/19
+mpirun castep.mpi {seedname}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/submit.sh	Fri Feb 03 15:39:39 2023 +0000
@@ -0,0 +1,9 @@
+#!/bin/sh
+#SBATCH -o %J.o
+#SBATCH -e %J.e
+#SBATCH -t 24:00:00
+#SBATCH -n 16
+#SBATCH --job-name= {seedname}
+#SBATCH --exclusive
+module load castep/19
+mpirun castep.mpi {seedname}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/tree_castep_t_with_script_file.txt	Fri Feb 03 15:39:39 2023 +0000
@@ -0,0 +1,68 @@
+castep_param: Si.param
+Si-out
+Si-out/castep
+Si-out/castep/Si_1
+Si-out/castep/Si_1/Si_1.cell
+Si-out/castep/Si_1/Si_1.param
+Si-out/castep/Si_1/script.sh
+Si-out/castep/Si_2
+Si-out/castep/Si_2/Si_2.cell
+Si-out/castep/Si_2/Si_2.param
+Si-out/castep/Si_2/script.sh
+Si-out/castep/Si_3
+Si-out/castep/Si_3/Si_3.cell
+Si-out/castep/Si_3/Si_3.param
+Si-out/castep/Si_3/script.sh
+Si-out/castep/Si_4
+Si-out/castep/Si_4/Si_4.cell
+Si-out/castep/Si_4/Si_4.param
+Si-out/castep/Si_4/script.sh
+Si-out/castep/Si_5
+Si-out/castep/Si_5/Si_5.cell
+Si-out/castep/Si_5/Si_5.param
+Si-out/castep/Si_5/script.sh
+Si-out/castep/Si_6
+Si-out/castep/Si_6/Si_6.cell
+Si-out/castep/Si_6/Si_6.param
+Si-out/castep/Si_6/script.sh
+Si-out/castep/Si_7
+Si-out/castep/Si_7/Si_7.cell
+Si-out/castep/Si_7/Si_7.param
+Si-out/castep/Si_7/script.sh
+Si-out/castep/Si_8
+Si-out/castep/Si_8/Si_8.cell
+Si-out/castep/Si_8/Si_8.param
+Si-out/castep/Si_8/script.sh
+Si-out/castep/Si_9
+Si-out/castep/Si_9/Si_9.cell
+Si-out/castep/Si_9/Si_9.param
+Si-out/castep/Si_9/script.sh
+Si-out/castep/Si_10
+Si-out/castep/Si_10/Si_10.cell
+Si-out/castep/Si_10/Si_10.param
+Si-out/castep/Si_10/script.sh
+Si-out/castep/Si_11
+Si-out/castep/Si_11/Si_11.cell
+Si-out/castep/Si_11/Si_11.param
+Si-out/castep/Si_11/script.sh
+Si-out/castep/Si_12
+Si-out/castep/Si_12/Si_12.cell
+Si-out/castep/Si_12/Si_12.param
+Si-out/castep/Si_12/script.sh
+Si-out/castep/Si_13
+Si-out/castep/Si_13/Si_13.cell
+Si-out/castep/Si_13/Si_13.param
+Si-out/castep/Si_13/script.sh
+Si-out/castep/Si_14
+Si-out/castep/Si_14/Si_14.cell
+Si-out/castep/Si_14/Si_14.param
+Si-out/castep/Si_14/script.sh
+Si-out/castep/Si_15
+Si-out/castep/Si_15/Si_15.cell
+Si-out/castep/Si_15/Si_15.param
+Si-out/castep/Si_15/script.sh
+Si-out/castep/Si_16
+Si-out/castep/Si_16/Si_16.cell
+Si-out/castep/Si_16/Si_16.param
+Si-out/castep/Si_16/script.sh
+Si-out/castep/.collection