Refactor plate to fill its own wells in its constructor
This commit is contained in:
@@ -290,7 +290,7 @@ public class InteractiveInterface {
|
||||
else {
|
||||
System.out.println("Reading Sample Plate file: " + plateFile);
|
||||
PlateFileReader plateReader = new PlateFileReader(plateFile);
|
||||
plate = new Plate(plateReader.getFilename(), plateReader.getWells());
|
||||
plate = plateReader.getSamplePlate();
|
||||
if(BiGpairSEQ.cachePlate()) {
|
||||
BiGpairSEQ.setPlateInMemory(plate, plateFile);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import java.util.*;
|
||||
public class Plate {
|
||||
private CellSample cells;
|
||||
private String sourceFile;
|
||||
private String filename;
|
||||
private List<List<Integer[]>> wells;
|
||||
private final Random rand = BiGpairSEQ.getRand();
|
||||
private int size;
|
||||
@@ -45,8 +46,9 @@ public class Plate {
|
||||
wells = new ArrayList<>();
|
||||
}
|
||||
|
||||
public Plate(String sourceFileName, List<List<Integer[]>> wells) {
|
||||
this.sourceFile = sourceFileName;
|
||||
//constructor for returning a Plate from a PlateFileReader
|
||||
public Plate(String filename, List<List<Integer[]>> wells) {
|
||||
this.filename = filename;
|
||||
this.wells = wells;
|
||||
this.size = wells.size();
|
||||
|
||||
@@ -176,4 +178,6 @@ public class Plate {
|
||||
public String getSourceFileName() {
|
||||
return sourceFile;
|
||||
}
|
||||
|
||||
public String getFilename() { return filename; }
|
||||
}
|
||||
|
||||
@@ -56,11 +56,8 @@ public class PlateFileReader {
|
||||
|
||||
}
|
||||
|
||||
public List<List<Integer[]>> getWells() {
|
||||
return wells;
|
||||
public Plate getSamplePlate() {
|
||||
return new Plate(filename, wells);
|
||||
}
|
||||
|
||||
public String getFilename() {
|
||||
return filename;
|
||||
}
|
||||
}
|
||||
@@ -113,7 +113,7 @@ public class Simulator implements GraphModificationFunctions {
|
||||
distCellsMapAlphaKey, plateVtoAMap, plateVtoBMap, plateAtoVMap,
|
||||
plateBtoVMap, alphaWellCounts, betaWellCounts, time);
|
||||
//Set source file name in graph to name of sample plate
|
||||
output.setSourceFilename(samplePlate.getSourceFileName());
|
||||
output.setSourceFilename(samplePlate.getFilename());
|
||||
//return GraphWithMapData object
|
||||
return output;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user