changeset 2:bd340dffd887 draft

planemo upload for repository https://github.com/HegemanLab/w4mkmeans_galaxy_wrapper/tree/master commit 299e5c7fdb0d6eb0773f3660009f6d63c2082a8d
author eschen42
date Tue, 08 Aug 2017 14:52:28 -0400
parents 45efa59a7269
children afb738a080b9
files w4mkmeans_wrapper.R
diffstat 1 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/w4mkmeans_wrapper.R	Tue Aug 08 12:31:55 2017 -0400
+++ b/w4mkmeans_wrapper.R	Tue Aug 08 14:52:28 2017 -0400
@@ -324,10 +324,6 @@
   log_print(sprintf("unexpected result keys %s", names(result)))
   # exit with status code non-zero to indicate error
   q(save = "no", status = 1, runLast = FALSE)
-} else if ( ! write_result(result = result$scores, file_path = scores_out, kind_string = "cluster scores")$success ) {
-  log_print("failed to write output file for cluster scores")
-  # exit with status code non-zero to indicate error
-  q(save = "no", status = 1, runLast = FALSE)
 } else if ( ! write_result(result = result$variableMetadata, file_path = variableMetadata_out, kind_string = "clustered variableMetadata")$success ) {
   log_print("failed to write output file for clustered variableMetadata")
   # exit with status code non-zero to indicate error
@@ -336,6 +332,19 @@
   log_print("failed to write output file for clustered sampleMetadata")
   # exit with status code non-zero to indicate error
   q(save = "no", status = 1, runLast = FALSE)
+} else {
+  tryCatch(
+    expr = {
+      fileConn<-file(scores_out)
+      writeLines(result$scores, fileConn)
+      close(fileConn)
+    }
+  , error = function(e) {
+      log_print(sprintf("failed to write output file for cluster scores - %s", format_error(e)))
+      # exit with status code non-zero to indicate error
+      q(save = "no", status = 1, runLast = FALSE)
+    }
+  )
 }
 
 ##--------