changeset 4:29fcd027d67a draft

Uploaded v0.0.6 take 1, simple test (which currently fails)
author peterjc
date Thu, 16 May 2013 12:43:57 -0400
parents bacb7dfa846c
children 51fe47a5a803
files test-data/venn_list.tabular test-data/venn_list1.pdf tools/plotting/venn_list.py tools/plotting/venn_list.txt tools/plotting/venn_list.xml
diffstat 5 files changed, 520 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/venn_list.tabular	Thu May 16 12:43:57 2013 -0400
@@ -0,0 +1,10 @@
+gi|57163783|ref|NP_001009242.1|
+gi|3024260|sp|P56514.1|OPSD_BUFBU
+gi|283855846|gb|ADB45242.1|
+gi|283855823|gb|ADB45229.1|
+gi|223523|prf||0811197A
+gi|12583665|dbj|BAB21486.1|
+gi|155008482|gb|ABS89278.1|
+gi|4887221|gb|AAD32241.1|
+gi|4506527|ref|NP_000530.1|
+gi|20465209|gb|AAM11432.1|
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/venn_list1.pdf	Thu May 16 12:43:57 2013 -0400
@@ -0,0 +1,488 @@
+%PDF-1.4
+%ρ\r
+1 0 obj
+<<
+/CreationDate (D:20110419150236)
+/ModDate (D:20110419150236)
+/Title (R Graphics Output)
+/Producer (R 2.12.0)
+/Creator (R)
+>>
+endobj
+2 0 obj
+<<
+/Type /Catalog
+/Pages 3 0 R
+>>
+endobj
+5 0 obj
+<<
+/Type /Page
+/Parent 3 0 R
+/Contents 6 0 R
+/Resources 4 0 R
+>>
+endobj
+6 0 obj
+<<
+/Length 7 0 R
+>>
+stream
+1 J 1 j q
+Q q
+BT
+0.000 0.000 0.000 rg
+/F3 1 Tf 14.00 0.00 -0.00 14.00 239.13 563.77 Tm [(Some Pr) 20 (oteins)] TJ
+ET
+Q q 14.40 14.40 547.20 547.20 re W n
+1.000 0.000 0.000 RG
+0.75 w
+[] 0 d
+1 J
+1 j
+10.00 M
+383.00 288.00 m
+382.99 289.66 l
+382.94 291.32 l
+382.87 292.97 l
+382.77 294.63 l
+382.64 296.28 l
+382.48 297.93 l
+382.29 299.58 l
+382.08 301.22 l
+381.83 302.86 l
+381.56 304.50 l
+381.25 306.13 l
+380.92 307.75 l
+380.57 309.37 l
+380.18 310.98 l
+379.76 312.59 l
+379.32 314.19 l
+378.85 315.78 l
+378.35 317.36 l
+377.82 318.93 l
+377.27 320.49 l
+376.69 322.04 l
+376.08 323.59 l
+375.45 325.12 l
+374.79 326.64 l
+374.10 328.15 l
+373.39 329.65 l
+372.65 331.13 l
+371.88 332.60 l
+371.09 334.06 l
+370.27 335.50 l
+369.43 336.93 l
+368.56 338.34 l
+367.67 339.74 l
+366.76 341.12 l
+365.82 342.49 l
+364.86 343.84 l
+363.87 345.17 l
+362.86 346.49 l
+361.83 347.79 l
+360.77 349.06 l
+359.70 350.33 l
+358.60 351.57 l
+357.48 352.79 l
+356.34 353.99 l
+355.18 355.18 l
+353.99 356.34 l
+352.79 357.48 l
+351.57 358.60 l
+350.33 359.70 l
+349.06 360.77 l
+347.79 361.83 l
+346.49 362.86 l
+345.17 363.87 l
+343.84 364.86 l
+342.49 365.82 l
+341.12 366.76 l
+339.74 367.67 l
+338.34 368.56 l
+336.93 369.43 l
+335.50 370.27 l
+334.06 371.09 l
+332.60 371.88 l
+331.13 372.65 l
+329.65 373.39 l
+328.15 374.10 l
+326.64 374.79 l
+325.12 375.45 l
+323.59 376.08 l
+322.04 376.69 l
+320.49 377.27 l
+318.93 377.82 l
+317.36 378.35 l
+315.78 378.85 l
+314.19 379.32 l
+312.59 379.76 l
+310.98 380.18 l
+309.37 380.57 l
+307.75 380.92 l
+306.13 381.25 l
+304.50 381.56 l
+302.86 381.83 l
+301.22 382.08 l
+299.58 382.29 l
+297.93 382.48 l
+296.28 382.64 l
+294.63 382.77 l
+292.97 382.87 l
+291.32 382.94 l
+289.66 382.99 l
+288.00 383.00 l
+286.34 382.99 l
+284.68 382.94 l
+283.03 382.87 l
+281.37 382.77 l
+279.72 382.64 l
+278.07 382.48 l
+276.42 382.29 l
+274.78 382.08 l
+273.14 381.83 l
+271.50 381.56 l
+269.87 381.25 l
+268.25 380.92 l
+266.63 380.57 l
+265.02 380.18 l
+263.41 379.76 l
+261.81 379.32 l
+260.22 378.85 l
+258.64 378.35 l
+257.07 377.82 l
+255.51 377.27 l
+253.96 376.69 l
+252.41 376.08 l
+250.88 375.45 l
+249.36 374.79 l
+247.85 374.10 l
+246.35 373.39 l
+244.87 372.65 l
+243.40 371.88 l
+241.94 371.09 l
+240.50 370.27 l
+239.07 369.43 l
+237.66 368.56 l
+236.26 367.67 l
+234.88 366.76 l
+233.51 365.82 l
+232.16 364.86 l
+230.83 363.87 l
+229.51 362.86 l
+228.21 361.83 l
+226.94 360.77 l
+225.67 359.70 l
+224.43 358.60 l
+223.21 357.48 l
+222.01 356.34 l
+220.82 355.18 l
+219.66 353.99 l
+218.52 352.79 l
+217.40 351.57 l
+216.30 350.33 l
+215.23 349.06 l
+214.17 347.79 l
+213.14 346.49 l
+212.13 345.17 l
+211.14 343.84 l
+210.18 342.49 l
+209.24 341.12 l
+208.33 339.74 l
+207.44 338.34 l
+206.57 336.93 l
+205.73 335.50 l
+204.91 334.06 l
+204.12 332.60 l
+203.35 331.13 l
+202.61 329.65 l
+201.90 328.15 l
+201.21 326.64 l
+200.55 325.12 l
+199.92 323.59 l
+199.31 322.04 l
+198.73 320.49 l
+198.18 318.93 l
+197.65 317.36 l
+197.15 315.78 l
+196.68 314.19 l
+196.24 312.59 l
+195.82 310.98 l
+195.43 309.37 l
+195.08 307.75 l
+194.75 306.13 l
+194.44 304.50 l
+194.17 302.86 l
+193.92 301.22 l
+193.71 299.58 l
+193.52 297.93 l
+193.36 296.28 l
+193.23 294.63 l
+193.13 292.97 l
+193.06 291.32 l
+193.01 289.66 l
+193.00 288.00 l
+193.01 286.34 l
+193.06 284.68 l
+193.13 283.03 l
+193.23 281.37 l
+193.36 279.72 l
+193.52 278.07 l
+193.71 276.42 l
+193.92 274.78 l
+194.17 273.14 l
+194.44 271.50 l
+194.75 269.87 l
+195.08 268.25 l
+195.43 266.63 l
+195.82 265.02 l
+196.24 263.41 l
+196.68 261.81 l
+197.15 260.22 l
+197.65 258.64 l
+198.18 257.07 l
+198.73 255.51 l
+199.31 253.96 l
+199.92 252.41 l
+200.55 250.88 l
+201.21 249.36 l
+201.90 247.85 l
+202.61 246.35 l
+203.35 244.87 l
+204.12 243.40 l
+204.91 241.94 l
+205.73 240.50 l
+206.57 239.07 l
+207.44 237.66 l
+208.33 236.26 l
+209.24 234.88 l
+210.18 233.51 l
+211.14 232.16 l
+212.13 230.83 l
+213.14 229.51 l
+214.17 228.21 l
+215.23 226.94 l
+216.30 225.67 l
+217.40 224.43 l
+218.52 223.21 l
+219.66 222.01 l
+220.82 220.82 l
+222.01 219.66 l
+223.21 218.52 l
+224.43 217.40 l
+225.67 216.30 l
+226.94 215.23 l
+228.21 214.17 l
+229.51 213.14 l
+230.83 212.13 l
+232.16 211.14 l
+233.51 210.18 l
+234.88 209.24 l
+236.26 208.33 l
+237.66 207.44 l
+239.07 206.57 l
+240.50 205.73 l
+241.94 204.91 l
+243.40 204.12 l
+244.87 203.35 l
+246.35 202.61 l
+247.85 201.90 l
+249.36 201.21 l
+250.88 200.55 l
+252.41 199.92 l
+253.96 199.31 l
+255.51 198.73 l
+257.07 198.18 l
+258.64 197.65 l
+260.22 197.15 l
+261.81 196.68 l
+263.41 196.24 l
+265.02 195.82 l
+266.63 195.43 l
+268.25 195.08 l
+269.87 194.75 l
+271.50 194.44 l
+273.14 194.17 l
+274.78 193.92 l
+276.42 193.71 l
+278.07 193.52 l
+279.72 193.36 l
+281.37 193.23 l
+283.03 193.13 l
+284.68 193.06 l
+286.34 193.01 l
+288.00 193.00 l
+289.66 193.01 l
+291.32 193.06 l
+292.97 193.13 l
+294.63 193.23 l
+296.28 193.36 l
+297.93 193.52 l
+299.58 193.71 l
+301.22 193.92 l
+302.86 194.17 l
+304.50 194.44 l
+306.13 194.75 l
+307.75 195.08 l
+309.37 195.43 l
+310.98 195.82 l
+312.59 196.24 l
+314.19 196.68 l
+315.78 197.15 l
+317.36 197.65 l
+318.93 198.18 l
+320.49 198.73 l
+322.04 199.31 l
+323.59 199.92 l
+325.12 200.55 l
+326.64 201.21 l
+328.15 201.90 l
+329.65 202.61 l
+331.13 203.35 l
+332.60 204.12 l
+334.06 204.91 l
+335.50 205.73 l
+336.93 206.57 l
+338.34 207.44 l
+339.74 208.33 l
+341.12 209.24 l
+342.49 210.18 l
+343.84 211.14 l
+345.17 212.13 l
+346.49 213.14 l
+347.79 214.17 l
+349.06 215.23 l
+350.33 216.30 l
+351.57 217.40 l
+352.79 218.52 l
+353.99 219.66 l
+355.18 220.82 l
+356.34 222.01 l
+357.48 223.21 l
+358.60 224.43 l
+359.70 225.67 l
+360.77 226.94 l
+361.83 228.21 l
+362.86 229.51 l
+363.87 230.83 l
+364.86 232.16 l
+365.82 233.51 l
+366.76 234.88 l
+367.67 236.26 l
+368.56 237.66 l
+369.43 239.07 l
+370.27 240.50 l
+371.09 241.94 l
+371.88 243.40 l
+372.65 244.87 l
+373.39 246.35 l
+374.10 247.85 l
+374.79 249.36 l
+375.45 250.88 l
+376.08 252.41 l
+376.69 253.96 l
+377.27 255.51 l
+377.82 257.07 l
+378.35 258.64 l
+378.85 260.22 l
+379.32 261.81 l
+379.76 263.41 l
+380.18 265.02 l
+380.57 266.63 l
+380.92 268.25 l
+381.25 269.87 l
+381.56 271.50 l
+381.83 273.14 l
+382.08 274.78 l
+382.29 276.42 l
+382.48 278.07 l
+382.64 279.72 l
+382.77 281.37 l
+382.87 283.03 l
+382.94 284.68 l
+382.99 286.34 l
+383.00 288.00 l
+S
+BT
+0.000 0.000 0.000 rg
+/F2 1 Tf 18.00 0.00 -0.00 18.00 164.48 406.34 Tm (Rhodopsins) Tj
+ET
+BT
+/F2 1 Tf 18.00 0.00 -0.00 18.00 179.57 384.74 Tm [(\(T) 120 (otal 6\))] TJ
+ET
+0.000 0.000 0.000 RG
+98.00 129.67 380.00 316.67 re S
+BT
+/F2 1 Tf 18.00 0.00 -0.00 18.00 428.66 148.54 Tm (4) Tj
+ET
+BT
+/F2 1 Tf 18.00 0.00 -0.00 18.00 283.00 281.54 Tm (6) Tj
+ET
+Q
+endstream
+endobj
+7 0 obj
+6335
+endobj
+3 0 obj
+<<
+/Type /Pages
+/Kids [
+5 0 R
+]
+/Count 1
+/MediaBox [0 0 576 576]
+>>
+endobj
+4 0 obj
+<<
+/ProcSet [/PDF /Text]
+/Font <</F2 9 0 R /F3 10 0 R >>
+/ExtGState << >>
+>>
+endobj
+8 0 obj
+<<
+/Type /Encoding
+/BaseEncoding /WinAnsiEncoding
+/Differences [ 45/minus 96/quoteleft
+144/dotlessi /grave /acute /circumflex /tilde /macron /breve /dotaccent
+/dieresis /.notdef /ring /cedilla /.notdef /hungarumlaut /ogonek /caron /space]
+>>
+endobj
+9 0 obj <<
+/Type /Font
+/Subtype /Type1
+/Name /F2
+/BaseFont /Helvetica
+/Encoding 8 0 R
+>> endobj
+10 0 obj <<
+/Type /Font
+/Subtype /Type1
+/Name /F3
+/BaseFont /Helvetica-Bold
+/Encoding 8 0 R
+>> endobj
+xref
+0 11
+0000000000 65535 f 
+0000000021 00000 n 
+0000000164 00000 n 
+0000006701 00000 n 
+0000006784 00000 n 
+0000000213 00000 n 
+0000000293 00000 n 
+0000006681 00000 n 
+0000006876 00000 n 
+0000007133 00000 n 
+0000007229 00000 n 
+trailer
+<<
+/Size 11
+/Info 1 0 R
+/Root 2 0 R
+>>
+startxref
+7331
+%%EOF
--- a/tools/plotting/venn_list.py	Thu May 16 12:43:20 2013 -0400
+++ b/tools/plotting/venn_list.py	Thu May 16 12:43:57 2013 -0400
@@ -5,7 +5,7 @@
 (formerly SCRI), UK. All rights reserved.
 See accompanying text file for licence details (MIT/BSD style).
 
