comparison mmpbsa_mmgbsa.xml @ 0:52e64e8cf203 draft

"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit a68f9fb01e0cfff122aef8ddce5c866c687a4f9a"
author chemteam
date Fri, 28 Feb 2020 03:47:30 -0500
parents
children d09f116dfca5
comparison
equal deleted inserted replaced
-1:000000000000 0:52e64e8cf203
1 <tool id="mmpbsa_mmgbsa" name="mmpbsa mmgbsa" version="@VERSION@">
2 <description>- estimate ligand binding affinities
3 </description>
4 <macros>
5 <import>macros.xml</import>
6 </macros>
7 <expand macro="requirements">
8 <requirement type="package" version="2.11.1">jinja2</requirement>
9 </expand>
10 <command detect_errors="exit_code">
11 <![CDATA[
12 python '$mmpbsa_script' '$inputs' &&
13 export AMBERHOME=\$CONDA_PREFIX &&
14 #if $input.simulation.solvatedcomplex:
15 MMPBSA.py -O -i '$parameteroutfile' -sp '$input.simulation.solvatedcomplex' -cp '$input.simulation.complex' -rp '$input.simulation.receptor' -lp '$input.simulation.ligand' -y '$input.simulation.trajcomplex' -o '$resultoutfile' -do '$decompoutfile'
16 #else:
17 MMPBSA.py -O -i '$parameteroutfile' -cp '$input.simulation.complex' -rp '$input.simulation.receptor' -lp '$input.simulation.ligand' -y '$input.simulation.trajcomplex' -o '$resultoutfile' -do '$decompoutfile'
18 #end if
19
20 ]]>
21 </command>
22 <configfiles>
23 <inputs name="inputs"/>
24 <configfile name="mmpbsa_script">
25 <![CDATA[
26
27 import os
28 import sys
29 import json
30
31 from jinja2 import Environment, FileSystemLoader
32
33 input_json_path = sys.argv[1]
34 params = json.load(open(input_json_path, "r"))
35
36
37 currentpath = "$__tool_directory__" # should work generally
38 template_environment = Environment(loader=FileSystemLoader(currentpath),lstrip_blocks=True, trim_blocks=True)
39 template = template_environment.get_template('template_mmpbsa_mmgbsa.j2')
40 print(params)
41
42 with open("$parameteroutfile",'w+') as f:
43 f.write(template.render(params))
44
45 ]]>
46 </configfile>
47 </configfiles>
48 <inputs>
49 <section name="input" title="Input" expanded="true">
50 <conditional name="simulation">
51 <param name="simtype" type="select" label="Single or Multiple Trajectories" help="For a single complex in water choose Single. For complex, receptor and ligand trajectories choose multiple">
52 <option selected="True" value="single">Single Trajectory Protocol (STP)</option>
53 <option value="multiple">Multiple Trajectory Protocol (MTP)</option>
54 </param>
55 <when value="single">
56 <param format="txt" name="ligand" type="data" label="AMBER prmtop input for Ligand"/>
57 <param format="txt" name="receptor" type="data" label="AMBER prmtop input for Receptor"/>
58 <param format="txt" name="complex" type="data" label="AMBER prmtop input for Complex"/>
59 <param format="txt" optional="true" name="solvatedcomplex" type="data" label="AMBER prmtop input for Solvated Complex" help="This is optional. Not required if trajectory already has solvent removed"/>
60 <param format="netcdf" name="trajcomplex" type="data" label="NetCDF trajectory input for Complex" help="Trajectory of the (solvated) complex"/>
61 </when>
62 <when value="multiple">
63 <param format="txt" name="ligand" type="data" label="AMBER prmtop input for Ligand"/>
64 <param format="txt" name="receptor" type="data" label="AMBER prmtop input for Receptor"/>
65 <param format="txt" name="complex" type="data" label="AMBER prmtop input for Complex"/>
66 <param format="txt" optional="true" name="solvatedcomplex" type="data" label="AMBER prmtop input for Solvated Complex" help="This is optional. Not required if trajectory alraeady has solvent removed"/>
67 <param format="netcdf" name="trajligand" type="data" label="NetCDF trajectory input for Ligand"/>
68 <param format="netcdf" name="trajreceptor" type="data" label="NetCDF trajectory input for Receptor"/>
69 <param format="netcdf" name="trajcomplex" type="data" label="NetCDF trajectory input for Complex"/>
70 </when>
71 </conditional>
72 </section>
73 <section name="allparams" title="General parameters" expanded="false">
74 <param name="startframe" type="integer" value="1" label="First frame to analyse" min="1" max="100000000"/>
75 <param name="endframe" type="integer" value="9999999" label="Final frame to analyse" min="1" max="100000000"/>
76 <param name="interval" type="integer" value="1" label="interval between frames analysed" min="1" max="10000"/>
77 <param name="entropy" type="boolean" checked="true" truevalue="1" falsevalue="0" label="quasi-harmonic entropy calculation" help="Calculate the quasi-harmonic entropy"/>
78 <param name="use_sander" type="boolean" checked="false" label="use sander" truevalue="1" falsevalue="0" help="defaults to false (will use sander if needed)."/>
79 <param name="verbose" type="integer" value="2" label="verbosity" min="0" max="3" help="0 - not verbose 3 - ultra verbose"/>
80 <param name="keep_files" type="boolean" checked="false" truevalue="1" falsevalue="0" label="keep additional files" help="defaults to false, no extra files kept"/>
81 <param name="strip_mask" type="text" value=":WAT:Cl-:Na+" label="Strip mask" help="Enter a mask for removing unneeded atoms (water/ions)from the solvated prmtop"/>
82 </section>
83 <section name="calcdetails" title="Details of calculation and parameters" expanded="true">
84 <conditional name="gbcalc">
85 <param name="calctype" type="select" label="General Born calculation" help="Choose carry out General Born Calculation">
86 <option selected="True" value="yes">yes</option>
87 <option value="no">no</option>
88 </param>
89 <when value="yes">
90 <param name="igb" type="integer" value="5" label="igb GB model" min="0" max="7" help="5 - default"/>
91 <param name="saltcon" type="float" value="0.150" label="Salt Concentration (M)" min="0.0" max="2.0"/>
92 </when>
93 <when value="no"></when>
94 </conditional>
95 <conditional name="pbcalc">
96 <param name="calctype" type="select" label="Poisson Boltzman calculation" help="Choose carry out Poisson Boltzman Calculation">
97 <option value="yes">yes</option>
98 <option selected="True" value="no">no</option>
99 </param>
100 <when value="yes">
101 <param name="istrng" type="float" value="0.15" label="Ionic Strength (M)" min="0.0" max="2.0"/>
102 <param name="fillratio" type="float" value="4.0" label="Fill ratio" help="The ratio between the longest dimension of the rectangular finite-difference grid and that of the solute" min="0.0" max="10.0"/>
103 <param name="inp" type="integer" value="1" label="Nonpolar solvation method" min="1" max="2" help="1 - default"/>
104 <param name="radiopt" type="integer" value="0" label="Use optimized radii?" min="0" max="2" help="0 - default do not use these"/>
105 </when>
106 <when value="no"></when>
107 </conditional>
108 <conditional name="decomposition">
109 <param name="decomposition" type="select" label="Decomposition Analysis" help="Choose to carry out decomposition analysis">
110 <option selected="True" value="yes">yes</option>
111 <option value="no">no</option>
112 </param>
113 <when value="yes">
114 <param name="csv_format" type="boolean" checked="true" truevalue="1" falsevalue="0" label="CSV format" help="Defaults to true, CSV format. Choose false for unformatted text output"/>
115 <param name="dec_verbose" type="integer" value="1" label="Decomposition Verbosity" min="0" max="2" help="choose how verbose the output is. 0 - not verbose, 2- very verbose"/>
116 <param name="idecomp" type="integer" value="1" label="Energy Decomposition Scheme" min="1" max="4" help="choose an energy decomposition scheme. 1 - 2 - 3 - 4"/>
117 </when>
118 <when value="no"></when>
119 </conditional>
120 </section>
121 </inputs>
122 <outputs>
123 <data format="txt" name="resultoutfile" label="${tool.name}: Statistics"/>
124 <data format="txt" name="decompoutfile" label="${tool.name}: Decomposition Statistics"/>
125 <data format="txt" name="parameteroutfile" label="${tool.name}: parameter output"/>
126 </outputs>
127 <tests>
128 <test>
129 <param name="ligand" value="ligand.prmtop" ftype="txt"/>
130 <param name="receptor" value="receptor.prmtop" ftype="txt"/>
131 <param name="complex" value="complex.prmtop" ftype="txt"/>
132 <param name="trajcomplex" value="1err_desolvated_mini.nc" ftype="netcdf"/>
133 <conditional name="allparams">
134 <param name="entropy" value="false"/>
135 </conditional>
136 <conditional name="gbcalc">
137 <param name="calctype" value="yes"/>
138 <param name="igb" value="2"/>
139 <param name="saltcon" value="0.100"/>
140 </conditional>
141 <conditional name="decomposition">
142 <param name="decomposition" value="no"/>
143 </conditional>
144 <output name="resultoutfile">
145 <assert_contents>
146 <has_text text="GENERALIZED BORN:"/>
147 <has_text text="DELTA TOTAL -53."/>
148 </assert_contents>
149 </output>
150 </test>
151 <test>
152 <param name="ligand" value="ligand.prmtop" ftype="txt"/>
153 <param name="receptor" value="receptor.prmtop" ftype="txt"/>
154 <param name="complex" value="complex.prmtop" ftype="txt"/>
155 <param name="trajcomplex" value="1err_desolvated_mini.nc" ftype="netcdf"/>
156 <conditional name="allparams">
157 <param name="startframe" value="1"/>
158 <param name="endframe" value="1"/>
159 <param name="entropy" value="false"/>
160 </conditional>
161 <conditional name="gbcalc">
162 <param name="calctype" value="yes"/>
163 <param name="igb" value="2"/>
164 <param name="saltcon" value="0.100"/>
165 </conditional>
166 <conditional name="pbcalc">
167 <param name="calctype" value="yes"/>
168 <param name="istrng" value="0.100"/>
169 </conditional>
170 <conditional name="decomposition">
171 <param name="decomposition" value="yes"/>
172 </conditional>
173 <output name="resultoutfile">
174 <assert_contents>
175 <has_text text="GENERALIZED BORN:"/>
176 <has_text text="DELTA TOTAL -56."/>
177 <has_text text="POISSON BOLTZMANN:"/>
178 <has_text text="DELTA TOTAL -47"/>
179 </assert_contents>
180 </output>
181 <output name="decompoutfile">
182 <assert_contents>
183 <has_text text="idecomp = 1: Per-residue decomp adding 1-4 interactions to Internal"/>
184 <has_text text="HIE 240,R HIE 240"/>
185 <has_text text="RAL 241,L RAL 1,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0"/>
186 </assert_contents>
187 </output>
188 </test>
189 </tests>
190 <help>
191 <![CDATA[
192 .. class:: infomark
193
194 **What it does**
195
196 This tool calculates the Molecular Mechanics Poisson-Boltzman Surface Area (MMPBSA) which is an estimate of the binding free energy between a ligand and a receptor.
197
198 .. class:: infomark
199
200 **How it works**
201
202 Prior to using this tool simulations of the ligand complexed with the receptor must be run. This tool, which wraps AmberTools will need a prmtop (Amber style parameter topology file for the receptor, ligand and the complex) and the trajectory in netCDF format.
203
204 - Single Trajectory Estimate: A simulation of the complex in water is run in advance. The trajectory of this complex is used to estimate the MMPBSA or MMGBSA depending on the options chosen. A General Born (GB) calculation is recommended as this calculation finishes quickly.
205 - Multiple Trajectory Estimate: A simulation of the complex in water, the receptor in water and the ligand in water are run in advance. This is useful the ligand is expected to have a significantly different conformation in solution vs in the complex. The trajectory of this complex is used to estimate the MMPBSA or MMGBSA depending on the options chosen. A General Born (GB) calculation is recommended as this calculation finishes quickly.
206
207 .. class:: infomark
208
209 **Outputs created**
210
211 - The statistics file which includes all information about the frames analysed and average energies. The DELTA G binding is estimated. If negative this is a favourable binding. Note that by default the entropy contribution to binding (unfavourable) is not calculated. A normal mode analysis is needed.
212 - The decomposition file contains a breakdown of each residues contribution to the energy. For example using the default Energy Decomposition Scheme (1) the interaction of each residue with the rest of the system is calculated and listed.
213 - The parameter file contains the input parameters passed from Galaxy to MMPBSA.py in the expected MMPBSA input format.
214
215 .. class:: infomark
216
217 **User guide and documentation**
218
219 - The `AmberTools Manual`_
220 - The `Amber Tutorial`_ on using MMPBSA.py
221 - There are many more complex flags available. This Galaxy wrapper only supports GB and PB binding free energies and decomposition. Parallel calculations are not supported at present.
222 - This Galaxy tool is based on MMPBSA.py. More details on options that are not details in the Manual and Tutorials can be found in the code - see "$CONDA_PREFIX/lib/python3.7/site-packages/MMPBSA_mods/input_parser.py" and "$CONDA_PREFIX/lib/python3.7/site-packages/MMPBSA_mods/main.py".
223
224 .. class:: infomark
225
226 **Test data**
227
228 - The test data for this tool comes from an `Amber Tutorial`_ and the original dataset_ is available.
229 - For convenience, water has been stripped from the .mdcrd trajectory and this has been converted to netcdf format.
230
231 .. code-block:: python
232
233 import mdtraj as md
234 traj = md.load('1err_prod.mdcrd', top='1err.solvated.prmtop')
235 topology = traj.topology
236 atoms_to_keep = topology.select('not water')
237 traj.restrict_atoms(atoms_to_keep)
238 traj.save('1err_desolvated.nc')
239 traj[0:2].save('1err_desolvated_mini.nc')
240
241
242 .. _`Amber Tutorial`: http://ambermd.org/tutorials/advanced/tutorial3/py_script/index.htm
243 .. _`AmberTools Manual`: https://ambermd.org/doc12/Amber18.pdf
244 .. _dataset: http://ambermd.org/tutorials/advanced/tutorial3/py_script/files/Est_Rec_top_mdcrd.tgz
245
246
247 ]]>
248 </help>
249 <expand macro="citations">
250 <expand macro="mmpbsa_citation"/>
251 </expand>
252 </tool>