changeset 9:a072cb207571 draft

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit a889b6ed75666406a95e29d672b58a8fee6e8784"
author bgruening
date Thu, 22 Aug 2019 10:30:36 -0400
parents d00ae56d3ba5
children e6011617c748
files macros.xml ob_convert.xml test-data/split1.pdbqt test-data/split2.pdbqt
diffstat 4 files changed, 97 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/macros.xml	Fri May 10 08:53:48 2019 -0400
+++ b/macros.xml	Thu Aug 22 10:30:36 2019 -0400
@@ -1,5 +1,5 @@
 <macros>
-    <token name="@VERSION@">2.4.2</token>
+    <token name="@VERSION@">2.4.2.1</token>
 
     <xml name="requirements">
         <requirements>
--- a/ob_convert.xml	Fri May 10 08:53:48 2019 -0400
+++ b/ob_convert.xml	Thu Aug 22 10:30:36 2019 -0400
@@ -13,28 +13,37 @@
 
     #set $format = $oformat.oformat_opts_selector
 
-    #if $format == "fs":
+    #if $format == 'fs':
         ## For the fastsearch index we need to copy the original molecule files to the composite datatype of obfs.
         ## Because openbabel likes file extensions, we give the molecule file a proper file extension.
         mkdir $outfile.files_path;
-        cp "${infile}" ${os.path.join($outfile.files_path, 'molecule.%s' % $infile.ext )};
+        cp '${infile}' ${os.path.join($outfile.files_path, 'molecule.%s' % $infile.ext )};
+    #end if
+
+    #if $split == 'true':
+        mkdir output &&
     #end if
 
-    obabel -i "${infile.ext}"
+    obabel -i '${infile.ext}'
 
-        #if $format == "fs":
+        #if $format == 'fs':
             ## the fs filetype need his own symlink path, all others can take the original ones
             ${os.path.join($outfile.files_path, 'molecule.%s' % $infile.ext )}
-            -o "$format" -e
+            -o '$format' -e
             -O ${os.path.join($outfile.files_path,'molecule.fs')}
             #if int($oformat.fs_fold) > 0:
                 -xN$oformat.fs_fold
             #end if
             ${oformat.fs_fptype}
         #else:
-            "${infile}"
-            -o "${format}"
-            -O "${outfile}"
+            '${infile}'
+            -o '${format}'
+            #if $split == 'true':
+                -O 'output/molecule.$format'
+                -m
+            #else:
+                -O '${outfile}'
+            #end if
             -e
         #end if
 
@@ -188,6 +197,7 @@
                 <option value="nw">NWChem input format</option>
                 <option value="pcm">PCModel format</option>
                 <option value="pdb">Protein Data Bank format (pdb)</option>
+                <option value="pdbqt">PDBQT input format</option>
                 <option value="pov">POV-Ray input format</option>
                 <option value="pqs">Parallel Quantum Solutions format</option>
                 <option value="qcin">Q-Chem input format</option>
@@ -335,6 +345,7 @@
             <when value="nw" />
             <when value="pcm" />
             <when value="pdb" />
+            <when value="pdbqt" />
             <when value="pov" />
             <when value="pqs" />
             <when value="qcin" />
@@ -379,6 +390,7 @@
         </conditional>
 
         <!-- Options for all formats.-->
+        <param name="split" type="boolean" value="false" label="Split multi-molecule files into a collection"/>
         <param name="remove_h" type="boolean" truevalue="-d" falsevalue=""
             label="Delete hydrogen atoms, make all hydrogens implicit" help="(-d)" />
         <param name="ph" type="float" value="-1" label="Add hydrogens appropriate for pH" help="-1 means deactivated (-p)"/>
@@ -415,6 +427,7 @@
 
     <outputs>
         <data name="outfile" format="text" label="Convert to ${oformat.oformat_opts_selector} from ${on_string}">
+            <filter>split == False</filter>
             <change_format>
                 <when input="oformat.oformat_opts_selector" value="sdf" format="sdf"/>
                 <when input="oformat.oformat_opts_selector" value="can" format="smi"/>
@@ -424,9 +437,15 @@
                 <when input="oformat.oformat_opts_selector" value="cml" format="cml"/>
                 <when input="oformat.oformat_opts_selector" value="mol" format="mol"/>
                 <when input="oformat.oformat_opts_selector" value="pdb" format="pdb"/>
+                <when input="oformat.oformat_opts_selector" value="pdbqt" format="pdbqt"/>
                 <when input="oformat.oformat_opts_selector" value="fs" format="obfs"/>
             </change_format>
         </data>
+
+        <collection name="file_outputs" type="list" label="Prepared ligands" >
+            <filter>split == True</filter>
+			<discover_datasets pattern="__name_and_ext__" directory="output" visible="false" />
+        </collection>
     </outputs>
     <tests>
         <test>
@@ -462,6 +481,15 @@
             <param name="oformat_opts_selector" value="sdf" />
             <output name="outfile" ftype="sdf" file="ob_convert_on_CID2244.sdf" lines_diff="2"/>
         </test>
