From 22faad34145e0eeffcfa59e21b17b8d238ea4d5d Mon Sep 17 00:00:00 2001 From: eugenefischer <66030419+eugenefischer@users.noreply.github.com> Date: Wed, 28 Sep 2022 17:45:09 -0500 Subject: [PATCH] Add real sequence collision rate --- src/main/java/Simulator.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/Simulator.java b/src/main/java/Simulator.java index 08efcf6..ab4f27a 100644 --- a/src/main/java/Simulator.java +++ b/src/main/java/Simulator.java @@ -27,7 +27,8 @@ public class Simulator implements GraphModificationFunctions { public static GraphWithMapData makeCDR3Graph(CellSample cellSample, Plate samplePlate, int readDepth, - double readErrorRate, double errorCollisionRate, boolean verbose) { + double readErrorRate, double errorCollisionRate, + double realSequenceCollisionRate, boolean verbose) { //start timing Instant start = Instant.now(); int[] alphaIndices = {SequenceType.CDR3_ALPHA.ordinal()}; @@ -44,11 +45,11 @@ public class Simulator implements GraphModificationFunctions { //Make linkedHashMap keyed to sequences, values are SequenceRecords reflecting plate statistics if(verbose){System.out.println("Making sample plate sequence maps");} Map alphaSequences = samplePlate.countSequences(readDepth, readErrorRate, - errorCollisionRate, alphaIndices); + errorCollisionRate, realSequenceCollisionRate, alphaIndices); int alphaCount = alphaSequences.size(); if(verbose){System.out.println("Alphas sequences read: " + alphaCount);} Map betaSequences = samplePlate.countSequences(readDepth, readErrorRate, - errorCollisionRate, betaIndices); + errorCollisionRate, realSequenceCollisionRate, betaIndices); int betaCount = betaSequences.size(); if(verbose){System.out.println("Betas sequences read: " + betaCount);} if(verbose){System.out.println("Sample plate sequence maps made");} @@ -131,7 +132,7 @@ public class Simulator implements GraphModificationFunctions { Duration time = Duration.between(start, stop); //create GraphWithMapData object GraphWithMapData output = new GraphWithMapData(graph, numWells, samplePlate.getPopulations(), distCellsMapAlphaKey, - alphaCount, betaCount, readDepth, readErrorRate, errorCollisionRate, time); + alphaCount, betaCount, readDepth, readErrorRate, errorCollisionRate, realSequenceCollisionRate, time); //Set source file name in graph to name of sample plate output.setSourceFilename(samplePlate.getFilename()); //return GraphWithMapData object @@ -307,6 +308,7 @@ public class Simulator implements GraphModificationFunctions { metadata.put("sequence read depth", data.getReadDepth().toString()); metadata.put("sequence read error rate", data.getReadErrorRate().toString()); metadata.put("read error collision rate", data.getErrorCollisionRate().toString()); + metadata.put("real sequence collision rate", data.getRealSequenceCollisionRate().toString()); metadata.put("total alphas read from plate", data.getAlphaCount().toString()); metadata.put("total betas read from plate", data.getBetaCount().toString()); //HARD CODED, PARAMETERIZE LATER