|
|
|
|
@@ -23,6 +23,7 @@ public class Simulator implements GraphModificationFunctions {
|
|
|
|
|
private static final int cdr1AlphaIndex = 2;
|
|
|
|
|
private static final int cdr1BetaIndex = 3;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Make the graph needed for matching CDR3s
|
|
|
|
|
public static GraphWithMapData makeGraph(CellSample cellSample, Plate samplePlate, boolean verbose) {
|
|
|
|
|
Instant start = Instant.now();
|
|
|
|
|
@@ -34,7 +35,7 @@ public class Simulator implements GraphModificationFunctions {
|
|
|
|
|
|
|
|
|
|
if(verbose){System.out.println("Making cell maps");}
|
|
|
|
|
//HashMap keyed to Alphas, values Betas
|
|
|
|
|
Map<Integer, Integer> distCellsMapAlphaKey = makeSequenceToSequenceMap(distinctCells, 0, 1);
|
|
|
|
|
Map<Integer, Integer> distCellsMapAlphaKey = makeSequenceToSequenceMap(distinctCells, cdr3AlphaIndex, cdr3BetaIndex);
|
|
|
|
|
if(verbose){System.out.println("Cell maps made");}
|
|
|
|
|
|
|
|
|
|
if(verbose){System.out.println("Making well maps");}
|
|
|
|
|
@@ -46,10 +47,11 @@ public class Simulator implements GraphModificationFunctions {
|
|
|
|
|
if(verbose){System.out.println("All betas count: " + betaCount);}
|
|
|
|
|
if(verbose){System.out.println("Well maps made");}
|
|
|
|
|
|
|
|
|
|
if(verbose){System.out.println("Removing singleton sequences and sequences present in all wells.");}
|
|
|
|
|
filterByOccupancyThresholds(allAlphas, 2, numWells - 1);
|
|
|
|
|
filterByOccupancyThresholds(allBetas, 2, numWells - 1);
|
|
|
|
|
if(verbose){System.out.println("Sequences removed");}
|
|
|
|
|
|
|
|
|
|
// if(verbose){System.out.println("Removing singleton sequences and sequences present in all wells.");}
|
|
|
|
|
// filterByOccupancyThresholds(allAlphas, 2, numWells - 1);
|
|
|
|
|
// filterByOccupancyThresholds(allBetas, 2, numWells - 1);
|
|
|
|
|
// if(verbose){System.out.println("Sequences removed");}
|
|
|
|
|
int pairableAlphaCount = allAlphas.size();
|
|
|
|
|
if(verbose){System.out.println("Remaining alphas count: " + pairableAlphaCount);}
|
|
|
|
|
int pairableBetaCount = allBetas.size();
|
|
|
|
|
@@ -238,6 +240,8 @@ public class Simulator implements GraphModificationFunctions {
|
|
|
|
|
//Metadata comments for CSV file
|
|
|
|
|
String algoType = "LEDA book with heap: " + heapType;
|
|
|
|
|
int min = Math.min(alphaCount, betaCount);
|
|
|
|
|
//matching weight
|
|
|
|
|
BigDecimal totalMatchingWeight = maxWeightMatching.getMatchingWeight();
|
|
|
|
|
//rate of attempted matching
|
|
|
|
|
double attemptRate = (double) (trueCount + falseCount) / min;
|
|
|
|
|
BigDecimal attemptRateTrunc = new BigDecimal(attemptRate, mc);
|
|
|
|
|
@@ -268,6 +272,7 @@ public class Simulator implements GraphModificationFunctions {
|
|
|
|
|
metadata.put("sample plate filename", data.getSourceFilename());
|
|
|
|
|
metadata.put("graph filename", dataFilename);
|
|
|
|
|
metadata.put("algorithm type", algoType);
|
|
|
|
|
metadata.put("matching weight", totalMatchingWeight.toString());
|
|
|
|
|
metadata.put("well populations", wellPopulationsString);
|
|
|
|
|
metadata.put("total alphas found", alphaCount.toString());
|
|
|
|
|
metadata.put("total betas found", betaCount.toString());
|
|
|
|
|
|