Code cleanup

This commit is contained in:
2022-02-26 09:56:46 -06:00
parent 1ea68045ce
commit 817fe51708
2 changed files with 59 additions and 57 deletions

View File

@@ -15,32 +15,33 @@ public class GraphWithMapData implements java.io.Serializable {
private Integer alphaCount;
private Integer betaCount;
private final Map<Integer, Integer> distCellsMapAlphaKey;
private final Map<Integer, Integer> plateVtoAMap;
private final Map<Integer, Integer> plateVtoBMap;
private final Map<Integer, Integer> plateAtoVMap;
private final Map<Integer, Integer> plateBtoVMap;
private final Map<Integer, Integer> alphaWellCounts;
private final Map<Integer, Integer> betaWellCounts;
// private final Map<Integer, Integer> plateVtoAMap;
// private final Map<Integer, Integer> plateVtoBMap;
// private final Map<Integer, Integer> plateAtoVMap;
// private final Map<Integer, Integer> plateBtoVMap;
// private final Map<Integer, Integer> alphaWellCounts;
// private final Map<Integer, Integer> betaWellCounts;
private final Duration time;
public GraphWithMapData(SimpleWeightedGraph graph, Integer numWells, Integer[] wellConcentrations,
Integer alphaCount, Integer betaCount,
Map<Integer, Integer> distCellsMapAlphaKey, Map<Integer, Integer> plateVtoAMap,
Map<Integer,Integer> plateVtoBMap, Map<Integer, Integer> plateAtoVMap,
Map<Integer, Integer> plateBtoVMap, Map<Integer, Integer> alphaWellCounts,
Map<Integer, Integer> betaWellCounts, Duration time) {
Map<Integer, Integer> distCellsMapAlphaKey, Duration time){
// Map<Integer, Integer> plateVtoAMap, Integer alphaCount, Integer betaCount,
// Map<Integer,Integer> plateVtoBMap, Map<Integer, Integer> plateAtoVMap,
// Map<Integer, Integer> plateBtoVMap, Map<Integer, Integer> alphaWellCounts,
// Map<Integer, Integer> 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<Integer, Integer> getDistCellsMapAlphaKey() {
return distCellsMapAlphaKey;
}
public Map<Integer, Integer> getPlateVtoAMap() {
return plateVtoAMap;
}
public Map<Integer, Integer> getPlateVtoBMap() {
return plateVtoBMap;
}
public Map<Integer, Integer> getPlateAtoVMap() {
return plateAtoVMap;
}
public Map<Integer, Integer> getPlateBtoVMap() {
return plateBtoVMap;
}
public Map<Integer, Integer> getAlphaWellCounts() {
return alphaWellCounts;
}
public Map<Integer, Integer> getBetaWellCounts() {
return betaWellCounts;
}
// public Map<Integer, Integer> getPlateVtoAMap() {
// return plateVtoAMap;
// }
//
// public Map<Integer, Integer> getPlateVtoBMap() {
// return plateVtoBMap;
// }
//
// public Map<Integer, Integer> getPlateAtoVMap() {
// return plateAtoVMap;
// }
//
// public Map<Integer, Integer> getPlateBtoVMap() {
// return plateBtoVMap;
// }
//
// public Map<Integer, Integer> getAlphaWellCounts() {
// return alphaWellCounts;
// }
//
// public Map<Integer, Integer> getBetaWellCounts() {
// return betaWellCounts;
// }
public Duration getTime() {
return time;

View File

@@ -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<Vertex[], Integer> 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<Integer, Integer> distCellsMapAlphaKey = data.getDistCellsMapAlphaKey();
Set<Vertex> alphas = new HashSet<>();
Set<Vertex> 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");}