import java.time.Duration; import java.util.ArrayList; import java.util.List; import java.util.Map; public class MatchingResult { private final Map metadata; private final List comments; private final List headers; private final List> allResults; private final Map matchMap; public MatchingResult(Map metadata, List headers, List> allResults, MapmatchMap){ /* * POSSIBLE KEYS FOR METADATA MAP ARE: * sample plate filename * * graph filename * * matching weight * * well populations * * sequence read depth * * sequence read error rate * * read error collision rate * * total alphas read from plate * * total betas read from plate * * alphas in graph (after pre-filtering) * * betas in graph (after pre-filtering) * * high overlap threshold for pairing * * low overlap threshold for pairing * * maximum occupancy difference for pairing * * minimum overlap percent for pairing * * pairing attempt rate * * correct pairing count * * incorrect pairing count * * pairing error rate * * time to generate graph (seconds) * * time to pair sequences (seconds) * * total simulation time (seconds) * */ 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; } public Map getMetadata() {return metadata;} public List getComments() { return comments; } public List> getAllResults() { return allResults; } public List getHeaders() { return headers; } public Map 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 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 alphas read from plate")); } public Integer getBetaCount() { return Integer.parseInt(metadata.get("total betas read from plate")); } public Integer getHighOverlapThreshold() { return Integer.parseInt(metadata.get("high overlap threshold for pairing"));} public Integer getLowOverlapThreshold() { return Integer.parseInt(metadata.get("low overlap threshold for pairing"));} public Integer getMaxOccupancyDifference() { return Integer.parseInt(metadata.get("maximum occupancy difference for pairing"));} public Integer getMinOverlapPercent() { return Integer.parseInt(metadata.get("minimum overlap percent for pairing"));} public Double getPairingAttemptRate() { return Double.parseDouble(metadata.get("pairing attempt rate"));} public Integer getCorrectPairingCount() { return Integer.parseInt(metadata.get("correct pairing count"));} public Integer getIncorrectPairingCount() { return Integer.parseInt(metadata.get("incorrect pairing count"));} public Double getPairingErrorRate() { return Double.parseDouble(metadata.get("pairing error rate"));} public String getSimulationTime() { return metadata.get("total simulation time (seconds)"); } }