From 8d7ef1bb519d2525ff82812f02ba5f3f18e3066f Mon Sep 17 00:00:00 2001 From: Mauricio Carneiro Date: Thu, 21 Jul 2011 21:39:00 -0400 Subject: [PATCH] Complete refactor of the ReplicationValidation framework, plus the following new functionality: * merges all pools in a lane. * merges all lanes in a site. --- .../src/org/broadinstitute/sting/utils/MathUtils.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/public/java/src/org/broadinstitute/sting/utils/MathUtils.java b/public/java/src/org/broadinstitute/sting/utils/MathUtils.java index 36ed506aa..f823e6d42 100755 --- a/public/java/src/org/broadinstitute/sting/utils/MathUtils.java +++ b/public/java/src/org/broadinstitute/sting/utils/MathUtils.java @@ -727,6 +727,17 @@ public class MathUtils { return count; } + public static int countOccurrences(byte element, byte [] array) { + int count = 0; + for (byte y : array) { + if (element == y) + count++; + } + + return count; + } + + /** * Returns n random indices drawn with replacement from the range 0..(k-1) *