From 6678c781639cec23323dc636c176815ca0f024a0 Mon Sep 17 00:00:00 2001 From: Tony Wu Date: Fri, 25 Jul 2025 10:02:15 -0400 Subject: [PATCH] adjust error handling for zero edges and handling of issue column --- R/utils_getSubnetworkFromIndra.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/R/utils_getSubnetworkFromIndra.R b/R/utils_getSubnetworkFromIndra.R index 34c4fbb..207b150 100644 --- a/R/utils_getSubnetworkFromIndra.R +++ b/R/utils_getSubnetworkFromIndra.R @@ -116,7 +116,9 @@ } input <- input[!is.na(input$log2FC) & abs(input$log2FC) > logfc_cutoff, ] } - input <- input[is.na(input$issue), ] + if ("issue" %in% colnames(input)) { + input <- input[is.na(input$issue), ] + } # Combine filtered data with exempt proteins and remove duplicates if (!is.null(exempt_proteins) && nrow(exempt_proteins) > 0) { @@ -295,7 +297,7 @@ edges <- edges[which(abs(edges$correlation) >= correlation_cutoff), ] } if (nrow(edges) == 0) { - warning("No edges remain after applying filters. Consider relaxing filters") + stop("No edges remain after applying filters. Consider relaxing filters") } return(edges) }