Skip to content

Commit

Permalink
Improved error handling when CIBERSORTx server is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
manszamore committed Jan 21, 2025
1 parent 72d5305 commit 0f47e61
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/create_signature_matrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ create_signature_matrix <- function(
stop(glue::glue("CIBERSORTx failed. Error code: {command_output}"))
}

if (str_detect(command_output, "IP address has changed")) {
stop("CIBERSORTx failed. A likely reason is that the CIBERSORTx server is down.")
}

signature_matrix_file <- grep(basename(refsample_file), list.files(output_dir, pattern = "\\.txt$", full.names = TRUE), value = TRUE)
if (length(signature_matrix_file) == 0) {
stop("No signature matrix file found in the output directory.")
Expand Down

0 comments on commit 0f47e61

Please sign in to comment.