annotate packmol.xml @ 0:db62543db01a draft

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