From d946afa699902a17eda5e36bccae3dfb47a9d7ca Mon Sep 17 00:00:00 2001 From: asizemore Date: Fri, 12 Jan 2024 13:55:46 -0500 Subject: [PATCH 1/2] remove nan links from bipartite networks --- .../correlation/AbstractCorrelationBipartiteNetwork.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/veupathdb/service/eda/ds/plugin/correlation/AbstractCorrelationBipartiteNetwork.java b/src/main/java/org/veupathdb/service/eda/ds/plugin/correlation/AbstractCorrelationBipartiteNetwork.java index d018ba6c..5d3711dd 100644 --- a/src/main/java/org/veupathdb/service/eda/ds/plugin/correlation/AbstractCorrelationBipartiteNetwork.java +++ b/src/main/java/org/veupathdb/service/eda/ds/plugin/correlation/AbstractCorrelationBipartiteNetwork.java @@ -67,9 +67,10 @@ protected void writeResults(OutputStream out, Map dataStrea // each node. stats.getStatistics().forEach((correlationRow) -> { - // Skip rows that have no correlation coefficient or a correlation coef that is too small. Filtering here prevents us + // Skip rows that have no correlation coefficient, a NaN correlation coef, or a correlation coef that is too small. Filtering here prevents us // from showing nodes with no links. if (correlationRow.getCorrelationCoef() == null) return; + if (correlationRow.getCorrelationCoef() == "NaN") return; if (Math.abs(Float.parseFloat(correlationRow.getCorrelationCoef())) < correlationCoefThreshold.floatValue()) return; if (correlationRow.getPValue() != null) { if (Float.parseFloat(correlationRow.getPValue()) > pValueThreshold.floatValue()) return; From fe03e4c9d61b50fe2edaf815376588443a6fa0a8 Mon Sep 17 00:00:00 2001 From: asizemore Date: Tue, 16 Jan 2024 06:04:35 -0500 Subject: [PATCH 2/2] remove any NaN coming our way --- .../plugin/correlation/AbstractCorrelationBipartiteNetwork.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/veupathdb/service/eda/ds/plugin/correlation/AbstractCorrelationBipartiteNetwork.java b/src/main/java/org/veupathdb/service/eda/ds/plugin/correlation/AbstractCorrelationBipartiteNetwork.java index 5d3711dd..304ed908 100644 --- a/src/main/java/org/veupathdb/service/eda/ds/plugin/correlation/AbstractCorrelationBipartiteNetwork.java +++ b/src/main/java/org/veupathdb/service/eda/ds/plugin/correlation/AbstractCorrelationBipartiteNetwork.java @@ -70,7 +70,7 @@ protected void writeResults(OutputStream out, Map dataStrea // Skip rows that have no correlation coefficient, a NaN correlation coef, or a correlation coef that is too small. Filtering here prevents us // from showing nodes with no links. if (correlationRow.getCorrelationCoef() == null) return; - if (correlationRow.getCorrelationCoef() == "NaN") return; + if (Float.isNaN(Float.parseFloat(correlationRow.getCorrelationCoef()))) return; if (Math.abs(Float.parseFloat(correlationRow.getCorrelationCoef())) < correlationCoefThreshold.floatValue()) return; if (correlationRow.getPValue() != null) { if (Float.parseFloat(correlationRow.getPValue()) > pValueThreshold.floatValue()) return;