diff add_expression_HPA.R @ 10:07858c6dbbff draft

"planemo upload commit 330a2527c7e20c4d189a0f1b7a184a8c4610b4b6-dirty"
author proteore
date Wed, 22 Jan 2020 15:26:11 +0000
parents 28d51adf8292
children f8d3a8a2f2e5
line wrap: on
line diff
--- a/add_expression_HPA.R	Wed Jan 22 15:20:35 2020 +0000
+++ b/add_expression_HPA.R	Wed Jan 22 15:26:11 2020 +0000
@@ -1,11 +1,7 @@
 # Read file and return file content as data.frame
 read_file <- function(path,header){
-  file <- try(read.csv(path,header=header, sep="\t",stringsAsFactors = FALSE, quote="\"", check.names = F),silent=TRUE)
-  if (inherits(file,"try-error")){
-    stop("File not found !")
-  }else{
-    return(file)
-  }
+  file <- read.csv(path,header=header, sep="\t",stringsAsFactors = FALSE, quote="\"", check.names = F)
+  return(file)
 }
 
 #convert a string to boolean
@@ -175,8 +171,7 @@
   check_ensembl_geneids(ids)
 
   # Read protein atlas
-  protein_atlas = args$atlas
-  protein_atlas = read_file(protein_atlas, T)
+  protein_atlas = read_file(args$atlas, T)
 
   # Add expression
   output = args$output