WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 941433d

Browse files
committed
fix: unit test was not checking duplex RX output correctly
This was because of numerical instability deterministically and incorrectly breakign ties.
1 parent 68d52c9 commit 941433d

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,14 @@ class CallDuplexConsensusReadsTest extends UnitSpec {
105105
// Add the original UMI bases to each read
106106
builder.foreach { rec =>
107107
val mi = rec[String](MI)
108-
// first of pair ABs and second of pair BAs
109-
if ((rec.firstOfPair && mi.endsWith("/A")) || (rec.secondOfPair && mi.endsWith("/B"))) {
110-
rec(RX) = "AAT-CCG"
111-
}
112-
else {
113-
rec(RX) = "CCG-AAT"
108+
// The UMIs for ABR1s+BAR2s are called together, and the UMIs for ABR2s and BAR1s are called together. But
109+
// before they are called together, they BAR1s and ABR2s have their UMI swapped, so we have to swap them here
110+
// too.
111+
(rec.firstOfPair, mi.endsWith("/A")) match {
112+
case (true, true) => rec(RX) = "AAT-CCG" // ABR1
113+
case (false, false) => rec(RX) = "CCG-AAT" // BAR2
114+
case (false, true) => rec(RX) = "CCG-AAT" // ABR2
115+
case (true, false) => rec(RX) = "AAT-CCG" // BAR1
114116
}
115117
}
116118

0 commit comments

Comments
 (0)