Implemented storing graphs in memory for multiple pairing experiments

This commit is contained in:
2022-02-22 21:30:00 -06:00
parent fd2ec76b71
commit 68ee9e4bb6
6 changed files with 208 additions and 99 deletions

View File

@@ -4,7 +4,7 @@ import java.util.List;
import java.util.Map;
public class MatchingResult {
private final String sourceFile;
private final Map<String, String> metadata;
private final List<String> comments;
private final List<String> headers;
@@ -12,16 +12,15 @@ public class MatchingResult {
private final Map<Integer, Integer> matchMap;
private final Duration time;
public MatchingResult(String sourceFileName, Map<String, String> metadata, List<String> headers,
public MatchingResult(Map<String, String> metadata, List<String> headers,
List<List<String>> allResults, Map<Integer, Integer>matchMap, Duration time){
this.sourceFile = sourceFileName;
/*
* POSSIBLE KEYS FOR METADATA MAP ARE:
* sample plate filename
* graph filename
* well populations
* total alphas found
* total betas found
* sample plate filename *
* graph filename *
* well populations *
* total alphas found *
* total betas found *
* high overlap threshold
* low overlap threshold
* maximum occupancy difference
@@ -66,7 +65,32 @@ public class MatchingResult {
return time;
}
public String getSourceFileName() {
return sourceFile;
public String getPlateFilename() {
return metadata.get("sample plate filename");
}
public String getGraphFilename() {
return metadata.get("graph filename");
}
public Integer[] getWellPopulations() {
List<Integer> wellPopulations = new ArrayList<>();
String popString = metadata.get("well populations");
for (String p : popString.split(", ")) {
wellPopulations.add(Integer.parseInt(p));
}
Integer[] popArray = new Integer[wellPopulations.size()];
return wellPopulations.toArray(popArray);
}
public Integer getAlphaCount() {
return Integer.parseInt(metadata.get("total alpha count"));
}
public Integer getBetaCount() {
return Integer.parseInt(metadata.get("total beta count"));
}
//put in the rest of these methods following the same pattern
}