From 8a77d53f1f24e5b9c306a86da8d9cf655f8f1684 Mon Sep 17 00:00:00 2001 From: eugenefischer <66030419+eugenefischer@users.noreply.github.com> Date: Sun, 25 Sep 2022 17:20:50 -0500 Subject: [PATCH] Output sequence counts before and after pre-filtering (currently pre-filtering only sequences present in all wells) --- src/main/java/GraphWithMapData.java | 18 +++++++++--------- src/main/java/Simulator.java | 14 ++++++++------ 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/main/java/GraphWithMapData.java b/src/main/java/GraphWithMapData.java index 8f9ab03..aad6c2f 100644 --- a/src/main/java/GraphWithMapData.java +++ b/src/main/java/GraphWithMapData.java @@ -25,9 +25,9 @@ public class GraphWithMapData implements java.io.Serializable { private final Duration time; public GraphWithMapData(SimpleWeightedGraph graph, Integer numWells, Integer[] wellConcentrations, - Map distCellsMapAlphaKey, Duration time){ + Map distCellsMapAlphaKey, Integer alphaCount, Integer betaCount, Duration time){ -// Map plateVtoAMap, Integer alphaCount, Integer betaCount, +// Map plateVtoAMap, // Map plateVtoBMap, Map plateAtoVMap, // Map plateBtoVMap, Map alphaWellCounts, // Map betaWellCounts,) { @@ -58,13 +58,13 @@ public class GraphWithMapData implements java.io.Serializable { return wellPopulations; } -// public Integer getAlphaCount() { -// return alphaCount; -// } -// -// public Integer getBetaCount() { -// return betaCount; -// } + public Integer getAlphaCount() { + return alphaCount; + } + + public Integer getBetaCount() { + return betaCount; + } public Map getDistCellsMapAlphaKey() { return distCellsMapAlphaKey; diff --git a/src/main/java/Simulator.java b/src/main/java/Simulator.java index 0d9e17b..28dd8ff 100644 --- a/src/main/java/Simulator.java +++ b/src/main/java/Simulator.java @@ -129,7 +129,7 @@ public class Simulator implements GraphModificationFunctions { Duration time = Duration.between(start, stop); //create GraphWithMapData object - GraphWithMapData output = new GraphWithMapData(graph, numWells, samplePlate.getPopulations(), distCellsMapAlphaKey, time); + GraphWithMapData output = new GraphWithMapData(graph, numWells, samplePlate.getPopulations(), distCellsMapAlphaKey, alphaCount, betaCount, time); //Set source file name in graph to name of sample plate output.setSourceFilename(samplePlate.getFilename()); //return GraphWithMapData object @@ -158,8 +158,8 @@ public class Simulator implements GraphModificationFunctions { betas.add(v); } } - Integer alphaCount = alphas.size(); - Integer betaCount = betas.size(); + Integer graphAlphaCount = alphas.size(); + Integer graphBetaCount = betas.size(); //remove edges with weights outside given overlap thresholds, add those to removed edge list if(verbose){System.out.println("Eliminating edges with weights outside overlap threshold values");} @@ -266,7 +266,7 @@ public class Simulator implements GraphModificationFunctions { //Metadata comments for CSV file String algoType = "LEDA book with heap: " + heapType; - int min = Math.min(alphaCount, betaCount); + int min = Math.min(graphAlphaCount, graphBetaCount); //matching weight BigDecimal totalMatchingWeight = maxWeightMatching.getMatchingWeight(); //rate of attempted matching @@ -301,8 +301,10 @@ public class Simulator implements GraphModificationFunctions { metadata.put("algorithm type", algoType); metadata.put("matching weight", totalMatchingWeight.toString()); metadata.put("well populations", wellPopulationsString); - metadata.put("total alphas found", alphaCount.toString()); - metadata.put("total betas found", betaCount.toString()); + metadata.put("total alphas on plate", data.getAlphaCount().toString()); + metadata.put("total betas on plate", data.getBetaCount().toString()); + metadata.put("alphas in graph (after pre-filtering)", graphAlphaCount.toString()); + metadata.put("betas in graph (after pre-filtering)", graphBetaCount.toString()); metadata.put("high overlap threshold", highThreshold.toString()); metadata.put("low overlap threshold", lowThreshold.toString()); metadata.put("minimum overlap percent", minOverlapPercent.toString());