changeset 4:5cd79aa7aac9 draft

planemo upload commit ed42daf54e6d0fa2a693b501c7ebca4efe4d95e3-dirty
author proteore
date Mon, 13 May 2019 11:45:29 -0400
parents 3bedd074c485
children b5be6d94f2a1
files get_expression_profiles.R get_expression_profiles.xml proteore_protein_atlas_normal_tissue.loc.sample proteore_protein_atlas_tumor_tissue.loc.sample
diffstat 4 files changed, 21 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/get_expression_profiles.R	Wed Mar 06 09:19:05 2019 -0500
+++ b/get_expression_profiles.R	Mon May 13 11:45:29 2019 -0400
@@ -69,6 +69,15 @@
   return(res)
 }
 
+clean_ids <- function(ids){
+  
+  ids = gsub(" ","",ids)
+  ids = ids[which(ids!="")]
+  ids = ids[which(ids!="NA")]
+  ids = ids[!is.na(ids)]
+ 
+  return(ids) 
+}
 
 main <- function() {
   args <- commandArgs(TRUE)
@@ -109,16 +118,17 @@
   # Extract input
   input_type = args$input_type
   if (input_type == "list") {
-    list_id = strsplit(args$input, "[ \t\n]+")[[1]]
+    ids = unlist(strsplit(strsplit(args$input, "[ \t\n]+")[[1]],";"))
   } else if (input_type == "file") {
     filename = args$input
     column_number = as.numeric(gsub("c", "" ,args$column_number))
     header = str2bool(args$header)
     file = read_file(filename, header)
-    list_id = sapply(strsplit(file[,column_number], ";"), "[", 1)
+    ids = unlist(strsplit(file[,column_number], ";"))
   }
-  input = list_id
-
+  #filter ids
+  ids = clean_ids(ids)
+  
   # Read reference file
   reference_file = read_file(args$ref_file, TRUE)
 
@@ -130,11 +140,11 @@
     level = strsplit(args$level, ",")[[1]]
     reliability = strsplit(args$reliability, ",")[[1]]
     # Calculation
-    res = annot.HPAnorm(input, reference_file, tissue, level, reliability, not_mapped_option)
+    res = annot.HPAnorm(ids, reference_file, tissue, level, reliability, not_mapped_option)
   } else if (atlas=="cancer") {
     cancer = strsplit(args$cancer, ",")[[1]]
     # Calculation
-    res = annot.HPAcancer(input, reference_file, cancer, not_mapped_option)
+    res = annot.HPAcancer(ids, reference_file, cancer, not_mapped_option)
   }
   
   # Write output
--- a/get_expression_profiles.xml	Wed Mar 06 09:19:05 2019 -0500
+++ b/get_expression_profiles.xml	Mon May 13 11:45:29 2019 -0400
@@ -1,4 +1,4 @@
-<tool id="sel_ann_hpa" name="Get expression profiles" version="2019.03.06">
+<tool id="sel_ann_hpa" name="Get expression profiles" version="2019.03.13">
     <description>by (normal or tumor) tissue/cell type [Human Protein Atlas]
     </description>
     <requirements>
@@ -196,6 +196,8 @@
 
 A list of ENSG (Ensembl gene) IDs must be entered (either via a copy/paste or by choosing a file); if it's not the case, please use the ID_Converter tool of ProteoRE.
 
+A line can contains multiple ids if separated by ";". 
+
 -----
 
 **Parameters**
--- a/proteore_protein_atlas_normal_tissue.loc.sample	Wed Mar 06 09:19:05 2019 -0500
+++ b/proteore_protein_atlas_normal_tissue.loc.sample	Mon May 13 11:45:29 2019 -0400
@@ -1,2 +1,2 @@
 #<id>	<name>	<tissue>	<value>
-HPA_normal_tissue_19-07-2018	HPA normal tissue 19/07/2018	HPA_normal_tissue	/tool-data/HPA_normal_tissue_23-10-2018.tsv
+HPA_normal_tissue_23-10-2018	HPA normal tissue 23/10/2018	HPA_normal_tissue	/tool-data/HPA_normal_tissue_23-10-2018.tsv
--- a/proteore_protein_atlas_tumor_tissue.loc.sample	Wed Mar 06 09:19:05 2019 -0500
+++ b/proteore_protein_atlas_tumor_tissue.loc.sample	Mon May 13 11:45:29 2019 -0400
@@ -1,2 +1,2 @@
 #<id>	<name>	<tissue>	<value>
-HPA_pathology_19-07-2018	HPA pathology 19/07/2018	HPA_pathology	/tool-data/HPA_pathology_23-10-2018.tsv
+HPA_pathology_23-10-2018	HPA pathology 23/10/2018	HPA_pathology	/tool-data/HPA_pathology_23-10-2018.tsv