Mercurial > repos > bgruening > rdock_rbdock
changeset 4:a428230b38f6 draft
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/rdock commit db567a29443284f2cec1444ec9db9aa6bd913fad"
author | bgruening |
---|---|
date | Fri, 03 Apr 2020 13:32:13 -0400 |
parents | 1709d2c3dc20 |
children | e4b7d1507a75 |
files | rbdock.py rbdock.xml test-data/broken_ligand.sdf |
diffstat | 3 files changed, 278 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rbdock.py Fri Apr 03 13:32:13 2020 -0400 @@ -0,0 +1,28 @@ +import subprocess +import argparse + +def main(): + parser = argparse.ArgumentParser(description='Simple wrapper for rbdock') + parser.add_argument('-n', '--num', type=int, help='Number of docking poses to generate') + parser.add_argument('-s', '--seed', type=int, help='Random seed') + args = parser.parse_args() + + cmd = ['rbdock', '-i', 'ligands.sdf', '-r', 'receptor.prm', '-p', 'dock.prm', '-n', str(args.num), '-o', 'rdock_output'] + if args.seed != None: + cmd += ['-s', str(args.seed)] + + ps = subprocess.Popen(cmd, stdout=subprocess.PIPE) + + error_counter = 0 + for stdout_line in iter(ps.stdout.readline, ''): + if 'RBT_DOCKING_ERROR' in str(stdout_line): + error_counter += 1 + if error_counter == 10: + print(ps.stdout) + exit(23) + if ps.poll() != None: + print(ps.stdout) + exit(int(ps.poll())) + +if __name__ == "__main__": + main()
--- a/rbdock.xml Tue Mar 17 09:26:29 2020 -0400 +++ b/rbdock.xml Fri Apr 03 13:32:13 2020 -0400 @@ -1,4 +1,4 @@ -<tool id="rdock_rbdock" name="rDock docking" version="0.1.2"> +<tool id="rdock_rbdock" name="rDock docking" version="0.1.3" profile="19.01"> <description>- perform protein-ligand docking with rDock</description> <macros> <import>rdock_macros.xml</import> @@ -13,15 +13,30 @@ #else ln -s '$ligands' ligands.sdf && #end if -rbdock -i ligands.sdf -r receptor.prm -p dock.prm -n $num -o output && -sdsort -n -s -fSCORE output.sd | -#if $score: - sdfilter -f'\$SCORE <= $score' | + +python '$__tool_directory__/rbdock.py' + -n '$num' + #if $seed: + -s '$seed' + #end if + && + +cat rdock_output.sd + +#if $filter.filter_select == "filter": + #if $filter.score: + | sdfilter -f'\$SCORE <= ${filter.score}' + #end if + #if $filter.nscore: + | sdfilter -f'\$SCORE.norm <= ${filter.nscore}' + #end if + #if $filter.top + | sdsort -n -s -fSCORE | sdfilter -f'\$_COUNT <= $filter.top' + #end if #end if -#if $nscore: - sdfilter -f'\$SCORE.norm <= $nscore' | -#end if -sdfilter -f'\$_COUNT <= $top' > '$output' + + > '$output' + ]]></command> <configfiles> @@ -36,28 +51,57 @@ <param type="data" name="active_site" format="rdock_as" label="Active site" help="Active site file"/> <param type="data" name="ligands" format="sdf,mol" label="Ligands" help="Ligands in SDF format (or single ligand in MOL format)"/> <param name="num" type="integer" value="10" label="Number of dockings" help="Number of poses to generate"/> - <param name="top" type="integer" value="1" label="Number of best poses" help="Number of best scoring poses to keep"/> - <param name="score" type="float" optional="true" label="Score filter" - help="Exclude poses with score greater than this value"/> - <param name="nscore" type="float" optional="true" label="Normalised score filter" - help="Exclude poses with normalised score greater than this value"/> + <conditional name="filter"> + <param name="filter_select" type="select" label="Filter the docking results" help="Using sdfilter"> + <option value="filter">Show filter options</option> + <option value="no_filter">No filtering</option> + </param> + <when value="filter"> + <param name="score" type="float" optional="true" label="Score filter" + help="Exclude poses with score greater than this value"/> + <param name="nscore" type="float" optional="true" label="Normalised score filter" + help="Exclude poses with normalised score greater than this value"/> + <param name="top" type="integer" value="1" optional="true" min="1" label="Number of best poses" + help="Number of best scoring poses to keep"/> + </when> + <when value="no_filter"/> + </conditional> <param name="name" type="boolean" label="Generate name field" truevalue="Y" falsevalue="N" checked="false" help="Generate the name field (first line) for cases where this is empty"/> + <param argument="-seed" type="integer" optional="true" label="Random seed" help=""/> </inputs> <outputs> <data name="output" format="sdf" label="rDock on ${on_string}"/> </outputs> <tests> + <!-- broken ligand test --> + <test expect_failure="true" expect_exit_code="23"> + <param name="receptor" value="receptor.mol2"/> + <param name="ligands" value="broken_ligand.sdf"/> + <param name="active_site" value="receptor.as"/> + <param name="num" value="3"/> + <param name="seed" value="3"/> + <conditional name="filter"> + <param name="filter_select" value="filter"/> + <param name="top" value="1"/> + </conditional> + <param name="name" value="false"/> + </test> <test> <param name="receptor" value="receptor.mol2"/> <param name="ligands" value="ligands_names.sdf"/> <param name="active_site" value="receptor.as"/> <param name="num" value="3"/> - <param name="top" value="1"/> + <param name="seed" value="3"/> + <conditional name="filter"> + <param name="filter_select" value="filter"/> + <param name="top" value="1"/> + </conditional> <param name="name" value="false"/> <output name="output"> <assert_contents> <has_text text="Rbt.Current_Directory"/> + <has_n_lines n="352"/> </assert_contents> </output> </test> @@ -66,11 +110,34 @@ <param name="ligands" value="ligands_nonames.sdf"/> <param name="active_site" value="receptor.as"/> <param name="num" value="3"/> - <param name="top" value="1"/> + <param name="seed" value="3"/> + <conditional name="filter"> + <param name="filter_select" value="filter"/> + <param name="top" value="1"/> + </conditional> <param name="name" value="true"/> <output name="output"> <assert_contents> <has_text text="Rbt.Current_Directory"/> + <has_n_lines n="352"/> + </assert_contents> + </output> + </test> + <!-- no filter test --> + <test> + <param name="receptor" value="receptor.mol2"/> + <param name="ligands" value="ligands_nonames.sdf"/> + <param name="active_site" value="receptor.as"/> + <param name="num" value="3"/> + <param name="seed" value="3"/> + <conditional name="filter"> + <param name="filter_select" value="no_filter"/> + </conditional> + <param name="name" value="true"/> + <output name="output"> + <assert_contents> + <has_text text="Rbt.Current_Directory"/> + <has_n_lines n="1056"/> </assert_contents> </output> </test> @@ -79,12 +146,17 @@ <param name="ligands" value="ligands_names.sdf"/> <param name="active_site" value="receptor.as"/> <param name="num" value="1"/> - <param name="score" value="10"/> - <param name="nscore" value="1"/> - <param name="name" value="false"/> + <param name="seed" value="3"/> + <conditional name="filter"> + <param name="filter_select" value="filter"/> + <param name="score" value="10"/> + <param name="nscore" value="1"/> + </conditional> + <param name="name"/> <output name="output"> <assert_contents> <has_text text="Rbt.Current_Directory"/> + <has_n_lines n="352"/> </assert_contents> </output> </test>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/broken_ligand.sdf Fri Apr 03 13:32:13 2020 -0400 @@ -0,0 +1,159 @@ +Cc1ccsc1C1(O)CCOC1 + OpenBabel03262013053D + + 18 19 0 0 1 0 0 0 0 0999 V2000 + 2.6244 -0.3204 0.0030 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.1487 -0.0653 -0.0019 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.5577 1.2199 0.0010 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.7851 1.2166 -0.0030 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.4005 -0.3714 0.0020 S 0 0 0 0 0 0 0 0 0 0 0 0 + 0.1829 -0.9540 -0.0102 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.7593 -3.2703 1.1063 C 0 0 3 0 0 0 0 0 0 0 0 0 + 0.3797 -2.5572 0.0072 O 0 0 0 0 0 0 0 0 0 0 0 0 + 0.7298 -2.3113 -0.2964 C 0 0 0 0 0 2 0 0 0 0 0 0 + 0.3797 -2.5572 0.0072 C 0 0 0 0 0 2 0 0 0 0 0 0 + 0.3797 -2.5572 0.0072 O 0 0 0 0 0 0 0 0 0 0 0 0 + 0.3797 -2.5572 0.0072 C 0 0 0 0 0 2 0 0 0 0 0 0 + 3.1460 0.6144 0.0045 H 0 0 0 0 0 0 0 0 0 0 0 0 + 2.8955 -0.8785 -0.8702 H 0 0 0 0 0 0 0 0 0 0 0 0 + 2.8896 -0.8781 0.8782 H 0 0 0 0 0 0 0 0 0 0 0 0 + 1.1148 2.0915 0.0058 H 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3714 2.0694 -0.0084 H 0 0 0 0 0 0 0 0 0 0 0 0 + -0.6424 -1.9351 0.5862 H 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 1 0 0 0 0 + 1 13 1 0 0 0 0 + 1 14 1 0 0 0 0 + 1 15 1 0 0 0 0 + 2 3 1 0 0 0 0 + 2 6 2 0 0 0 0 + 3 4 2 0 0 0 0 + 3 16 1 0 0 0 0 + 4 5 1 0 0 0 0 + 4 17 1 0 0 0 0 + 5 6 1 0 0 0 0 + 6 7 1 0 0 0 0 + 7 8 1 0 0 0 0 + 7 9 1 0 0 0 0 + 7 12 1 0 0 0 0 + 8 18 1 0 0 0 0 + 9 10 1 0 0 0 0 + 10 11 1 0 0 0 0 + 11 12 1 0 0 0 0 +M END +$$$$ +1S3V + OpenBabel07031809403D + + 54 56 0 0 1 0 0 0 0 0999 V2000 + -0.0237 32.0851 0.4630 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.0257 32.5701 2.5090 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.5816 31.2781 2.5290 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.2645 30.7721 3.8370 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.1514 29.5300 3.5680 C 0 0 1 0 0 0 0 0 0 0 0 0 + -2.3824 28.4990 2.7070 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.7845 29.0260 1.3530 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3126 30.4241 1.4480 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.6244 28.9840 4.9610 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.2442 26.5599 4.7800 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.1391 25.6479 4.2580 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.8561 24.2849 4.1780 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.0120 23.8848 3.0290 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.6611 23.8468 4.6560 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.5581 22.0928 3.4830 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.7132 24.7349 5.1800 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.4583 25.1339 6.0060 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.0123 26.0899 5.2580 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.4676 30.8241 0.4170 N 0 0 0 0 0 0 0 0 0 0 0 0 + 0.8412 32.3751 -0.5420 N 0 0 0 0 0 0 0 0 0 0 0 0 + -0.2388 32.9722 1.4960 N 0 0 0 0 0 0 0 0 0 0 0 0 + -1.2847 33.4632 3.4970 N 0 0 0 0 0 0 0 0 0 0 0 0 + -4.6273 27.9210 4.8320 N 0 0 0 0 0 0 0 0 0 0 0 0 + -5.8230 23.4168 3.6560 O 0 0 0 0 0 0 0 0 0 0 0 0 + -3.1441 22.5778 4.6930 O 0 0 0 0 0 0 0 0 0 0 0 0 + -1.5192 24.2169 5.6340 O 0 0 0 0 0 0 0 0 0 0 0 0 + -6.0522 28.2910 4.7350 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.8817 31.5647 4.2416 H 0 0 0 0 0 0 0 0 0 0 0 0 + -1.4982 30.5088 4.5555 H 0 0 0 0 0 0 0 0 0 0 0 0 + -4.0329 29.7742 2.9881 H 0 0 0 0 0 0 0 0 0 0 0 0 + -3.0645 27.6908 2.4734 H 0 0 0 0 0 0 0 0 0 0 0 0 + -1.5623 28.1183 3.3032 H 0 0 0 0 0 0 0 0 0 0 0 0 + -2.5506 28.9693 0.5897 H 0 0 0 0 0 0 0 0 0 0 0 0 + -0.9492 28.3958 1.0737 H 0 0 0 0 0 0 0 0 0 0 0 0 + -4.0540 29.8010 5.5275 H 0 0 0 0 0 0 0 0 0 0 0 0 + -2.7656 28.5900 5.4903 H 0 0 0 0 0 0 0 0 0 0 0 0 + -6.0962 26.0040 3.8974 H 0 0 0 0 0 0 0 0 0 0 0 0 + -6.7524 24.4932 2.1715 H 0 0 0 0 0 0 0 0 0 0 0 0 + -7.6062 23.0393 2.7052 H 0 0 0 0 0 0 0 0 0 0 0 0 + -7.5820 24.4781 3.7333 H 0 0 0 0 0 0 0 0 0 0 0 0 + -1.7376 22.7384 3.1952 H 0 0 0 0 0 0 0 0 0 0 0 0 + -2.1884 21.0868 3.6389 H 0 0 0 0 0 0 0 0 0 0 0 0 + -3.3042 22.0856 2.6981 H 0 0 0 0 0 0 0 0 0 0 0 0 + -0.8011 25.7764 6.8076 H 0 0 0 0 0 0 0 0 0 0 0 0 + 0.4051 24.5711 6.3386 H 0 0 0 0 0 0 0 0 0 0 0 0 + -0.1871 25.7386 5.1495 H 0 0 0 0 0 0 0 0 0 0 0 0 + -2.2964 26.7805 5.6864 H 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2433 33.2980 -0.6110 H 0 0 0 0 0 0 0 0 0 0 0 0 + 1.0822 31.6679 -1.2201 H 0 0 0 0 0 0 0 0 0 0 0 0 + -0.8759 34.3850 3.4637 H 0 0 0 0 0 0 0 0 0 0 0 0 + -1.8862 33.2055 4.2651 H 0 0 0 0 0 0 0 0 0 0 0 0 + -6.2045 28.9156 3.8635 H 0 0 0 0 0 0 0 0 0 0 0 0 + -6.6528 27.3942 4.6458 H 0 0 0 0 0 0 0 0 0 0 0 0 + -6.3454 28.8348 5.6245 H 0 0 0 0 0 0 0 0 0 0 0 0 + 1 19 1 0 0 0 0 + 1 20 1 0 0 0 0 + 2 22 1 0 0 0 0 + 3 2 2 0 0 0 0 + 3 8 1 0 0 0 0 + 4 3 1 0 0 0 0 + 4 28 1 0 0 0 0 + 4 29 1 0 0 0 0 + 5 4 1 0 0 0 0 + 5 6 1 0 0 0 0 + 5 9 1 0 0 0 0 + 5 30 1 6 0 0 0 + 6 7 1 0 0 0 0 + 6 31 1 0 0 0 0 + 6 32 1 0 0 0 0 + 7 8 1 0 0 0 0 + 7 33 1 0 0 0 0 + 7 34 1 0 0 0 0 + 8 19 2 0 0 0 0 + 9 35 1 0 0 0 0 + 9 36 1 0 0 0 0 + 11 10 2 0 0 0 0 + 11 37 1 0 0 0 0 + 12 11 1 0 0 0 0 + 13 38 1 0 0 0 0 + 13 39 1 0 0 0 0 + 13 40 1 0 0 0 0 + 14 12 2 0 0 0 0 + 15 25 1 0 0 0 0 + 15 41 1 0 0 0 0 + 15 42 1 0 0 0 0 + 15 43 1 0 0 0 0 + 16 14 1 0 0 0 0 + 16 26 1 0 0 0 0 + 17 26 1 0 0 0 0 + 17 44 1 0 0 0 0 + 17 45 1 0 0 0 0 + 17 46 1 0 0 0 0 + 18 10 1 0 0 0 0 + 18 16 2 0 0 0 0 + 18 47 1 0 0 0 0 + 20 48 1 0 0 0 0 + 20 49 1 0 0 0 0 + 21 1 2 0 0 0 0 + 21 2 1 0 0 0 0 + 22 50 1 0 0 0 0 + 22 51 1 0 0 0 0 + 23 9 1 0 0 0 0 + 23 10 1 0 0 0 0 + 23 27 1 0 0 0 0 + 24 12 1 0 0 0 0 + 24 13 1 0 0 0 0 + 25 14 1 0 0 0 0 + 27 52 1 0 0 0 0 + 27 53 1 0 0 0 0 + 27 54 1 0 0 0 0 +M END +$$$$