changeset 18:da45aa9141cf

ChemicalToolBoX update.
author Bjoern Gruening <bjoern.gruening@gmail.com>
date Tue, 23 Jul 2013 19:01:28 +0200
parents 2f5a2e537ad6
children 4b59e2a3b0be
files natural_product_likeness_calculator.xml
diffstat 1 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/natural_product_likeness_calculator.xml	Tue Jul 23 14:54:56 2013 +0200
+++ b/natural_product_likeness_calculator.xml	Tue Jul 23 19:01:28 2013 +0200
@@ -1,17 +1,27 @@
-<tool id="ctb_np-likeness-calculator" name="Natural Product" version="0.2">
+<tool id="ctb_np-likeness-calculator" name="Natural Product" version="0.2.1">
     <description>likeness calculator</description>
-    <parallelism method="multi" split_inputs="infile" split_mode="to_size" split_size="100" shared_inputs="" merge_outputs="outfile,outfragments"></parallelism>
+    <!--<parallelism method="multi" split_inputs="infile" split_mode="to_size" split_size="100" shared_inputs="" merge_outputs="outfile,outfragments"></parallelism>-->
     <requirements>
         <requirement type="package" version="2.0">np-likeness-scorer</requirement>
     </requirements>
     <command>
+        ## NPLC is really picky with file extensions. We need to specify every datatype as file extension
+        ## A workaround is to create a symlink with a proper file-extension.
+        #import tempfile
+        #set $temp_file = tempfile.NamedTemporaryFile()
+        #set $temp_link = "%s.%s" % ($temp_file.name, $infile.ext)
+        $temp_file.close()
+        ln -s $infile $temp_link;
+
         java -jar \$NPLS_JAR_PATH/NP-Likeness-2.0.jar
-            -in "${infile}"
+            -in "${temp_link}"
             -out "${outfile}"
             #if $reconstruct_fragments:
                 -reconstructFragments true
                 -outFragments $outfragments
             #end if
+        ;
+        rm $temp_link
     </command>
     <stdio>
         <exit_code range="1:" />
@@ -22,7 +32,7 @@
         <param name='reconstruct_fragments' type='boolean' label='Fragments-scores are written out in SMILES format' truevalue='' falsevalue='' />
     </inputs>
     <outputs>
-        <data format="sdf" name="outfile" />
+        <data format_source="infile" name="outfile" />
         <data format="tabular" name="outfragments">
             <filter>reconstruct_fragments is True</filter>
         </data>