changeset 4:878128362e33 draft

planemo upload commit 34edf9c3db61650a03d5a0d548b9697a94ecde34-dirty
author proteore
date Tue, 03 Apr 2018 08:24:45 -0400
parents be06c14e543d
children 7fbd66f985b7
files README.rst reactome_analysis.py reactome_analysis.xml template.html test-data/ID_Converter_FKW_Lacombe_et_al_2017_OK.txt test-data/Reactome_Analysis_Tools.html test-data/Reactome_Analysis_Tools_invalid_ID.txt
diffstat 2 files changed, 21 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/reactome_analysis.py	Fri Mar 23 10:48:36 2018 -0400
+++ b/reactome_analysis.py	Tue Apr 03 08:24:45 2018 -0400
@@ -23,8 +23,8 @@
     """
     Check if an variable is numeric
     """
-    float_format = re.compile("^[\-]?[1-9][0-9]*\.?[0-9]+$")
-    int_format = re.compile("^[\-]?[1-9][0-9]*$")
+    float_format = re.compile(r"^[-]?[1-9][0-9]*.?[0-9]+$")
+    int_format = re.compile(r"^[-]?[1-9][0-9]*$")
     test = ""
     if format == "int":
         test = re.match(int_format, n)
@@ -81,9 +81,11 @@
     template.close()
     output.close()
     
-    trash_out = open(trash_file, "w")
-    trash_out.write("\n".join(trash))
-    trash_out.close()
+    if trash:
+        print(trash)
+        trash_out = open(trash_file, "w")
+        trash_out.write("\n".join(trash))
+        trash_out.close()
 
 def options():
     parser = argparse.ArgumentParser()
--- a/reactome_analysis.xml	Fri Mar 23 10:48:36 2018 -0400
+++ b/reactome_analysis.xml	Tue Apr 03 08:24:45 2018 -0400
@@ -21,7 +21,16 @@
 		        <option value="file" selected="true">Input file containing your identifiers</option>
             </param>
             <when value="text" >
-                <param name="list" type="text" label="Enter list of identifiers" />
+                <param name="list" type="text" label="Enter list of identifiers" help="IDs must be separated by space into the form field, for example: P31946 P62258">
+                    <sanitizer>
+                        <valid initial="string.printable">
+                            <remove value="&apos;"/>
+                        </valid>
+                        <mapping initial="none">
+                            <add source="&apos;" target="__sq__"/>
+                        </mapping>
+                    </sanitizer>
+                </param>
             </when>
             <when value="file" >
                 <param name="file" type="data" format="txt, tabular" label="Input file containing your identifiers" help="Input file is a tab-delimited file containing different information of proteins, such as an output of MaxQuant software" />
@@ -33,7 +42,9 @@
     </inputs>
     <outputs>
         <data name="output" format="html" label="" />
-        <data name="trash" format="tabular" label="Invalid identifiers" />
+        <data name="trash" format="tabular" hidden="true" label="Invalid id not send to reactome">
+                <discover_datasets pattern="(Reactome_Analysis_Tools_invalid_ID).txt" ext="txt" visible="false" assign_primary_output="false"/>
+        </data>
     </outputs>
     <tests>
         <test>
@@ -44,7 +55,7 @@
                 <param name="ncol" value="c1" />
             </conditional>
             <output name="output" file="Reactome_Analysis_Tools.html" ftype="html" />
-            <output name="trash" file="Reactome_Analysis_Tools_invalid_ID.txt" ftype="tab" />
+            <!-- <output name="trash" file="Reactome_Analysis_Tools_invalid_ID.txt" ftype="tab" hidden="true" /> -->
         </test>
     </tests>
     <help><![CDATA[