changeset 6:fc0118aa432a draft

planemo upload commit 5221e042cb207f593b144ed857106235b8f5fbde-dirty
author proteore
date Tue, 20 Mar 2018 11:13:49 -0400
parents 867d47ff782c
children af7089d1c7c0
files prot_features.xml protein_features.R
diffstat 2 files changed, 16 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/prot_features.xml	Wed Mar 14 12:04:32 2018 -0400
+++ b/prot_features.xml	Tue Mar 20 11:13:49 2018 -0400
@@ -49,7 +49,16 @@
       <option value="copy_paste">Copy/paste your list of IDs</option> 
     </param>
     <when value="copy_paste">
-      <param name="genelist" type="text" label="Enter a list of identifiers"/>
+      <param name="genelist" type="text" label="Enter a list of identifiers">
+        <sanitizer>
+            <valid initial="string.printable">
+                <remove value="&apos;"/>
+            </valid>
+            <mapping initial="none">
+                <add source="&apos;" target="__sq__"/>
+            </mapping>
+        </sanitizer>
+      </param>
     </when>
     <when value="file_all">
       <param name="genelist" type="data" format="txt,tabular" label="Choose a file that contains your list of IDs" help="This file must imperatively have 1 column filled with IDs consistent with the neXtprot database (Uniprot accession number or neXtProt ID). If this is not the case, please use the ID_Converter tool."/>
--- a/protein_features.R	Wed Mar 14 12:04:32 2018 -0400
+++ b/protein_features.R	Tue Mar 20 11:13:49 2018 -0400
@@ -2,16 +2,16 @@
 readfile = function(filename, header) {
   if (header == "true") {
     # Read only first line of the file as header:
-    headers <- read.table(filename, nrows = 1, header = FALSE, sep = "\t", stringsAsFactors = FALSE, fill = TRUE, na.strings=c("", "NA"), blank.lines.skip = TRUE)
+    headers <- read.table(filename, nrows = 1, header = FALSE, sep = "\t", stringsAsFactors = FALSE, fill = TRUE, na.strings=c("", "NA"), blank.lines.skip = TRUE, quote = "")
     #Read the data of the files (skipping the first row)
-    file <- read.table(filename, skip = 1, header = FALSE, sep = "\t", stringsAsFactors = FALSE, fill = TRUE, na.strings=c("", "NA"), blank.lines.skip = TRUE)
+    file <- read.table(filename, skip = 1, header = FALSE, sep = "\t", stringsAsFactors = FALSE, fill = TRUE, na.strings=c("", "NA"), blank.lines.skip = TRUE, quote = "")
     # Remove empty rows
     file <- file[!apply(is.na(file) | file == "", 1, all), , drop=FALSE]
     #And assign the header to the data
     names(file) <- headers
   }
   else {
-    file <- read.table(filename, header = FALSE, sep = "\t", stringsAsFactors = FALSE, fill = TRUE, na.strings=c("", "NA"), blank.lines.skip = TRUE)
+    file <- read.table(filename, header = FALSE, sep = "\t", stringsAsFactors = FALSE, fill = TRUE, na.strings=c("", "NA"), blank.lines.skip = TRUE, quote = "")
     # Remove empty rows
     file <- file[!apply(is.na(file) | file == "", 1, all), , drop=FALSE]
   }
@@ -49,7 +49,7 @@
 
   inputtype = args$inputtype
   if (inputtype == "copypaste") {
-    input = strsplit(args$input, " ")[[1]]
+    input = strsplit(args$input, "[ \t\n]+")[[1]]
   }
   else if (inputtype == "tabfile") {
     filename = args$input
@@ -90,7 +90,7 @@
 
   # Select user input protein ids in nextprot
   if ((length(input[input %in% nextprot[,1]]))==0){
-    write.table("None of the input ids are can be found in Nextprot",file=filename,sep="\t",quote=FALSE,col.names=TRUE,row.names=FALSE)
+    write.table("None of the input ids are can be found in Nextprot",file=output,sep="\t",quote=FALSE,col.names=TRUE,row.names=FALSE)
   } else {
     names = c()
     res = matrix(nrow=length(input), ncol=0)
@@ -117,6 +117,7 @@
         res = cbind(res, info)
       }
     }
+    --inputtype="tabfile" --input="Galaxy50-[ID_Converter_on_data_47].tabular" --header='true' --natlas="proteinatlas.csv" --column='c7' --select='Gene,Gene.description,Evidence,RNA.tissue.category,Reliability.IH,TPM.max.in.non.specific' --output="test.txt"
 
     # Write output
     if (inputtype == "copypaste") {