Skip to content

Commit 2b53b9f

Browse files
committed
Remove other_matches from UmiCorrectionMetrics
1 parent d7b0f04 commit 2b53b9f

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

src/main/scala/com/fulcrumgenomics/umi/CorrectUmis.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ object CorrectUmis {
6060
* @param perfect_matches The number of UMI sequences that were perfect matches to this UMI.
6161
* @param one_mismatch_matches The number of UMI sequences that matched with a single mismatch.
6262
* @param two_mismatch_matches The number of UMI sequences that matched with two mismatches.
63-
* @param other_matches The number of UMI sequences that matched with three or more mismatches.
6463
* @param fraction_of_matches The fraction of all UMIs that matched or were corrected to this UMI.
6564
* @param representation The `total_matches` for this UMI divided by the _mean_ `total_matches` for all UMIs.
6665
*/
@@ -69,7 +68,6 @@ object CorrectUmis {
6968
var perfect_matches: Count = 0,
7069
var one_mismatch_matches: Count = 0,
7170
var two_mismatch_matches: Count = 0,
72-
var other_matches: Count = 0,
7371
var fraction_of_matches: Proportion = 0,
7472
var representation: Double = 0
7573
) extends Metric
@@ -223,7 +221,7 @@ class CorrectUmis
223221
case 0 => metric.perfect_matches += 1
224222
case 1 => metric.one_mismatch_matches += 1
225223
case 2 => metric.two_mismatch_matches += 1
226-
case _ => metric.other_matches += 1
224+
case _ => ()
227225
}
228226
}
229227
else {

src/test/scala/com/fulcrumgenomics/umi/CorrectUmisTest.scala

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,11 @@ class CorrectUmisTest extends UnitSpec {
149149
readBamRecs(rejects).map(_.name) should contain theSameElementsAs Seq("q9", "q10")
150150

151151
val metricsByUmi = Metric.read[UmiCorrectionMetrics](metrics).map(m => m.umi -> m).toMap
152-
metricsByUmi("AAAAAA") shouldBe UmiCorrectionMetrics(umi="AAAAAA", total_matches=5, perfect_matches=2, one_mismatch_matches=1, two_mismatch_matches=1, other_matches=1, fraction_of_matches = 5/10.0, representation = (5/8.0) / (1/4d))
153-
metricsByUmi("CCCCCC") shouldBe UmiCorrectionMetrics(umi="CCCCCC", total_matches=1, perfect_matches=1, one_mismatch_matches=0, two_mismatch_matches=0, other_matches=0, fraction_of_matches = 1/10.0, representation = (1/8.0) / (1/4d))
154-
metricsByUmi("GGGGGG") shouldBe UmiCorrectionMetrics(umi="GGGGGG", total_matches=1, perfect_matches=1, one_mismatch_matches=0, two_mismatch_matches=0, other_matches=0, fraction_of_matches = 1/10.0, representation = (1/8.0) / (1/4d))
155-
metricsByUmi("TTTTTT") shouldBe UmiCorrectionMetrics(umi="TTTTTT", total_matches=1, perfect_matches=1, one_mismatch_matches=0, two_mismatch_matches=0, other_matches=0, fraction_of_matches = 1/10.0, representation = (1/8.0) / (1/4d))
156-
metricsByUmi("NNNNNN") shouldBe UmiCorrectionMetrics(umi="NNNNNN", total_matches=2, perfect_matches=0, one_mismatch_matches=0, two_mismatch_matches=0, other_matches=0, fraction_of_matches = 2/10.0, representation = (2/8.0) / (1/4d))
152+
metricsByUmi("AAAAAA") shouldBe UmiCorrectionMetrics(umi="AAAAAA", total_matches=5, perfect_matches=2, one_mismatch_matches=1, two_mismatch_matches=1, fraction_of_matches = 5/10.0, representation = (5/8.0) / (1/4d))
153+
metricsByUmi("CCCCCC") shouldBe UmiCorrectionMetrics(umi="CCCCCC", total_matches=1, perfect_matches=1, one_mismatch_matches=0, two_mismatch_matches=0, fraction_of_matches = 1/10.0, representation = (1/8.0) / (1/4d))
154+
metricsByUmi("GGGGGG") shouldBe UmiCorrectionMetrics(umi="GGGGGG", total_matches=1, perfect_matches=1, one_mismatch_matches=0, two_mismatch_matches=0, fraction_of_matches = 1/10.0, representation = (1/8.0) / (1/4d))
155+
metricsByUmi("TTTTTT") shouldBe UmiCorrectionMetrics(umi="TTTTTT", total_matches=1, perfect_matches=1, one_mismatch_matches=0, two_mismatch_matches=0, fraction_of_matches = 1/10.0, representation = (1/8.0) / (1/4d))
156+
metricsByUmi("NNNNNN") shouldBe UmiCorrectionMetrics(umi="NNNNNN", total_matches=2, perfect_matches=0, one_mismatch_matches=0, two_mismatch_matches=0, fraction_of_matches = 2/10.0, representation = (2/8.0) / (1/4d))
157157
}
158158

159159
it should "run end to end and do the right thing for a handful of fragments with duplex UMIs" in {
@@ -177,11 +177,11 @@ class CorrectUmisTest extends UnitSpec {
177177
readBamRecs(rejects).map(_.name) should contain theSameElementsAs Seq("q3", "q5")
178178

179179
val metricsByUmi = Metric.read[UmiCorrectionMetrics](metrics).map(m => m.umi -> m).toMap
180-
metricsByUmi("AAAAAA") shouldBe UmiCorrectionMetrics(umi="AAAAAA", total_matches=3, perfect_matches=2, one_mismatch_matches=1, two_mismatch_matches=0, other_matches=0, fraction_of_matches = 3/10.0, representation = (3/8.0) / (1/4d))
181-
metricsByUmi("CCCCCC") shouldBe UmiCorrectionMetrics(umi="CCCCCC", total_matches=2, perfect_matches=1, one_mismatch_matches=1, two_mismatch_matches=0, other_matches=0, fraction_of_matches = 2/10.0, representation = (2/8.0) / (1/4d))
182-
metricsByUmi("GGGGGG") shouldBe UmiCorrectionMetrics(umi="GGGGGG", total_matches=1, perfect_matches=1, one_mismatch_matches=0, two_mismatch_matches=0, other_matches=0, fraction_of_matches = 1/10.0, representation = (1/8.0) / (1/4d))
183-
metricsByUmi("TTTTTT") shouldBe UmiCorrectionMetrics(umi="TTTTTT", total_matches=2, perfect_matches=2, one_mismatch_matches=0, two_mismatch_matches=0, other_matches=0, fraction_of_matches = 2/10.0, representation = (2/8.0) / (1/4d))
184-
metricsByUmi("NNNNNN") shouldBe UmiCorrectionMetrics(umi="NNNNNN", total_matches=2, perfect_matches=0, one_mismatch_matches=0, two_mismatch_matches=0, other_matches=0, fraction_of_matches = 2/10.0, representation = (2/8.0) / (1/4d))
180+
metricsByUmi("AAAAAA") shouldBe UmiCorrectionMetrics(umi="AAAAAA", total_matches=3, perfect_matches=2, one_mismatch_matches=1, two_mismatch_matches=0, fraction_of_matches = 3/10.0, representation = (3/8.0) / (1/4d))
181+
metricsByUmi("CCCCCC") shouldBe UmiCorrectionMetrics(umi="CCCCCC", total_matches=2, perfect_matches=1, one_mismatch_matches=1, two_mismatch_matches=0, fraction_of_matches = 2/10.0, representation = (2/8.0) / (1/4d))
182+
metricsByUmi("GGGGGG") shouldBe UmiCorrectionMetrics(umi="GGGGGG", total_matches=1, perfect_matches=1, one_mismatch_matches=0, two_mismatch_matches=0, fraction_of_matches = 1/10.0, representation = (1/8.0) / (1/4d))
183+
metricsByUmi("TTTTTT") shouldBe UmiCorrectionMetrics(umi="TTTTTT", total_matches=2, perfect_matches=2, one_mismatch_matches=0, two_mismatch_matches=0, fraction_of_matches = 2/10.0, representation = (2/8.0) / (1/4d))
184+
metricsByUmi("NNNNNN") shouldBe UmiCorrectionMetrics(umi="NNNNNN", total_matches=2, perfect_matches=0, one_mismatch_matches=0, two_mismatch_matches=0, fraction_of_matches = 2/10.0, representation = (2/8.0) / (1/4d))
185185
}
186186

187187
it should "do the same thing whether the UMIs are on the command line or in a file" in {

0 commit comments

Comments
 (0)