changeset 8:bca31ac678f1 draft

planemo upload commit 4ba1ebe7b3f5e3fabf78b5fed7ed0b92e2cbf9e5-dirty
author proteore
date Fri, 28 Jun 2019 05:18:44 -0400
parents 98b7912a9ceb
children 72295909dccf
files venn_diagram.py venn_diagram.xml
diffstat 2 files changed, 47 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/venn_diagram.py	Tue Mar 05 11:25:31 2019 -0500
+++ b/venn_diagram.py	Fri Jun 28 05:18:44 2019 -0400
@@ -47,20 +47,24 @@
         if input_type == "file":
             header = inputs[i][3]
             ncol = inputs[i][4]
-            file_content = open(input_file, "r").readlines()
+            with open(input_file,"r") as handle :
+                file_content = csv.reader(handle,delimiter="\t")
+                file_content = list(file_content)   #csv object to list
             
-            # Check if column number is in right form
-            if isnumber("int", ncol.replace("c", "")):
-                if header == "true":
-                    file_content = [x.strip() for x in [line.split("\t")[int(ncol.replace("c", ""))-1].split(";")[0] for line in file_content[1:]]]     # take only first IDs
+                # Check if column number is in right form
+                if isnumber("int", ncol.replace("c", "")):
+                    if header == "true":
+                        file_content = [x for x in [line[int(ncol.replace("c", ""))-1].split(";") for line in file_content[1:]]]     # gets ids from defined column
+                    else:
+                        file_content = [x for x in [line[int(ncol.replace("c", ""))-1].split(";") for line in file_content]] 
                 else:
-                    file_content = [x.strip() for x in [line.split("\t")[int(ncol.replace("c", ""))-1].split(";")[0] for line in file_content]]     # take only first IDs
-            else:
-                raise ValueError("Please fill in the right format of column number")        
+                    raise ValueError("Please fill in the right format of column number")        
         else:
             ids = set()
             file_content = inputs[i][0].split()
+            file_content = [x.split(";") for x in file_content]
             
+        file_content = [item.strip() for sublist in file_content for item in sublist if item != '']   #flat list of list of lists, remove empty items    
         ids.update(file_content)
         if 'NA' in ids : ids.remove('NA')
         comp_dict[title] = ids
--- a/venn_diagram.xml	Tue Mar 05 11:25:31 2019 -0500
+++ b/venn_diagram.xml	Fri Jun 28 05:18:44 2019 -0400
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<tool id="Jvenn" name="Venn diagram" version="2019.02.21">
+<tool id="Jvenn" name="Venn diagram" version="2019.06.27">
 	<description>[JVenn]
 	</description>
 	<command><![CDATA[
@@ -44,7 +44,7 @@
 					</param>
 				</when>
 			</conditional>
-			<param type="text" name="name" value="" label="Enter the name of this list" help="This name will be displayed on venn diagram">
+			<param type="text" name="name" value="" label="Enter the name of this list" help="This name will be displayed on venn diagram" optional="false">
 				<sanitizer>
 					<valid initial="string.printable">
 						<remove value="&apos;"/>
@@ -53,6 +53,7 @@
 						<add source="&apos;" target="__sq__"/>
 					</mapping>
 				</sanitizer>
+				<validator type="regex" message="Please enter a list name">[a-zA-Z0-9._-]+</validator>
 			</param>
 		</repeat>
 	</inputs>
@@ -102,7 +103,7 @@
 
 -----
 
-**Inputs**
+**Input**
 
 Can be either a list entered in a copy/paste mode or a single or multi-columns file (txt, tsv, csv, tab, output from other tools) up to six lists/files
 
@@ -110,18 +111,38 @@
 		
 * **for example an IDs list file** in .txt format, with 1 ID per line
 
-AMY1A
-  
-ALB	
+.. csv-table:: tab1
+    :header: "Ids"
+
 
-IGKC	
-
-CSTA	
-
-IGHA1 	
+    "AMY1A"
+    "ALB"	
+    "IGKC"	
+    "CSTA"	
+    "IGHA1"
 		
 If you use a file as input list, it is necessary to specify the column number on which to apply the comparison.
 
+Ids in a line will be split by ";", so if you have this kind of input : 
+
+.. csv-table:: tab with multiple ids per line
+    :header: "Ids"
+
+    "P22531"
+    "P04792"
+    "P01834"
+    "Q96KK5"
+    "Q06830;P60709;P13646;P31949"
+    "P06702"
+    "P14923"
+    "Q13835"
+
+All ID will be considered (i.e. Q06830,P60709,P13646 and P31949 will be split).
+
+.. class:: warningmark
+	
+In copy/paste mode, the number of IDs considered in input is limited to 5000.
+
 -----
 
 **Parameter**
@@ -134,7 +155,7 @@
 
 Two outputs are generated:
 		
-* **Graphical file**: Venn diagram that you can either display (interactive mode) or download as image (PNG, SVG format)
+* **Graphical file**: Venn diagram that you can either display (interactive mode) or download as an image (PNG, SVG format)
 		
 * **Venn text output file** : a text file containing specific elements or shared by lists/files.
 
@@ -150,11 +171,11 @@
 
 **Galaxy integration**
 
-T.P. Lien Nguyen, Florence Combes, Yves Vandenbrouck CEA, INSERM, CNRS, Grenoble-Alpes University, BIG Institute, FR
+Lien Nguyen, David Chistiany, Florence Combes, Yves Vandenbrouck CEA, INSERM, CNRS, Grenoble-Alpes University, BIG Institute, FR
 
 Sandra Dérozier, Olivier Rué, Christophe Caron, Valentin Loux INRA, Paris-Saclay University, MAIAGE Unit,Migale Bioinformatics platform
 
-Contact support@proteore.org for any questions or concerns about the Galaxy implementation of this tool.
+Help: contact@proteore.org for any questions or concerns about this tool.
 ]]></help>
    <citations>
    </citations>