diff --git a/src/main/java/Plate.java b/src/main/java/Plate.java index 5a13eff..af37ac0 100644 --- a/src/main/java/Plate.java +++ b/src/main/java/Plate.java @@ -8,6 +8,7 @@ TODO: Implement discrete frequency distributions using Vose's Alias Method import java.util.*; public class Plate { + private CellSample cells; private String sourceFile; private List> wells; private final Random rand = BiGpairSEQ.getRand(); @@ -18,6 +19,24 @@ public class Plate { private double lambda; boolean exponential = false; + public Plate(CellSample cells, String cellFilename, int size, Integer[] populations, + double dropoutRate, double stdDev_or_lambda, boolean exponential){ + this.cells = cells; + this.sourceFile = cellFilename; + this.size = size; + this.error = dropoutRate; + this.populations = populations; + this.exponential = exponential; + if (this.exponential) { + this.lambda = stdDev_or_lambda; + fillWellsExponential(cells.getCells(), this.lambda); + } + else { + this.stdDev = stdDev_or_lambda; + fillWells(cells.getCells(), this.stdDev); + } + } + public Plate(int size, double error, Integer[] populations) { this.size = size; @@ -43,10 +62,9 @@ public class Plate { } } - public void fillWellsExponential(String sourceFileName, List cells, double lambda){ + private void fillWellsExponential(List cells, double lambda){ this.lambda = lambda; exponential = true; - sourceFile = sourceFileName; int numSections = populations.length; int section = 0; double m; @@ -74,9 +92,8 @@ public class Plate { } } - public void fillWells(String sourceFileName, List cells, double stdDev) { + private void fillWells( List cells, double stdDev) { this.stdDev = stdDev; - sourceFile = sourceFileName; int numSections = populations.length; int section = 0; double m;