comparison packmol.xml @ 0:0b8a0ce446f5 draft

planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem commit 11519cd4ef5f8ac5864cdc8b3e93ff30115f2e27
author chemteam
date Mon, 08 Oct 2018 05:31:29 -0400
parents
children ddb1ae2cf028
comparison
equal deleted inserted replaced
-1:000000000000 0:0b8a0ce446f5
1 <tool id="packmol" name="PACKMOL" version="18.169">
2 <description>Initial configurations for Molecular Dynamics Simulations by packing optimization</description>
3 <macros>
4 <import>macros_packmol.xml</import>
5 </macros>
6 <requirements>
7 <requirement type="package" version="18.169">packmol</requirement>
8 </requirements>
9 <command detect_errors="exit_code">
10 <![CDATA[
11 python '$packmol_script' '$inputs' &&
12 packmol < '$parameteroutfile'
13 ]]>
14 </command>
15 <configfiles>
16 <inputs name="inputs" />
17 <configfile name="packmol_script"><![CDATA[
18
19 import os
20 import sys
21 import json
22
23 from jinja2 import Environment, FileSystemLoader
24
25 input_json_path = sys.argv[1]
26 params = json.load(open(input_json_path, "r"))
27
28 # get the inputs
29 input_iter = []
30 #for $i, $s in enumerate( $packmol_format.packmol_inputs )
31 pmfile_index = $i
32 pmfile_path = "${s.input.file_name}"
33 input_iter.append(pmfile_path)
34 params["packmol_format"]["packmol_inputs"][pmfile_index]["file"] = pmfile_path
35 params["packmol_format"]["packmol_inputs"][pmfile_index]["datasetname"] = "${s.input.name}"
36 #end for
37
38 params["outfile"] = "$outfile"
39
40 currentpath = "$__tool_directory__" # should work generally
41 template_environment = Environment(loader=FileSystemLoader(currentpath),lstrip_blocks=True, trim_blocks=True)
42 template = template_environment.get_template('template.j2')
43 print(params)
44
45 with open("$parameteroutfile",'w+') as f:
46 f.write(template.render(params))
47
48 ]]>
49 </configfile>
50 </configfiles>
51 <inputs>
52 <conditional name="packmol_format">
53 <param name="selected_format" type="select" label="Select a file format:">
54 <option value="pdb" selected="true">pdb</option>
55 <!--option value="xyz">xyz</option>
56 <option value="tinker">tinker</option>
57 <option value="moldy">moldy</option-->
58 </param>
59 <when value="pdb">
60 <expand macro="multiple_input" name="packmol_inputs" format="pdb" label="pdb input with molecule type" help_text="Select a pdb file in .pdb format"/>
61 </when>
62 <!--when value="xyz">
63 <expand macro="multiple_input" name="packmol_inputs" format="xyz" label="xyz input with molecule type" help_text="Select a xyz file in .xyz format"/>
64 </when>
65 <when value="tinker">
66 <expand macro="multiple_input" name="packmol_inputs" format="tinker" label="tinker input with molecule type" help_text="Select a tinker file in .tinker format"/>
67 </when>
68 <when value="moldy">
69 <expand macro="multiple_input" name="packmol_inputs" format="moldy" label="moldy input with molecule type" help_text="Select a moldy file in .moldy format"/>
70 </when-->
71 </conditional>
72 <section name="allparams" title="General Parameters" expanded="false">
73 <param name="tolerance" type="float" value="2.0" label="distance tolerance" min="0.0" max="100.0"/>
74 <param name="nloop" type="integer" value="20" label="maximum number of optimisation loops" min="1" max="10000"/>
75 <param name="maxit" type="integer" value="20" label="maximum number of gencan iterations per loop" min="1" max="10000"/>
76 <param name="seed" type="integer" value="-1" label="random number generator seed, default of -1 used the computer time to set the seed" />
77 </section>
78 </inputs>
79 <outputs>
80 <data format="pdb" name="outfile" label="${tool.name}: structure output">
81 <change_format>
82 <when input="selected_format" value="pdb" format="pdb"/>
83 <!-- <when input="selected_format" value="xyz" format="xyz"/>
84 <when input="selected_format" value="tinker" format="tinker"/>
85 <when input="selected_format" value="moldy" format="moldy"/> -->
86 </change_format>
87 </data>
88 <data format="txt" name="parameteroutfile" label="${tool.name}: parameter output"/>
89 </outputs>
90 <tests>
91 <test>
92 <param name="selected_format" value="pdb"/>
93 <param name="packmol_inputs_0|input" value="water.pdb" ftype="pdb"/>
94 <param name="allparams.seed" value="101"/>
95 <output name="outfile" file="packmol_outfile1.pdb" compare="sim_size" delta="100000">
96 <assert_contents>
97 <has_text text="HETATM 300 O HOH"/>
98 </assert_contents>
99 </output>
100 <output name="parameteroutfile" file="packmol_parameteroutfile_1.txt" compare="diff" lines_diff="6"/>
101 </test>
102 <test>
103 <param name="selected_format" value="pdb"/>
104 <param name="packmol_inputs_0|input" value="water.pdb" ftype="pdb"/>
105 <param name="packmol_inputs_1|input" value="urea.pdb" ftype="pdb"/>
106 <param name="packmol_inputs_0|structureparams|number" value="1000"/>
107 <param name="packmol_inputs_1|structureparams|number" value="400"/>
108 <param name="packmol_inputs_0|structureparams|constraints_repeat_0|constraints|constraint" value="box"/>
109 <param name="packmol_inputs_0|structureparams|constraints_repeat_0|constraints|xmax" value="40.0"/>
110 <param name="packmol_inputs_0|structureparams|constraints_repeat_0|constraints|ymax" value="40.0"/>
111 <param name="packmol_inputs_0|structureparams|constraints_repeat_0|constraints|zmax" value="40.0"/>
112 <param name="packmol_inputs_1|structureparams|constraints_repeat_0|constraints|constraint" value="box"/>
113 <param name="packmol_inputs_1|structureparams|constraints_repeat_0|constraints|xmax" value="40.0"/>
114 <param name="packmol_inputs_1|structureparams|constraints_repeat_0|constraints|ymax" value="40.0"/>
115 <param name="packmol_inputs_1|structureparams|constraints_repeat_0|constraints|zmax" value="40.0"/>
116 <param name="allparams.seed" value="-1"/>
117 <output name="outfile" file="packmol_outfile2.pdb" compare="sim_size" delta="100000">
118 <assert_contents>
119 <has_text text="HETATM 3000 O HOH"/>
120 <has_text text="HETATM 6200 H 2 B"/>
121 </assert_contents>
122 </output>
123 <output name="parameteroutfile" file="packmol_parameteroutfile_2.txt" compare="diff" lines_diff="6"/>
124 </test>
125 </tests>
126 <help><![CDATA[
127 .. class:: infomark
128
129 **What it does**
130
131 Packmol creates initial MD configurations from input molecules. For example, create a water and urea mixture.
132
133 .. class:: infomark
134
135 **How it works**
136
137 - Select a molecule file type e.g. pdb,xyz
138 - Select single molecule from your history (can select multiple)
139 - For each molecule:
140 - choose how many molecules to create (number variable)
141 - optionally choose:
142 - molecular radius
143 - how to number the molecules (resnumber variable)
144 - choose one or more placement constraint(s). Each constraint has different parameters:
145 - for example, specify placement inside a cube of size 40 Angstroms placed at the origin
146 - all units are in Angstroms for distances and degrees for angles
147
148 .. class:: infomark
149
150 **Outputs created**
151
152 - A pdb file, view this in Galaxy by clicking on visualise and choosing a viewer. The NGLViewer works well for small molecules.
153 - A packmol input script (for debugging and repeatability)
154
155 .. class:: infomark
156
157 **User guide and documentation**
158
159 - Packmol `userguide`_
160 - Calculating the number of molecules using the `volume guesser`_
161
162 .. class:: infomark
163
164 **Known issues**
165
166 - fixed constraint only allows 1 atom but this is not set for the user. user has to set this. Job may fail.
167
168 .. _`userguide`: http://m3g.iqm.unicamp.br/packmol/userguide.shtml#more
169 .. _`volume guesser`: http://m3g.iqm.unicamp.br/packmol/utilities.shtml
170
171 ]]>
172 </help>
173 <citations>
174 <citation type="doi">10.1002/jcc.21224</citation>
175 </citations>
176 </tool>