Repository 'rdock_rbdock'
hg clone https://toolshed.g2.bx.psu.edu/repos/bgruening/rdock_rbdock

Changeset 6:07fa39ed62c7 (2020-04-25)
Previous changeset 5:e4b7d1507a75 (2020-04-14) Next changeset 7:309fd04bcfd2 (2020-05-04)
Commit message:
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/rdock commit e9c627440028cfd2c743462927672e0c5e3576aa"
modified:
rbdock.xml
added:
test-data/receptor.prm
test-data/wrong_receptor.prm
b
diff -r e4b7d1507a75 -r 07fa39ed62c7 rbdock.xml
--- a/rbdock.xml Tue Apr 14 06:23:24 2020 -0400
+++ b/rbdock.xml Sat Apr 25 08:54:06 2020 -0400
[
@@ -1,4 +1,4 @@
-<tool id="rdock_rbdock" name="rDock docking" version="0.1.3" profile="19.01">
+<tool id="rdock_rbdock" name="rDock docking" version="0.1.4" profile="19.01">
     <description>- perform protein-ligand docking with rDock</description>
     <macros>
         <import>rdock_macros.xml</import>
@@ -7,7 +7,15 @@
     <command><![CDATA[
 ln -s '$active_site' receptor.as &&
 ln -s '$receptor' receptor.mol2 &&
-ln -s $receptor_prm receptor.prm &&
+
+#if $custom_rec.custom_rec_select == 'true':
+    ## simple check that the receptor file name is correct
+    grep -q 'RECEPTOR_FILE receptor.mol2' $custom_rec.prm_file || (echo "Error: a custom receptor.prm file must contain the line 'RECEPTOR_FILE receptor.mol2'" >&2 && exit 1) &&
+    ln -s '$custom_rec.prm_file' receptor.prm &&
+#else
+    ln -s '$receptor_prm' receptor.prm &&
+#end if
+
 #if $name == 'Y':
   sdmodify -f_REC '$ligands' > ligands.sdf &&
 #else
@@ -42,7 +50,9 @@
     <configfiles>
         <configfile name="receptor_prm">RBT_PARAMETER_FILE_V1.00
 RECEPTOR_FILE receptor.mol2
-RECEPTOR_FLEX 3.0
+#if $custom_rec.custom_rec_select == 'false':
+RECEPTOR_FLEX $custom_rec.flex
+#end if
         </configfile>
     </configfiles>
 
@@ -50,6 +60,19 @@
         <param type="data" name="receptor" format="mol2" label="Receptor" help="Select a receptor (mol2 format)."/>
         <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)"/>
+        <conditional name="custom_rec">
+            <param name="custom_rec_select" type="select" label="Use a custom receptor.prm file?" help="Useful for more advanced use-cases, such as tethered docking.">
+                <option value="true">Use custom receptor.prm file</option>
+                <option value="false" selected="true">Use default options (no user upload required)</option>
+            </param>
+            <when value="true">
+                <param type="data" name="prm_file" format="txt" label="Receptor prm file" help="Note the file must contain the line 'RECEPTOR_FILE receptor.mol2', else the tool will fail."/>
+            </when>
+            <when value="false">
+                <param name="flex" type="float" value="3.0" min="0.0" label="Receptor flex" help="Value for RECEPTOR_FLEX (default 3)"/>
+            </when>
+        </conditional>
+
         <param name="num" type="integer" value="10" label="Number of dockings" help="Number of poses to generate"/>
         <conditional name="filter">
             <param name="filter_select" type="select" label="Filter the docking results" help="Using sdfilter">
@@ -80,6 +103,7 @@
             <param name="ligands" value="broken_ligand.sdf"/>
             <param name="active_site" value="receptor.as"/>
             <param name="num" value="3"/>
+            <param name="flex" value="3"/>
             <param name="seed" value="3"/>
             <conditional name="filter">
                 <param name="filter_select" value="filter"/>
@@ -92,6 +116,7 @@
             <param name="ligands" value="ligands_names.sdf"/>
             <param name="active_site" value="receptor.as"/>
             <param name="num" value="3"/>
+            <param name="flex" value="3"/>
             <param name="seed" value="3"/>
             <conditional name="filter">
                 <param name="filter_select" value="filter"/>
@@ -110,6 +135,7 @@
             <param name="ligands" value="ligands_nonames.sdf"/>
             <param name="active_site" value="receptor.as"/>
             <param name="num" value="3"/>
+            <param name="flex" value="3"/>
             <param name="seed" value="3"/>
             <conditional name="filter">
                 <param name="filter_select" value="filter"/>
@@ -129,6 +155,7 @@
             <param name="ligands" value="ligands_nonames.sdf"/>
             <param name="active_site" value="receptor.as"/>
             <param name="num" value="3"/>
+            <param name="flex" value="3"/>
             <param name="seed" value="3"/>
             <conditional name="filter">
                 <param name="filter_select" value="no_filter"/>
@@ -146,6 +173,7 @@
             <param name="ligands" value="ligands_names.sdf"/>
             <param name="active_site" value="receptor.as"/>
             <param name="num" value="1"/>
+            <param name="flex" value="3"/>
             <param name="seed" value="3"/>
             <conditional name="filter">
                 <param name="filter_select" value="filter"/>
@@ -160,6 +188,42 @@
                 </assert_contents>
             </output>
         </test>
+        <!-- test with custom receptor.prm -->
+        <test>
+            <param name="receptor" value="receptor.mol2"/>
+            <param name="ligands" value="ligands_names.sdf"/>
+            <param name="active_site" value="receptor.as"/>
+            <param name="custom_rec_select" value="true"/>
+            <param name="prm_file" value="receptor.prm"/>
+            <param name="num" value="1"/>
+            <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>
+        <!-- test with custom but broken receptor.prm -->
+        <test expect_failure="true" expect_exit_code="1">
+            <param name="receptor" value="receptor.mol2"/>
+            <param name="ligands" value="ligands_names.sdf"/>
+            <param name="active_site" value="receptor.as"/>
+            <param name="custom_rec_select" value="true"/>
+            <param name="prm_file" value="wrong_receptor.prm"/>
+            <param name="num" value="1"/>
+            <param name="seed" value="3"/>
+            <conditional name="filter">
+                <param name="filter_select" value="no_filter"/>
+            </conditional>
+            <param name="name"/>
+        </test>
     </tests>
     <help><![CDATA[
 
b
diff -r e4b7d1507a75 -r 07fa39ed62c7 test-data/receptor.prm
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/receptor.prm Sat Apr 25 08:54:06 2020 -0400
b
@@ -0,0 +1,3 @@
+RBT_PARAMETER_FILE_V1.00
+RECEPTOR_FILE receptor.mol2
+RECEPTOR_FLEX 3.0
b
diff -r e4b7d1507a75 -r 07fa39ed62c7 test-data/wrong_receptor.prm
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/wrong_receptor.prm Sat Apr 25 08:54:06 2020 -0400
b
@@ -0,0 +1,3 @@
+RBT_PARAMETER_FILE_V1.00
+RECEPTOR_FILE a_terrible_mistake.mol2
+RECEPTOR_FLEX 3.0