Add dropout rate calculation to read-in of data from plate file (this may slow down read-in by a lot)

This commit is contained in:
eugenefischer
2022-10-22 16:04:41 -05:00
parent f7709ada73
commit e97c2989db

View File

@@ -61,12 +61,25 @@ public class Plate {
this.wells = wells;
this.size = wells.size();
double totalCellCount = 0.0;
double totalDropoutCount = 0.0;
List<Integer> concentrations = new ArrayList<>();
for (List<String[]> w: wells) {
totalCellCount += w.size();
if(!concentrations.contains(w.size())){
concentrations.add(w.size());
}
for (String[] cell: w) {
totalCellCount += 1.0;
for (String sequence: cell) {
if("-1".equals(sequence)) {
totalDropoutCount += 1.0;
}
}
}
}
double totalSequenceCount = totalCellCount * 4;
this.error = totalDropoutCount / totalSequenceCount;
this.populations = new Integer[concentrations.size()];
for (int i = 0; i < this.populations.length; i++) {
this.populations[i] = concentrations.get(i);