Change plate reader/writer to use columns as wells
This commit is contained in:
Binary file not shown.
@@ -54,19 +54,16 @@ public class PlateFileReader {
|
||||
if (record.hasComment()) {
|
||||
continue;
|
||||
}
|
||||
// if (wells.size() == 0) {
|
||||
// int num = 0;
|
||||
// for (String s: record) {
|
||||
// num++;
|
||||
// }
|
||||
// for (int i = 0; i < num; i++) {
|
||||
// wells.add(new ArrayList<>());
|
||||
// }
|
||||
if(wellNamesRecord){
|
||||
wellNamesRecord = false;
|
||||
continue;
|
||||
if (wells.size() == 0) {
|
||||
int num = 0;
|
||||
for (String s: record) {
|
||||
num++;
|
||||
}
|
||||
for (int i = 0; i < num; i++) {
|
||||
wells.add(new ArrayList<>());
|
||||
}
|
||||
} else {
|
||||
List<Integer[]> well = new ArrayList<>();
|
||||
int i = 0;
|
||||
for (String s : record) {
|
||||
if (!"".equals(s)) { //if value isn't the empty string
|
||||
//get rid of brackets, split at commas into a string array
|
||||
@@ -79,10 +76,12 @@ public class PlateFileReader {
|
||||
for (int j = 0; j < intsAsStrings.length; j++) {
|
||||
arr[j] = Integer.valueOf(intsAsStrings[j]);
|
||||
}
|
||||
well.add(arr);
|
||||
//Add Integer array to the correct well
|
||||
wells.get(i).add(arr);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
wells.add(well);
|
||||
|
||||
}
|
||||
}
|
||||
} catch(IOException ex){
|
||||
|
||||
@@ -99,7 +99,7 @@ public class PlateFileWriter {
|
||||
else {
|
||||
printer.printComment("Std. dev.: " + stdDev);
|
||||
}
|
||||
printer.printRecords(wellsAsStrings);
|
||||
printer.printRecords(rows);
|
||||
} catch(IOException ex){
|
||||
System.out.println("Could not make new file named "+filename);
|
||||
System.err.println(ex);
|
||||
|
||||
Reference in New Issue
Block a user