# HG changeset patch # User eschen42 # Date 1502218348 14400 # Node ID bd340dffd88718d424506ecfd5a730d895e74abc # Parent 45efa59a7269d7bfa36c9a747693178e78574aef planemo upload for repository https://github.com/HegemanLab/w4mkmeans_galaxy_wrapper/tree/master commit 299e5c7fdb0d6eb0773f3660009f6d63c2082a8d diff -r 45efa59a7269 -r bd340dffd887 w4mkmeans_wrapper.R --- 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) + } + ) } ##--------