From 817fe51708baf3623fcf99bae3d61b67f5694ff8 Mon Sep 17 00:00:00 2001 From: efischer Date: Sat, 26 Feb 2022 09:56:46 -0600 Subject: [PATCH] Code cleanup --- src/main/java/GraphWithMapData.java | 95 +++++++++++++++-------------- src/main/java/Simulator.java | 21 ++++--- 2 files changed, 59 insertions(+), 57 deletions(-) diff --git a/src/main/java/GraphWithMapData.java b/src/main/java/GraphWithMapData.java index 3795190..0e4c09b 100644 --- a/src/main/java/GraphWithMapData.java +++ b/src/main/java/GraphWithMapData.java @@ -15,32 +15,33 @@ public class GraphWithMapData implements java.io.Serializable { private Integer alphaCount; private Integer betaCount; private final Map distCellsMapAlphaKey; - private final Map plateVtoAMap; - private final Map plateVtoBMap; - private final Map plateAtoVMap; - private final Map plateBtoVMap; - private final Map alphaWellCounts; - private final Map betaWellCounts; +// private final Map plateVtoAMap; +// private final Map plateVtoBMap; +// private final Map plateAtoVMap; +// private final Map plateBtoVMap; +// private final Map alphaWellCounts; +// private final Map betaWellCounts; private final Duration time; public GraphWithMapData(SimpleWeightedGraph graph, Integer numWells, Integer[] wellConcentrations, - Integer alphaCount, Integer betaCount, - Map distCellsMapAlphaKey, Map plateVtoAMap, - Map plateVtoBMap, Map plateAtoVMap, - Map plateBtoVMap, Map alphaWellCounts, - Map betaWellCounts, Duration time) { + Map distCellsMapAlphaKey, Duration time){ + +// Map plateVtoAMap, Integer alphaCount, Integer betaCount, +// Map plateVtoBMap, Map plateAtoVMap, +// Map plateBtoVMap, Map alphaWellCounts, +// Map betaWellCounts,) { this.graph = graph; this.numWells = numWells; this.wellPopulations = wellConcentrations; this.alphaCount = alphaCount; this.betaCount = betaCount; this.distCellsMapAlphaKey = distCellsMapAlphaKey; - this.plateVtoAMap = plateVtoAMap; - this.plateVtoBMap = plateVtoBMap; - this.plateAtoVMap = plateAtoVMap; - this.plateBtoVMap = plateBtoVMap; - this.alphaWellCounts = alphaWellCounts; - this.betaWellCounts = betaWellCounts; +// this.plateVtoAMap = plateVtoAMap; +// this.plateVtoBMap = plateVtoBMap; +// this.plateAtoVMap = plateAtoVMap; +// this.plateBtoVMap = plateBtoVMap; +// this.alphaWellCounts = alphaWellCounts; +// this.betaWellCounts = betaWellCounts; this.time = time; } @@ -56,41 +57,41 @@ 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; } - public Map getPlateVtoAMap() { - return plateVtoAMap; - } - - public Map getPlateVtoBMap() { - return plateVtoBMap; - } - - public Map getPlateAtoVMap() { - return plateAtoVMap; - } - - public Map getPlateBtoVMap() { - return plateBtoVMap; - } - - public Map getAlphaWellCounts() { - return alphaWellCounts; - } - - public Map getBetaWellCounts() { - return betaWellCounts; - } +// public Map getPlateVtoAMap() { +// return plateVtoAMap; +// } +// +// public Map getPlateVtoBMap() { +// return plateVtoBMap; +// } +// +// public Map getPlateAtoVMap() { +// return plateAtoVMap; +// } +// +// public Map getPlateBtoVMap() { +// return plateBtoVMap; +// } +// +// public Map getAlphaWellCounts() { +// return alphaWellCounts; +// } +// +// public Map getBetaWellCounts() { +// return betaWellCounts; +// } public Duration getTime() { return time; diff --git a/src/main/java/Simulator.java b/src/main/java/Simulator.java index 2d635d7..5fb414b 100644 --- a/src/main/java/Simulator.java +++ b/src/main/java/Simulator.java @@ -19,11 +19,12 @@ import static java.lang.Float.*; //NOTE: "sequence" in method and variable names refers to a peptide sequence from a simulated T cell public class Simulator implements GraphModificationFunctions { - //These are the indices of the different sequences within a cell array - private static final int cdr3AlphaIndex = 0; - private static final int cdr3BetaIndex = 1; - private static final int cdr1AlphaIndex = 2; - private static final int cdr1BetaIndex = 3; + //Replaced with SequenceType ordinals +// //These are the indices of the different sequences within a cell array +// private static final int cdr3AlphaIndex = 0; +// private static final int cdr3BetaIndex = 1; +// private static final int cdr1AlphaIndex = 2; +// private static final int cdr1BetaIndex = 3; //Make the graph needed for matching sequences. //sourceVertexIndices and targetVertexIndices are indices within the cell to use as for the two sets of vertices @@ -127,9 +128,7 @@ public class Simulator implements GraphModificationFunctions { Duration time = Duration.between(start, stop); //create GraphWithMapData object - GraphWithMapData output = new GraphWithMapData(graph, numWells, samplePlate.getPopulations(), alphaCount, betaCount, - distCellsMapAlphaKey, plateVtoAMap, plateVtoBMap, plateAtoVMap, - plateBtoVMap, alphaWellCounts, betaWellCounts, time); + GraphWithMapData output = new GraphWithMapData(graph, numWells, samplePlate.getPopulations(), distCellsMapAlphaKey, time); //Set source file name in graph to name of sample plate output.setSourceFilename(samplePlate.getSourceFileName()); //return GraphWithMapData object @@ -145,8 +144,8 @@ public class Simulator implements GraphModificationFunctions { Map removedEdges = new HashMap<>(); boolean saveEdges = BiGpairSEQ.cacheGraph(); int numWells = data.getNumWells(); - Integer alphaCount = data.getAlphaCount(); - Integer betaCount = data.getBetaCount(); + //Integer alphaCount = data.getAlphaCount(); + //Integer betaCount = data.getBetaCount(); Map distCellsMapAlphaKey = data.getDistCellsMapAlphaKey(); Set alphas = new HashSet<>(); Set betas = new HashSet<>(); @@ -158,6 +157,8 @@ public class Simulator implements GraphModificationFunctions { betas.add(v); } } + Integer alphaCount = alphas.size(); + Integer betaCount = 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");}