97 lines
2.7 KiB
Java
97 lines
2.7 KiB
Java
import java.time.Duration;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
public class MatchingResult {
|
|
|
|
private final Map<String, String> metadata;
|
|
private final List<String> comments;
|
|
private final List<String> headers;
|
|
private final List<List<String>> allResults;
|
|
private final Map<Integer, Integer> matchMap;
|
|
private final Duration time;
|
|
|
|
public MatchingResult(Map<String, String> metadata, List<String> headers,
|
|
List<List<String>> allResults, Map<Integer, Integer>matchMap, Duration time){
|
|
/*
|
|
* POSSIBLE KEYS FOR METADATA MAP ARE:
|
|
* sample plate filename *
|
|
* graph filename *
|
|
* well populations *
|
|
* total alphas found *
|
|
* total betas found *
|
|
* high overlap threshold
|
|
* low overlap threshold
|
|
* maximum occupancy difference
|
|
* minimum overlap percent
|
|
* pairing attempt rate
|
|
* correct pairing count
|
|
* incorrect pairing count
|
|
* pairing error rate
|
|
* simulation time
|
|
*/
|
|
this.metadata = metadata;
|
|
this.comments = new ArrayList<>();
|
|
for (String key : metadata.keySet()) {
|
|
comments.add(key +": " + metadata.get(key));
|
|
}
|
|
this.headers = headers;
|
|
this.allResults = allResults;
|
|
this.matchMap = matchMap;
|
|
this.time = time;
|
|
|
|
}
|
|
|
|
public Map<String, String> getMetadata() {return metadata;}
|
|
|
|
public List<String> getComments() {
|
|
return comments;
|
|
}
|
|
|
|
public List<List<String>> getAllResults() {
|
|
return allResults;
|
|
}
|
|
|
|
public List<String> getHeaders() {
|
|
return headers;
|
|
}
|
|
|
|
public Map<Integer, Integer> getMatchMap() {
|
|
return matchMap;
|
|
}
|
|
|
|
public Duration getTime() {
|
|
return time;
|
|
}
|
|
|
|
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
|
|
|
|
}
|