Mercurial > repos > bgruening > autodock_vina_prepare_box
comparison calc_vina_box_params.py @ 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 |
comparison
equal
deleted
inserted
replaced
1:4f7c5cad3377 | 2:73c2c9774c2d |
---|---|
26 dims = np.abs(coords1 - coords2) | 26 dims = np.abs(coords1 - coords2) |
27 | 27 |
28 # optionally add buffers in each direction - expansion | 28 # optionally add buffers in each direction - expansion |
29 box_dims = [dims[0] + options.bufx, dims[1] + options.bufy, dims[2] + options.bufz] | 29 box_dims = [dims[0] + options.bufx, dims[1] + options.bufy, dims[2] + options.bufz] |
30 | 30 |
31 # if no seed set, then randomly generate one between 0 and 2**31 | 31 optionalvals = "" |
32 if options.seed == None: | 32 |
33 options.seed = randint(0, 2147483647) | 33 |
34 if options.seed != None: | |
35 optionalvals += "seed = " + str(options.seed) + "\n" | |
36 if options.exhaustiveness != None: | |
37 optionalvals += "exhaustiveness = " + str(options.exhaustiveness) + "\n" | |
34 | 38 |
35 with open(options.output, 'w') as f: | 39 with open(options.output, 'w') as f: |
36 f.write( | 40 f.write( |
37 """ | 41 """ |
38 size_x = {} | 42 size_x = {} |
39 size_y = {} | 43 size_y = {} |
40 size_z = {} | 44 size_z = {} |
41 center_x = {} | 45 center_x = {} |
42 center_y = {} | 46 center_y = {} |
43 center_z = {} | 47 center_z = {} |
44 num_modes = 9999 | 48 {}""".format(box_dims[0], box_dims[1], box_dims[2], center[0], center[1], center[2], optionalvals) |
45 energy_range = 9999 | |
46 exhaustiveness = {} | |
47 cpu = 4 | |
48 seed = {} | |
49 """.format(box_dims[0], box_dims[1], box_dims[2], center[0], center[1], center[2], options.exhaustiveness, options.seed) | |
50 ) | 49 ) |
51 | 50 |
52 | 51 |
53 if __name__ == "__main__": | 52 if __name__ == "__main__": |
54 parser = argparse.ArgumentParser(description=""" | 53 parser = argparse.ArgumentParser(description=""" |
59 Optionally, you can include a 'buffer' in each of the x,y and z directions (in Å), | 58 Optionally, you can include a 'buffer' in each of the x,y and z directions (in Å), |
60 which will be added to the confounding box in the appropriate direction. | 59 which will be added to the confounding box in the appropriate direction. |
61 """) | 60 """) |
62 parser.add_argument('--ligand', dest='ligand_path', help='The input ligand (mol file)') | 61 parser.add_argument('--ligand', dest='ligand_path', help='The input ligand (mol file)') |
63 parser.add_argument('--config', dest='output', help='The output file containing calculated params (txt)') | 62 parser.add_argument('--config', dest='output', help='The output file containing calculated params (txt)') |
64 parser.add_argument('--exh', dest='exhaustiveness', default=10, type=int, help='The number of poses ' | 63 parser.add_argument('--exh', dest='exhaustiveness', type=int, help='Exhaustiveness of global search') |
65 'to return from docking job') | |
66 parser.add_argument('--bufx', dest='bufx', default=0, type=float, help='the buffer in the x direction ' | 64 parser.add_argument('--bufx', dest='bufx', default=0, type=float, help='the buffer in the x direction ' |
67 '(float - in angs.)') | 65 '(float - in angs.)') |
68 parser.add_argument('--bufy', dest='bufy', default=0, type=float, help='the buffer in the y direction ' | 66 parser.add_argument('--bufy', dest='bufy', default=0, type=float, help='the buffer in the y direction ' |
69 '(float - in angs.)') | 67 '(float - in angs.)') |
70 parser.add_argument('--bufz', dest='bufz', default=0, type=float, help='the buffer in the z direction ' | 68 parser.add_argument('--bufz', dest='bufz', default=0, type=float, help='the buffer in the z direction ' |