changeset 2:73c2c9774c2d draft

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/autodock_vina commit ef86cfa5f7ab5043de420511211579d03df58645"
author bgruening
date Wed, 02 Oct 2019 12:49:11 -0400
parents 4f7c5cad3377
children 908880455b2d
files calc_vina_box_params.py prepare_box.xml test-data/box_params.txt test-data/box_params_1.txt test-data/box_params_2.txt
diffstat 5 files changed, 43 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/calc_vina_box_params.py	Tue May 07 13:31:59 2019 -0400
+++ b/calc_vina_box_params.py	Wed Oct 02 12:49:11 2019 -0400
@@ -28,9 +28,13 @@
     # optionally add buffers in each direction - expansion
     box_dims = [dims[0] + options.bufx, dims[1] + options.bufy, dims[2] + options.bufz]
 
-    # if no seed set, then randomly generate one between 0 and 2**31
-    if options.seed == None:
-        options.seed = randint(0, 2147483647)
+    optionalvals = ""
+
+
+    if options.seed != None:
+        optionalvals += "seed = " + str(options.seed) + "\n"
+    if options.exhaustiveness != None:
+        optionalvals += "exhaustiveness = " + str(options.exhaustiveness) + "\n"
 
     with open(options.output, 'w') as f:
         f.write(
@@ -41,12 +45,7 @@
 center_x =  {}
 center_y =  {}
 center_z =  {}
-num_modes = 9999
-energy_range = 9999
-exhaustiveness = {}
-cpu = 4
-seed = {}
-            """.format(box_dims[0], box_dims[1], box_dims[2], center[0], center[1], center[2], options.exhaustiveness, options.seed)
+{}""".format(box_dims[0], box_dims[1], box_dims[2], center[0], center[1], center[2], optionalvals)
         )
 
 
@@ -61,8 +60,7 @@
     """)
     parser.add_argument('--ligand', dest='ligand_path', help='The input ligand (mol file)')
     parser.add_argument('--config', dest='output', help='The output file containing calculated params (txt)')
-    parser.add_argument('--exh', dest='exhaustiveness', default=10, type=int, help='The number of poses '
-                                                                                     'to return from docking job')
+    parser.add_argument('--exh', dest='exhaustiveness', type=int, help='Exhaustiveness of global search')
     parser.add_argument('--bufx', dest='bufx', default=0, type=float, help='the buffer in the x direction '
                                                                            '(float - in angs.)')
     parser.add_argument('--bufy', dest='bufy', default=0, type=float, help='the buffer in the y direction '
--- a/prepare_box.xml	Tue May 07 13:31:59 2019 -0400
+++ b/prepare_box.xml	Wed Oct 02 12:49:11 2019 -0400
@@ -6,18 +6,20 @@
     </requirements>
     <command detect_errors="exit_code"><![CDATA[
         python '$__tool_directory__/calc_vina_box_params.py'
-        --ligand '$input1'
-        --config '$output1'
+        --ligand '$ligand'
+        --config '$output'
         --bufx '$bufx'
         --bufy '$bufy'
         --bufz '$bufz'
-        --exh '$exh'
+        #if $exh:
+            --exh '$exh'
+        #end if
         #if $seed_value:
             --seed '$seed_value'
         #end if
     ]]></command>
     <inputs>
-        <param type="data" name="input1" format="mol" label="Input ligand"
+        <param type="data" name="ligand" format="mol" label="Input ligand"
             help="The input ligand (mol file)"/>
         <param name="bufx" type="float" value="0" label="x-axis buffer"
             help="Buffer in the x direction (in angs.)"/>
@@ -25,24 +27,30 @@
             help="Buffer in the y direction (in angs.)"/>
         <param name="bufz" type="float" value="0" label="z-axis buffer"
             help="Buffer in the z direction (in angs.)"/>
-        <param name="exh" type="integer" value="0" label="Exhaustiveness"
-            help="Number of poses to return from docking job"/>
-        <!-- <param name="seed" type="boolean" label="Specify random seed for simulation reproducibility?"/> -->
+        <param name="exh" type="integer" optional="true" label="Exhaustiveness (optional)"
+            help="Exhaustiveness of global search (optional, default = 8)"/>
         <param type="integer" name="seed_value" optional="true" label="Random seed (optional)" 
             help="Choose a seed value; if none is selected, a seed will be chosen randomly"/>
     </inputs>
     <outputs>
-        <data name="output1" format="txt" />
+        <data name="output" format="txt" />
     </outputs>
     <tests>
         <test>
-            <param name="input1" value="NUDT5A-x0114_2.mol" />
+            <param name="ligand" value="NUDT5A-x0114_2.mol" />
+            <param name="bufx" value="1" />
+            <param name="bufy" value="2" />
+            <param name="bufz" value="3" />
+            <output name="output" file="box_params_1.txt" />
+        </test>
+        <test>
+            <param name="ligand" value="NUDT5A-x0114_2.mol" />
             <param name="bufx" value="1" />
             <param name="bufy" value="2" />
             <param name="bufz" value="3" />
             <param name="exh" value="10" />
             <param name="seed_value" value="1" />
-            <output name="output1" file="box_params.txt" />
+            <output name="output" file="box_params_2.txt" />
         </test>
     </tests>
     <help>
--- a/test-data/box_params.txt	Tue May 07 13:31:59 2019 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-
-size_x =  12.443000000000001
-size_y =  11.888
-size_z =  9.290999999999997
-center_x =  -29.8395
-center_y =  4.364
-center_z =  -64.5925
-num_modes = 9999
-energy_range = 9999
-exhaustiveness = 10
-cpu = 4
-seed = 1
-            
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/box_params_1.txt	Wed Oct 02 12:49:11 2019 -0400
@@ -0,0 +1,7 @@
+
+size_x =  12.443000000000001
+size_y =  11.888
+size_z =  9.290999999999997
+center_x =  -29.8395
+center_y =  4.364
+center_z =  -64.5925
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/box_params_2.txt	Wed Oct 02 12:49:11 2019 -0400
@@ -0,0 +1,9 @@
+
+size_x =  12.443000000000001
+size_y =  11.888
+size_z =  9.290999999999997
+center_x =  -29.8395
+center_y =  4.364
+center_z =  -64.5925
+seed = 1
+exhaustiveness = 10