create populations string correctly
This commit is contained in:
@@ -16,7 +16,7 @@ public class PlateFileWriter {
|
|||||||
private Double error;
|
private Double error;
|
||||||
private String filename;
|
private String filename;
|
||||||
private String sourceFileName;
|
private String sourceFileName;
|
||||||
private Integer[] concentrations;
|
private Integer[] populations;
|
||||||
private boolean isExponential = false;
|
private boolean isExponential = false;
|
||||||
|
|
||||||
public PlateFileWriter(String filename, Plate plate) {
|
public PlateFileWriter(String filename, Plate plate) {
|
||||||
@@ -35,8 +35,8 @@ public class PlateFileWriter {
|
|||||||
}
|
}
|
||||||
this.error = plate.getError();
|
this.error = plate.getError();
|
||||||
this.wells = plate.getWells();
|
this.wells = plate.getWells();
|
||||||
this.concentrations = plate.getPopulations();
|
this.populations = plate.getPopulations();
|
||||||
Arrays.sort(concentrations);
|
Arrays.sort(populations);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void writePlateFile(){
|
public void writePlateFile(){
|
||||||
@@ -73,14 +73,12 @@ public class PlateFileWriter {
|
|||||||
// rows.add(tmp);
|
// rows.add(tmp);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
//get list of well populations
|
//make string out of populations array
|
||||||
List<Integer> wellPopulations = Arrays.asList(concentrations);
|
|
||||||
//make string out of populations list
|
|
||||||
StringBuilder populationsStringBuilder = new StringBuilder();
|
StringBuilder populationsStringBuilder = new StringBuilder();
|
||||||
populationsStringBuilder.append(wellPopulations.remove(0).toString());
|
populationsStringBuilder.append(populations[0].toString());
|
||||||
for(Integer i: wellPopulations){
|
for(int i = 1; i < populations.length; i++){
|
||||||
populationsStringBuilder.append(", ");
|
populationsStringBuilder.append(", ");
|
||||||
populationsStringBuilder.append(i.toString());
|
populationsStringBuilder.append(populations[i].toString());
|
||||||
}
|
}
|
||||||
String wellPopulationsString = populationsStringBuilder.toString();
|
String wellPopulationsString = populationsStringBuilder.toString();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user