diff --git a/src/main/java/Simulator.java b/src/main/java/Simulator.java index 286e009..735563f 100644 --- a/src/main/java/Simulator.java +++ b/src/main/java/Simulator.java @@ -71,9 +71,11 @@ public class Simulator implements GraphModificationFunctions { } if (realSequenceCollisionRate > 0.0) { if(verbose){System.out.println("Removing wells with anomalous read counts from sequence records");} - filterWellsByReadCount(alphaSequences); - filterWellsByReadCount(betaSequences); + int alphaWellsRemoved = filterWellsByReadCount(alphaSequences); + int betaWellsRemoved = filterWellsByReadCount(betaSequences); if(verbose){System.out.println("Wells with anomalous read counts removed from sequence records");} + if(verbose){System.out.println("Total alpha sequence wells removed: " + alphaWellsRemoved);} + if(verbose){System.out.println("Total beta sequence wells removed: " + betaWellsRemoved);} } //construct the graph. For simplicity, going to make @@ -653,7 +655,7 @@ public class Simulator implements GraphModificationFunctions { // } //Remove sequences based on occupancy - public static void filterByOccupancyThresholds(Map wellMap, int low, int high){ + private static void filterByOccupancyThresholds(Map wellMap, int low, int high){ List noise = new ArrayList<>(); for(String k: wellMap.keySet()){ if((wellMap.get(k).getOccupancy() > high) || (wellMap.get(k).getOccupancy() < low)){ @@ -665,7 +667,7 @@ public class Simulator implements GraphModificationFunctions { } } - public static void filterByOccupancyAndReadCount(Map sequences, int readDepth) { + private static void filterByOccupancyAndReadCount(Map sequences, int readDepth) { List noise = new ArrayList<>(); for(String k : sequences.keySet()){ //occupancy times read depth should be more than half the sequence read count if the read error rate is low @@ -679,7 +681,8 @@ public class Simulator implements GraphModificationFunctions { } } - public static void filterWellsByReadCount(Map sequences) { + private static int filterWellsByReadCount(Map sequences) { + int count = 0; for (String k: sequences.keySet()) { //If a sequence has read count R and appears in W wells, then on average its read count in each //well should be R/W. Delete any wells where the read count is less than R/2W. @@ -688,12 +691,14 @@ public class Simulator implements GraphModificationFunctions { for (Integer well: sequences.get(k).getWells()) { if (sequences.get(k).getReadCount(well) < threshold) { noise.add(well); + count++; } } for (Integer well: noise) { sequences.get(k).deleteWell(well); } } + return count; } private static Map makeSequenceToSequenceMap(List cells, int keySequenceIndex,