+        <test>
+            <param name="infile" ftype="smi" value="2_mol.smi"/>
+            <param name="oformat_opts_selector" value="pdbqt"/>
+            <param name="split" value="true"/>
+            <output_collection name="file_outputs" type="list" count="2">
+                <element name="molecule1" file="split1.pdbqt" />
+                <element name="molecule2" file="split2.pdbqt" />
+            </output_collection>
+        </test>
     </tests>
     <help>
 <![CDATA[
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/split1.pdbqt	Thu Aug 22 10:30:36 2019 -0400
@@ -0,0 +1,30 @@
+REMARK  Name = 
+REMARK  3 active torsions:
+REMARK  status: ('A' for Active; 'I' for Inactive)
+REMARK    1  A    between atoms: C_2  and  O_4
+REMARK    2  A    between atoms: O_4  and  C_5
+REMARK    3  A    between atoms: C_10  and  C_11
+REMARK                            x       y       z     vdW  Elec       q    Type
+REMARK                         _______ _______ _______ _____ _____    ______ ____
+ROOT
+ATOM      1  C   UNL     1       0.000   0.000   0.000  0.00  0.00    +0.149 A 
+ATOM      2  C   UNL     1       0.000   0.000   0.000  0.00  0.00    +0.038 A 
+ATOM      3  C   UNL     1       0.000   0.000   0.000  0.00  0.00    +0.003 A 
+ATOM      4  C   UNL     1       0.000   0.000   0.000  0.00  0.00    +0.000 A 
+ATOM      5  C   UNL     1       0.000   0.000   0.000  0.00  0.00    +0.004 A 
+ATOM      6  C   UNL     1       0.000   0.000   0.000  0.00  0.00    +0.049 A 
+ENDROOT
+BRANCH   6   7
+ATOM      7  C   UNL     1       0.000   0.000   0.000  0.00  0.00    +0.076 C 
+ATOM      8  O   UNL     1       0.000   0.000   0.000  0.00  0.00    -0.544 OA
+ATOM      9  O   UNL     1       0.000   0.000   0.000  0.00  0.00    -0.544 OA
+ENDBRANCH   6   7
+BRANCH   1  10
+ATOM     10  O   UNL     1       0.000   0.000   0.000  0.00  0.00    -0.424 OA
+BRANCH  10  12
+ATOM     11  C   UNL     1       0.000   0.000   0.000  0.00  0.00    +0.122 C 
+ATOM     12  C   UNL     1       0.000   0.000   0.000  0.00  0.00    +0.322 C 
+ATOM     13  O   UNL     1       0.000   0.000   0.000  0.00  0.00    -0.250 OA
+ENDBRANCH  10  12
+ENDBRANCH   1  10
+TORSDOF 3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/split2.pdbqt	Thu Aug 22 10:30:36 2019 -0400
@@ -0,0 +1,30 @@
+REMARK  Name = 
+REMARK  3 active torsions:
+REMARK  status: ('A' for Active; 'I' for Inactive)
+REMARK    1  A    between atoms: C_2  and  O_4
+REMARK    2  A    between atoms: O_4  and  C_5
+REMARK    3  A    between atoms: C_10  and  C_11
+REMARK                            x       y       z     vdW  Elec       q    Type
+REMARK                         _______ _______ _______ _____ _____    ______ ____
+ROOT
+ATOM      1  C   UNL     1       0.000   0.000   0.000  0.00  0.00    +0.149 A 
+ATOM      2  C   UNL     1       0.000   0.000   0.000  0.00  0.00    +0.038 A 
+ATOM      3  C   UNL     1       0.000   0.000   0.000  0.00  0.00    +0.003 A 
+ATOM      4  C   UNL     1       0.000   0.000   0.000  0.00  0.00    +0.000 A 
+ATOM      5  C   UNL     1       0.000   0.000   0.000  0.00  0.00    +0.004 A 
+ATOM      6  C   UNL     1       0.000   0.000   0.000  0.00  0.00    +0.049 A 
+ENDROOT
+BRANCH   6   7
+ATOM      7  C   UNL     1       0.000   0.000   0.000  0.00  0.00    +0.076 C 
+ATOM      8  O   UNL     1       0.000   0.000   0.000  0.00  0.00    -0.544 OA
+ATOM      9  O   UNL     1       0.000   0.000   0.000  0.00  0.00    -0.544 OA
+ENDBRANCH   6   7
+BRANCH   1  10
+ATOM     10  O   UNL     1       0.000   0.000   0.000  0.00  0.00    -0.424 OA
+BRANCH  10  12
+ATOM     11  C   UNL     1       0.000   0.000   0.000  0.00  0.00    +0.122 C 
+ATOM     12  C   UNL     1       0.000   0.000   0.000  0.00  0.00    +0.322 C 
+ATOM     13  O   UNL     1       0.000   0.000   0.000  0.00  0.00    -0.250 OA
+ENDBRANCH  10  12
+ENDBRANCH   1  10
+TORSDOF 3