-This is version 0.0.3 of the script.
+This is version 0.0.4 of the script.
 """
 
 
@@ -46,8 +46,9 @@
 def load_ids(filename, filetype):
     if filetype=="tabular":
         for line in open(filename):
-            if not line.startswith("#"):
-                yield line.rstrip("\n").split("\t",1)[0]
+            line = line.rstrip("\n")
+            if line and not line.startswith("#"):
+                yield line.split("\t",1)[0]
     elif filetype=="fasta":
         for line in open(filename):
             if line.startswith(">"):
--- a/tools/plotting/venn_list.txt	Thu May 16 12:43:20 2013 -0400
+++ b/tools/plotting/venn_list.txt	Thu May 16 12:43:57 2013 -0400
@@ -32,6 +32,9 @@
 =======
 
 v0.0.3 - Initial public release.
+v0.0.4 - Ignore blank lines when loading IDs from tabular files
+v0.0.5 - Explicit Galaxy error handling of return codes
+v0.0.6 - Added unit tests.
 
 
 Developers
@@ -40,10 +43,10 @@
 This script and related tools are being developed on the following hg branch:
 http://bitbucket.org/peterjc/galaxy-central/src/tools
 
-For making the "Galaxy Tool Shed" http://community.g2.bx.psu.edu/ tarball use
+For making the "Galaxy Tool Shed" http://toolshed.g2.bx.psu.edu/ tarball use
 the following command from the Galaxy root folder:
 
-tar -czf venn_list.tar.gz tools/plotting/venn_list.*
+tar -czf venn_list.tar.gz tools/plotting/venn_list.* test-data/venn_list1.pdf test-data/venn_list.tabular
 
 Check this worked:
 
@@ -51,6 +54,8 @@
 tools/plotting/venn_list.py
 tools/plotting/venn_list.txt
 tools/plotting/venn_list.xml
+test-data/venn_list1.pdf
+test-data/venn_list.tabular
 
 
 Licence (MIT/BSD style)
--- a/tools/plotting/venn_list.xml	Thu May 16 12:43:20 2013 -0400
+++ b/tools/plotting/venn_list.xml	Thu May 16 12:43:57 2013 -0400
@@ -1,5 +1,9 @@
-<tool id="venn_list" name="Venn Diagram" version="0.0.3">
+<tool id="venn_list" name="Venn Diagram" version="0.0.6">
   <description>from lists</description>
+  <requirements>
+    <requirement type="python-module">rpy</requirement>
+    <requirement type="python-module">Bio</requirement>
+  </requirements>
   <command interpreter="python">
 venn_list.py
 #if $universe.type_select=="implicit":
@@ -12,6 +16,11 @@
   $s.set $s.set.ext "$s.lab"
 #end for
 $PDF</command>
+  <stdio>
+    <!-- Anything other than zero is an error -->
+    <exit_code range="1:" />
+    <exit_code range=":-1" />
+  </stdio>
   <inputs>
     <param name="main_lab" size="30" type="text" value="Venn Diagram" label="Plot title"/>
     <conditional name="universe">
@@ -32,13 +41,9 @@
   <outputs>
     <data format="pdf" name="PDF" />
   </outputs>
-  <requirements>
-    <requirement type="python-module">rpy</requirement>
-    <requirement type="python-module">Bio</requirement>
-  </requirements>
   <tests>
     <!-- Doesn't seem to work properly, manages to get two sets, both
-         with same FASTA file, but second with default "Group" label.
+         with same FASTA file, but second with default "Group" label. -->
     <test>
       <param name="type_select" value="explicit"/>
       <param name="main" value="venn_list.tabular" ftype="tabular"/>
@@ -47,7 +52,6 @@
       <param name="lab" value="Rhodopsins"/>
       <output name="PDF" file="venn_list1.pdf" ftype="pdf"/>
     </test>
-    -->
     <!-- Can't use more than one repeat value in tests (yet)
     <test>
       <param name="type_select" value="explicit"/>