Previous changeset 5:c410ffcabf9d (2019-05-07) Next changeset 7:7b2f205b3f68 (2019-10-02) |
Commit message:
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/autodock_vina commit a2f6034a691af458e3df662e36d7f05617982bdc |
modified:
docking.xml |
added:
convert_pdbqt_to_sdf.py test-data/NuBBE_1_obabel_3D_-_3u1i_for_DM.sdf |
b |
diff -r c410ffcabf9d -r 0ae768a0e5c0 convert_pdbqt_to_sdf.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/convert_pdbqt_to_sdf.py Wed Jun 19 06:43:41 2019 -0400 |
[ |
@@ -0,0 +1,40 @@ +import pybel, openbabel +import sys + + +def main(): + if len(sys.argv) == 3: + process(sys.argv[1], sys.argv[2]) + else: + print("Usage: convert_pdbqt_to_sdf.py <input-pdbqt-file> <output-sdf-file>") + exit(1) + +def add_property(mol, prop_name, prop_value): + newData = openbabel.OBPairData() + newData.SetAttribute(prop_name) + newData.SetValue(prop_value) + mol.OBMol.CloneData(newData) + +def process(input, output): + docked = pybel.readfile('pdbqt', input) + sdf = pybel.Outputfile("sdf", output, overwrite=True) + for mol in docked: + if mol.OBMol.HasData('REMARK'): + remark = mol.OBMol.GetData('REMARK').GetValue() + lines = remark.splitlines() + tokens = lines[0].split() + + # add the score property + add_property(mol, "SCORE", tokens[2]) + # add the first RMSD property + add_property(mol, "RMSD_LB", tokens[3]) + # add the second RMSD property + add_property(mol, "RMSD_UB", tokens[4]) + + sdf.write(mol) + + sdf.close() + +if __name__ == "__main__": + main() + |
b |
diff -r c410ffcabf9d -r 0ae768a0e5c0 docking.xml --- a/docking.xml Tue May 07 13:31:43 2019 -0400 +++ b/docking.xml Wed Jun 19 06:43:41 2019 -0400 |
b |
b'@@ -1,7 +1,8 @@\n-<tool id="docking" name="Docking" version="0.2.0">\n+<tool id="docking" name="Docking" version="0.2.1">\n <description>tool to perform protein-ligand docking with Autodock Vina</description>\n <requirements>\n <requirement type="package" version="1.1.2">autodock-vina</requirement>\n+ <requirement type="package" version="2.4.1">openbabel</requirement>\n </requirements>\n <stdio>\n <exit_code range="1" />\n@@ -20,8 +21,8 @@\n --energy_range 9999 \n --receptor \'$receptor\' \n --ligand \'$ligand\' \n- --out \'$file_output1\' \n- --log \'$file_output2\' \n+ --out \'./output1.dat\' \n+ --log \'./output2.dat\' \n --cpu \\${GALAXY_SLOTS:-1}\n #if $config_params.seed.seed == \'true\':\n --seed \'$config_params.seed.seed_value\'\n@@ -32,10 +33,18 @@\n --config \'$config_params.box\' \n --receptor \'$receptor\' \n --ligand \'$ligand\' \n- --out \'$file_output1\' \n- --log \'$file_output2\' \n+ --out \'./output1.dat\' \n+ --log \'./output2.dat\'\n --cpu \\${GALAXY_SLOTS:-1}\n-\n+ #if $config_params.exh != "":\n+ --exhaustiveness $config_params.exh\n+ #end if\n+ #end if\n+ #if $output_format == \'sdf\':\n+ && python \'$__tool_directory__/convert_pdbqt_to_sdf.py\' \'./output1.dat\' \'$sdf_output\' \n+ #else\n+ && mv ./output1.dat \'$file_output1\'\n+ && mv ./output2.dat \'$file_output2\'\n #end if\n \n ]]></command>\n@@ -65,15 +74,27 @@\n </when>\n <when value="file">\n <param type="data" name="box" format="txt" label="Box configuration" help="Text file with the box configurations" />\n+ <param type="integer" name="exh" label="Exhaustiveness" help="The number of poses to return from the docking job (optional, will override any value specified in the config file)" optional="true"/>\n </when>\n </conditional>\n+ <param type="select" name="output_format" label="Output format" help="Select a format for the output files">\n+ <option value="pdbqt" selected="true">PDBQT (and separate log file with binding scores)</option>\n+ <option value="sdf">SDF</option>\n+ </param>\n </inputs>\n <outputs>\n- <data name="file_output1" format="pdbqt" />\n- <data name="file_output2" format="txt" />\n+ <data name="file_output1" format="pdbqt">\n+ <filter>output_format == \'pdbqt\'</filter>\n+ </data>\n+ <data name="file_output2" format="txt">\n+ <filter>output_format == \'pdbqt\'</filter>\n+ </data>\n+ <data name="sdf_output" format="sdf">\n+ <filter>output_format == \'sdf\'</filter>\n+ </data>\n </outputs>\n <tests>\n- <test>\n+ <test expect_num_outputs="2">\n <param name="receptor" value="3u1i_for_DM.pdbqt"/>\n <param name="ligand" value="NuBBE_1_obabel_3D.pdbqt"/>\n <param name="config_params" value="vals"/>\n@@ -85,32 +106,140 @@\n <param name="size_z" value="23.60" />\n <param name="seed" value="true" />\n <param name="seed_value" value="1" />\n- <param name="exhaustivenesss" value="10" />\n+ <param name="exhaustiveness" value="10" />\n+ <param name="output_format" value="pdbqt" />\n <output name="file_output1" file="NuBBE_1_obabel_3D_-_3u1i_for_DM.pdbqt"/>\n <output name="file_output2" file="NuBBE_1_obabel_3D_-_3u1i_for_DM.log"/>\n </test>\n- <test>\n+ <test expect_num_outputs="2">\n <param name="receptor" value="3u1i_for_DM.pdbqt"/>\n <param name="ligand" value="NuBBE_1_obabel_3D.pdbqt"/>\n <param name="config_params" value="f'..b"es a cuboidal volume in which docking is performed. Alternatively, a config file can be uploaded containing this information - such a file can be generated from the box parameter calculation file. \n \n+A format for the output should also be selected: the available options are PDBQT or SDF.\n+\n+-----\n+\n+.. class:: infomark\n+\n **Outputs**\n \n-Two outputs are generated by this tool. The first is another pdbqt file containing the molecular structure resulting from docking, such as the following example::\n+Either PDBQT or SDF may be selected as output.\n+\n+**Option 1: SDF**\n+\n+An SDF file is produced as output. The binding affinity scores are also contained within the SDF file.::\n+\n+ OpenBabel06171915303D\n+\n+ 23 23 0 0 0 0 0 0 0 0999 V2000\n+ 66.9030 73.3450 36.0040 O 0 0 0 0 0 0 0 0 0 0 0 0\n+ 66.8190 73.2170 37.2120 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 66.0490 72.3370 37.8940 O 0 0 0 0 0 0 0 0 0 0 0 0\n+ 66.2290 70.9500 37.5970 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 67.2070 70.4140 38.6010 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 68.5140 70.1440 38.3980 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 69.2150 70.3400 37.0800 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 69.3810 69.5970 39.5210 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 68.7730 69.8280 40.9100 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 69.3750 71.0120 41.6220 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 68.7550 72.1570 41.9760 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 67.3280 72.4970 41.6430 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 69.4770 73.2270 42.7560 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 67.5570 74.0540 38.1920 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 66.9010 75.0480 38.9340 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 67.6300 75.8170 39.8300 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 68.9950 75.5990 39.9980 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 69.6510 74.6060 39.2850 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 68.9300 73.8240 38.3800 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 67.0450 76.8040 40.5760 O 0 0 0 0 0 0 0 0 0 0 0 0\n+ 67.5560 77.4980 40.9760 H 0 0 0 0 0 0 0 0 0 0 0 0\n+ 69.7010 76.3670 40.8780 O 0 0 0 0 0 0 0 0 0 0 0 0\n+ 69.2520 76.7930 41.5990 H 0 0 0 0 0 0 0 0 0 0 0 0\n+ 1 2 2 0 0 0 0\n+ 2 3 1 0 0 0 0\n+ 2 14 1 0 0 0 0\n+ 4 3 1 0 0 0 0\n+ 4 5 1 0 0 0 0\n+ 6 5 2 0 0 0 0\n+ 6 8 1 0 0 0 0\n+ 7 6 1 0 0 0 0\n+ 8 9 1 0 0 0 0\n+ 9 10 1 0 0 0 0\n+ 10 11 2 0 0 0 0\n+ 11 13 1 0 0 0 0\n+ 12 11 1 0 0 0 0\n+ 14 19 2 0 0 0 0\n+ 14 15 1 0 0 0 0\n+ 15 16 2 0 0 0 0\n+ 16 17 1 0 0 0 0\n+ 16 20 1 0 0 0 0\n+ 17 22 1 0 0 0 0\n+ 18 17 2 0 0 0 0\n+ 19 18 1 0 0 0 0\n+ 20 21 1 0 0 0 0\n+ 22 23 1 0 0 0 0\n+ M END\n+ > <MODEL>\n+ 1\n+\n+ > <REMARK>\n+ VINA RESULT: 0.0 0.000 0.000\n+ 9 active torsions:\n+ status: ('A' for Active; 'I' for Inactive)\n+ 1 A between atoms: C_2 and O_3 \n+ 2 A between atoms: C_2 and C_14 \n+ 3 A between atoms: O_3 and C_4 \n+ 4 A between atoms: C_4 and C_5 \n+ 5 A between atoms: C_6 and C_8 \n+ 6 A between atoms: C_8 and C_9 \n+ 7 A between atoms: C_9 and C_10 \n+ 8 A between atoms: C_16 and O_17 \n+ 9 A between atoms: C_19 and O_20 \n+\n+ > <TORSDO>\n+ F 9\n+\n+ > <SCORE>\n+ 0.0\n+\n+ > <RMSD_LB>\n+ 0.000\n+\n+ > <RMSD_UB>\n+ 0.000\n+\n+\n+**Option 2: PDBQT**\n+\n+Two outputs are generated if PDBQT output is selected. The first is another pdbqt file containing the molecular structure resulting from docking, such as the following example::\n \n MODEL 1\n REMARK VINA RESULT: -0.0 0.000 0.000\n" |
b |
diff -r c410ffcabf9d -r 0ae768a0e5c0 test-data/NuBBE_1_obabel_3D_-_3u1i_for_DM.sdf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/NuBBE_1_obabel_3D_-_3u1i_for_DM.sdf Wed Jun 19 06:43:41 2019 -0400 |
b |
b"@@ -0,0 +1,1620 @@\n+./output1.dat\n+ OpenBabel06171915303D\n+\n+ 23 23 0 0 0 0 0 0 0 0999 V2000\n+ 66.9030 73.3450 36.0040 O 0 0 0 0 0 0 0 0 0 0 0 0\n+ 66.8190 73.2170 37.2120 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 66.0490 72.3370 37.8940 O 0 0 0 0 0 0 0 0 0 0 0 0\n+ 66.2290 70.9500 37.5970 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 67.2070 70.4140 38.6010 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 68.5140 70.1440 38.3980 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 69.2150 70.3400 37.0800 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 69.3810 69.5970 39.5210 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 68.7730 69.8280 40.9100 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 69.3750 71.0120 41.6220 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 68.7550 72.1570 41.9760 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 67.3280 72.4970 41.6430 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 69.4770 73.2270 42.7560 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 67.5570 74.0540 38.1920 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 66.9010 75.0480 38.9340 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 67.6300 75.8170 39.8300 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 68.9950 75.5990 39.9980 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 69.6510 74.6060 39.2850 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 68.9300 73.8240 38.3800 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 67.0450 76.8040 40.5760 O 0 0 0 0 0 0 0 0 0 0 0 0\n+ 67.5560 77.4980 40.9760 H 0 0 0 0 0 0 0 0 0 0 0 0\n+ 69.7010 76.3670 40.8780 O 0 0 0 0 0 0 0 0 0 0 0 0\n+ 69.2520 76.7930 41.5990 H 0 0 0 0 0 0 0 0 0 0 0 0\n+ 1 2 2 0 0 0 0\n+ 2 3 1 0 0 0 0\n+ 2 14 1 0 0 0 0\n+ 4 3 1 0 0 0 0\n+ 4 5 1 0 0 0 0\n+ 6 5 2 0 0 0 0\n+ 6 8 1 0 0 0 0\n+ 7 6 1 0 0 0 0\n+ 8 9 1 0 0 0 0\n+ 9 10 1 0 0 0 0\n+ 10 11 2 0 0 0 0\n+ 11 13 1 0 0 0 0\n+ 12 11 1 0 0 0 0\n+ 14 19 2 0 0 0 0\n+ 14 15 1 0 0 0 0\n+ 15 16 2 0 0 0 0\n+ 16 17 1 0 0 0 0\n+ 16 20 1 0 0 0 0\n+ 17 22 1 0 0 0 0\n+ 18 17 2 0 0 0 0\n+ 19 18 1 0 0 0 0\n+ 20 21 1 0 0 0 0\n+ 22 23 1 0 0 0 0\n+M END\n+> <MODEL>\n+1\n+\n+> <REMARK>\n+ VINA RESULT: 0.0 0.000 0.000\n+ 9 active torsions:\n+ status: ('A' for Active; 'I' for Inactive)\n+ 1 A between atoms: C_2 and O_3 \n+ 2 A between atoms: C_2 and C_14 \n+ 3 A between atoms: O_3 and C_4 \n+ 4 A between atoms: C_4 and C_5 \n+ 5 A between atoms: C_6 and C_8 \n+ 6 A between atoms: C_8 and C_9 \n+ 7 A between atoms: C_9 and C_10 \n+ 8 A between atoms: C_16 and O_17 \n+ 9 A between atoms: C_19 and O_20 \n+\n+> <TORSDO>\n+F 9\n+\n+> <SCORE>\n+0.0\n+\n+> <RMSD_LB>\n+0.000\n+\n+> <RMSD_UB>\n+0.000\n+\n+$$$$\n+./output1.dat\n+ OpenBabel06171915303D\n+\n+ 23 23 0 0 0 0 0 0 0 0999 V2000\n+ 66.6610 72.1980 38.7380 O 0 0 0 0 0 0 0 0 0 0 0 0\n+ 66.7310 71.5290 37.7240 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 66.8850 70.1860 37.6330 O 0 0 0 0 0 0 0 0 0 0 0 0\n+ 65.9100 69.3760 38.2940 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 64.8700 69.0260 37.2700 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 63.6420 69.5710 37.1410 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 63.1050 70.6500 38.0430 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 62.6920 69.1050 36.0480 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 63.4080 68.3600 34.9150 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 63.6580 69.2300 33.7100 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 64.8520 69.6150 33.2110 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 66.1830 69.2970 33.8330 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 64.9420 70.4310 31.9460 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 66.6870 72.0910 36.3500 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 67.8460 72.1740"..b" 1 0 0 0 0\n+ 5 4 1 0 0 0 0\n+ 5 6 2 0 0 0 0\n+ 6 7 1 0 0 0 0\n+ 8 6 1 0 0 0 0\n+ 9 8 1 0 0 0 0\n+ 10 9 1 0 0 0 0\n+ 11 10 2 0 0 0 0\n+ 12 11 1 0 0 0 0\n+ 13 11 1 0 0 0 0\n+ 14 2 1 0 0 0 0\n+ 14 19 2 0 0 0 0\n+ 15 14 1 0 0 0 0\n+ 16 15 2 0 0 0 0\n+ 16 17 1 0 0 0 0\n+ 17 18 2 0 0 0 0\n+ 18 19 1 0 0 0 0\n+ 20 16 1 0 0 0 0\n+ 21 20 1 0 0 0 0\n+ 22 17 1 0 0 0 0\n+ 23 22 1 0 0 0 0\n+M END\n+> <MODEL>\n+19\n+\n+> <REMARK>\n+ VINA RESULT: 0.0 5.737 8.627\n+ 9 active torsions:\n+ status: ('A' for Active; 'I' for Inactive)\n+ 1 A between atoms: C_2 and O_3 \n+ 2 A between atoms: C_2 and C_14 \n+ 3 A between atoms: O_3 and C_4 \n+ 4 A between atoms: C_4 and C_5 \n+ 5 A between atoms: C_6 and C_8 \n+ 6 A between atoms: C_8 and C_9 \n+ 7 A between atoms: C_9 and C_10 \n+ 8 A between atoms: C_16 and O_17 \n+ 9 A between atoms: C_19 and O_20 \n+\n+> <TORSDO>\n+F 9\n+\n+> <SCORE>\n+0.0\n+\n+> <RMSD_LB>\n+5.737\n+\n+> <RMSD_UB>\n+8.627\n+\n+$$$$\n+./output1.dat\n+ OpenBabel06171915303D\n+\n+ 23 23 0 0 0 0 0 0 0 0999 V2000\n+ 66.6420 67.4990 40.1730 O 0 0 0 0 0 0 0 0 0 0 0 0\n+ 66.8380 68.6440 40.5360 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 67.8530 69.1000 41.3080 O 0 0 0 0 0 0 0 0 0 0 0 0\n+ 69.1820 68.8470 40.8480 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 69.6150 70.0630 40.0810 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 69.6800 70.1970 38.7400 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 69.3200 69.1030 37.7690 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 70.1450 71.5000 38.1080 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 70.0730 72.6890 39.0730 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 68.8480 73.5420 38.8600 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 67.8250 73.7350 39.7180 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 67.6850 73.0530 41.0510 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 66.7000 74.6830 39.3890 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 65.9480 69.7870 40.2070 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 65.0990 70.3450 41.1740 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 64.2740 71.4040 40.8210 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 64.2960 71.9130 39.5250 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 65.1460 71.3820 38.5650 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 65.9820 70.3160 38.9060 C 0 0 0 0 0 0 0 0 0 0 0 0\n+ 63.4210 71.9850 41.7190 O 0 0 0 0 0 0 0 0 0 0 0 0\n+ 62.7920 72.6460 41.4570 H 0 0 0 0 0 0 0 0 0 0 0 0\n+ 63.4750 72.9500 39.1890 O 0 0 0 0 0 0 0 0 0 0 0 0\n+ 62.7330 72.7990 38.6140 H 0 0 0 0 0 0 0 0 0 0 0 0\n+ 1 2 2 0 0 0 0\n+ 2 3 1 0 0 0 0\n+ 4 3 1 0 0 0 0\n+ 5 4 1 0 0 0 0\n+ 6 5 2 0 0 0 0\n+ 7 6 1 0 0 0 0\n+ 8 6 1 0 0 0 0\n+ 8 9 1 0 0 0 0\n+ 10 9 1 0 0 0 0\n+ 10 11 2 0 0 0 0\n+ 11 12 1 0 0 0 0\n+ 13 11 1 0 0 0 0\n+ 14 2 1 0 0 0 0\n+ 14 15 2 0 0 0 0\n+ 16 15 1 0 0 0 0\n+ 16 20 1 0 0 0 0\n+ 17 16 2 0 0 0 0\n+ 18 19 2 0 0 0 0\n+ 18 17 1 0 0 0 0\n+ 19 14 1 0 0 0 0\n+ 21 20 1 0 0 0 0\n+ 22 17 1 0 0 0 0\n+ 23 22 1 0 0 0 0\n+M END\n+> <MODEL>\n+20\n+\n+> <REMARK>\n+ VINA RESULT: 0.0 2.715 4.755\n+ 9 active torsions:\n+ status: ('A' for Active; 'I' for Inactive)\n+ 1 A between atoms: C_2 and O_3 \n+ 2 A between atoms: C_2 and C_14 \n+ 3 A between atoms: O_3 and C_4 \n+ 4 A between atoms: C_4 and C_5 \n+ 5 A between atoms: C_6 and C_8 \n+ 6 A between atoms: C_8 and C_9 \n+ 7 A between atoms: C_9 and C_10 \n+ 8 A between atoms: C_16 and O_17 \n+ 9 A between atoms: C_19 and O_20 \n+\n+> <TORSDO>\n+F 9\n+\n+> <SCORE>\n+0.0\n+\n+> <RMSD_LB>\n+2.715\n+\n+> <RMSD_UB>\n+4.755\n+\n+$$$$\n" |