Added timing to CDR3/CDR1 matching

This commit is contained in:
2021-11-16 16:37:29 -06:00
parent 48510a5b60
commit 255a3ba66c
3 changed files with 22 additions and 12 deletions

View File

@@ -283,12 +283,12 @@ public class Simulator {
comments.add("Simulation time: " + nf.format(time.toSeconds()) + " seconds");
System.out.println("Simulation time: " + nf.format(time.toSeconds()) + " seconds");
return new MatchingResult(comments, header, allResults, matchMap);
return new MatchingResult(comments, header, allResults, matchMap, time);
}
public static MatchingResult[] matchCDR1s(List<Integer[]> distinctCells,
Plate samplePlate, Integer lowThreshold,
Integer highThreshold, Map<Integer, Integer> previousMatches){
Integer highThreshold, Map<Integer, Integer> previousMatches, Duration previousTime){
Instant start = Instant.now();
int numWells = samplePlate.getSize();
@@ -548,11 +548,16 @@ public class Simulator {
comments.add("Number of correct matches: " + trueCount);
double correctRate = (double) trueCount / allResults.size();
comments.add("Correct matching rate: " + correctRate);
NumberFormat nf = NumberFormat.getInstance(Locale.US);
Duration time = Duration.between(start, stop);
time.plus(previousTime);
comments.add("Simulation time: " + nf.format(time.toSeconds()) + " seconds");
for(String s: comments){
System.out.println(s);
}
List<String> headers = new ArrayList<>();
headers.add("CDR3 alpha");
headers.add("CDR3 beta");
@@ -560,7 +565,7 @@ public class Simulator {
headers.add("second matched CDR1");
headers.add("Correct match?");
MatchingResult firstTest = new MatchingResult(comments, headers, allResults, dualMatchesMap);
MatchingResult firstTest = new MatchingResult(comments, headers, allResults, dualMatchesMap, time);
//results for dual map
System.out.println("Results for second pass");
@@ -602,18 +607,15 @@ public class Simulator {
comments.add("Number of correct matches: " + trueCount);
correctRate = (double) trueCount / allResults.size();
comments.add("Correct matching rate: " + correctRate);
comments.add("Simulation time: " + nf.format(time.toSeconds()) + " seconds");
for(String s: comments){
System.out.println(s);
}
NumberFormat nf = NumberFormat.getInstance(Locale.US);
Duration time = Duration.between(start, stop);
comments.add("Simulation time: " + nf.format(time.toSeconds()) + " seconds");
System.out.println("Simulation time: " + nf.format(time.toSeconds()) + " seconds");
MatchingResult dualTest = new MatchingResult(comments, headers, allResults, dualMatchesMap);
MatchingResult dualTest = new MatchingResult(comments, headers, allResults, dualMatchesMap, time);
MatchingResult[] output = {firstTest, dualTest};