clean up metadata
This commit is contained in:
@@ -10,26 +10,33 @@ public class MatchingResult {
|
|||||||
private final List<String> headers;
|
private final List<String> headers;
|
||||||
private final List<List<String>> allResults;
|
private final List<List<String>> allResults;
|
||||||
private final Map<String, String> matchMap;
|
private final Map<String, String> matchMap;
|
||||||
private final Duration time;
|
|
||||||
|
|
||||||
public MatchingResult(Map<String, String> metadata, List<String> headers,
|
public MatchingResult(Map<String, String> metadata, List<String> headers,
|
||||||
List<List<String>> allResults, Map<String, String>matchMap, Duration time){
|
List<List<String>> allResults, Map<String, String>matchMap){
|
||||||
/*
|
/*
|
||||||
* POSSIBLE KEYS FOR METADATA MAP ARE:
|
* POSSIBLE KEYS FOR METADATA MAP ARE:
|
||||||
* sample plate filename *
|
* sample plate filename *
|
||||||
* graph filename *
|
* graph filename *
|
||||||
|
* matching weight *
|
||||||
* well populations *
|
* well populations *
|
||||||
* total alphas found *
|
* sequence read depth *
|
||||||
* total betas found *
|
* sequence read error rate *
|
||||||
* high overlap threshold *
|
* read error collision rate *
|
||||||
* low overlap threshold *
|
* total alphas read from plate *
|
||||||
* maximum occupancy difference *
|
* total betas read from plate *
|
||||||
* minimum overlap percent *
|
* 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 *
|
* pairing attempt rate *
|
||||||
* correct pairing count *
|
* correct pairing count *
|
||||||
* incorrect pairing count *
|
* incorrect pairing count *
|
||||||
* pairing error rate *
|
* pairing error rate *
|
||||||
* simulation time (seconds)
|
* time to generate graph (seconds) *
|
||||||
|
* time to pair sequences (seconds) *
|
||||||
|
* total simulation time (seconds) *
|
||||||
*/
|
*/
|
||||||
this.metadata = metadata;
|
this.metadata = metadata;
|
||||||
this.comments = new ArrayList<>();
|
this.comments = new ArrayList<>();
|
||||||
@@ -39,8 +46,6 @@ public class MatchingResult {
|
|||||||
this.headers = headers;
|
this.headers = headers;
|
||||||
this.allResults = allResults;
|
this.allResults = allResults;
|
||||||
this.matchMap = matchMap;
|
this.matchMap = matchMap;
|
||||||
this.time = time;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, String> getMetadata() {return metadata;}
|
public Map<String, String> getMetadata() {return metadata;}
|
||||||
@@ -61,9 +66,9 @@ public class MatchingResult {
|
|||||||
return matchMap;
|
return matchMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Duration getTime() {
|
// public Duration getTime() {
|
||||||
return time;
|
// return time;
|
||||||
}
|
// }
|
||||||
|
|
||||||
public String getPlateFilename() {
|
public String getPlateFilename() {
|
||||||
return metadata.get("sample plate filename");
|
return metadata.get("sample plate filename");
|
||||||
@@ -84,20 +89,20 @@ public class MatchingResult {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Integer getAlphaCount() {
|
public Integer getAlphaCount() {
|
||||||
return Integer.parseInt(metadata.get("total alpha count"));
|
return Integer.parseInt(metadata.get("total alphas read from plate"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getBetaCount() {
|
public Integer getBetaCount() {
|
||||||
return Integer.parseInt(metadata.get("total beta count"));
|
return Integer.parseInt(metadata.get("total betas read from plate"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getHighOverlapThreshold() { return Integer.parseInt(metadata.get("high overlap threshold"));}
|
public Integer getHighOverlapThreshold() { return Integer.parseInt(metadata.get("high overlap threshold for pairing"));}
|
||||||
|
|
||||||
public Integer getLowOverlapThreshold() { return Integer.parseInt(metadata.get("low overlap threshold"));}
|
public Integer getLowOverlapThreshold() { return Integer.parseInt(metadata.get("low overlap threshold for pairing"));}
|
||||||
|
|
||||||
public Integer getMaxOccupancyDifference() { return Integer.parseInt(metadata.get("maximum occupancy difference"));}
|
public Integer getMaxOccupancyDifference() { return Integer.parseInt(metadata.get("maximum occupancy difference for pairing"));}
|
||||||
|
|
||||||
public Integer getMinOverlapPercent() { return Integer.parseInt(metadata.get("minimum overlap percent"));}
|
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 Double getPairingAttemptRate() { return Double.parseDouble(metadata.get("pairing attempt rate"));}
|
||||||
|
|
||||||
@@ -107,6 +112,6 @@ public class MatchingResult {
|
|||||||
|
|
||||||
public Double getPairingErrorRate() { return Double.parseDouble(metadata.get("pairing error rate"));}
|
public Double getPairingErrorRate() { return Double.parseDouble(metadata.get("pairing error rate"));}
|
||||||
|
|
||||||
public String getSimulationTime() { return metadata.get("simulation time (seconds)"); }
|
public String getSimulationTime() { return metadata.get("total simulation time (seconds)"); }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -331,22 +331,28 @@ public class Simulator implements GraphModificationFunctions {
|
|||||||
populationsStringBuilder.append(wellPopulations[i].toString());
|
populationsStringBuilder.append(wellPopulations[i].toString());
|
||||||
}
|
}
|
||||||
String wellPopulationsString = populationsStringBuilder.toString();
|
String wellPopulationsString = populationsStringBuilder.toString();
|
||||||
|
//graph generation time
|
||||||
|
Duration graphTime = data.getTime();
|
||||||
|
//MWM run time
|
||||||
|
Duration pairingTime = Duration.between(start, stop);
|
||||||
//total simulation time
|
//total simulation time
|
||||||
Duration time = Duration.between(start, stop);
|
Duration totalTime = graphTime.plus(pairingTime);
|
||||||
time = time.plus(data.getTime());
|
|
||||||
|
|
||||||
Map<String, String> metadata = new LinkedHashMap<>();
|
Map<String, String> metadata = new LinkedHashMap<>();
|
||||||
metadata.put("sample plate filename", data.getSourceFilename());
|
metadata.put("sample plate filename", data.getSourceFilename());
|
||||||
metadata.put("graph filename", dataFilename);
|
metadata.put("graph filename", dataFilename);
|
||||||
metadata.put("algorithm type", algoType);
|
metadata.put("MWM algorithm type", algoType);
|
||||||
metadata.put("matching weight", totalMatchingWeight.toString());
|
metadata.put("matching weight", totalMatchingWeight.toString());
|
||||||
metadata.put("well populations", wellPopulationsString);
|
metadata.put("well populations", wellPopulationsString);
|
||||||
metadata.put("read depth", data.getReadDepth().toString());
|
metadata.put("sequence read depth", data.getReadDepth().toString());
|
||||||
metadata.put("Sequence read error rate", data.getReadErrorRate().toString());
|
metadata.put("sequence read error rate", data.getReadErrorRate().toString());
|
||||||
metadata.put("Read error collision rate", data.getErrorCollisionRate().toString());
|
metadata.put("read error collision rate", data.getErrorCollisionRate().toString());
|
||||||
metadata.put("total alphas read from plate", data.getAlphaCount().toString());
|
metadata.put("total alphas read from plate", data.getAlphaCount().toString());
|
||||||
metadata.put("total betas read from plate", data.getBetaCount().toString());
|
metadata.put("total betas read from plate", data.getBetaCount().toString());
|
||||||
|
//HARD CODED, PARAMETERIZE LATER
|
||||||
metadata.put("pre-filter sequences present in all wells", "true");
|
metadata.put("pre-filter sequences present in all wells", "true");
|
||||||
|
//HARD CODED, PARAMETERIZE LATER
|
||||||
metadata.put("pre-filter sequences based on occupancy/read count discrepancy", "true");
|
metadata.put("pre-filter sequences based on occupancy/read count discrepancy", "true");
|
||||||
metadata.put("alphas in graph (after pre-filtering)", graphAlphaCount.toString());
|
metadata.put("alphas in graph (after pre-filtering)", graphAlphaCount.toString());
|
||||||
metadata.put("betas in graph (after pre-filtering)", graphBetaCount.toString());
|
metadata.put("betas in graph (after pre-filtering)", graphBetaCount.toString());
|
||||||
@@ -358,9 +364,11 @@ public class Simulator implements GraphModificationFunctions {
|
|||||||
metadata.put("correct pairing count", Integer.toString(trueCount));
|
metadata.put("correct pairing count", Integer.toString(trueCount));
|
||||||
metadata.put("incorrect pairing count", Integer.toString(falseCount));
|
metadata.put("incorrect pairing count", Integer.toString(falseCount));
|
||||||
metadata.put("pairing error rate", pairingErrorRateTrunc.toString());
|
metadata.put("pairing error rate", pairingErrorRateTrunc.toString());
|
||||||
metadata.put("simulation time (seconds)", nf.format(time.toSeconds()));
|
metadata.put("time to generate graph (seconds)", nf.format(graphTime.toSeconds()));
|
||||||
|
metadata.put("time to pair sequences (seconds)",nf.format(pairingTime.toSeconds()));
|
||||||
|
metadata.put("total simulation time (seconds)", nf.format(totalTime.toSeconds()));
|
||||||
//create MatchingResult object
|
//create MatchingResult object
|
||||||
MatchingResult output = new MatchingResult(metadata, header, allResults, matchMap, time);
|
MatchingResult output = new MatchingResult(metadata, header, allResults, matchMap);
|
||||||
if(verbose){
|
if(verbose){
|
||||||
for(String s: output.getComments()){
|
for(String s: output.getComments()){
|
||||||
System.out.println(s);
|
System.out.println(s);
|
||||||
|
|||||||
Reference in New Issue
Block a user