Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 3.13.1

### Bugfixes

* For paired-end mode, in the unexpected sequence report, report the combined read1 and read2 barcodes

## 3.13.0

### Improvements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ final class ScoringConsumer(
// if we are tracking unexpected sequences and we matched the column barcode to the reference data but didn't
// match the row barcode to the reference data, and the row barcode doesn't have an N in it, then queue the
// row barcode for inclusion in the unexpected sequence report
if unexpectedSequenceTrackerOpt.isDefined && colBc.nonEmpty && rowBc.isEmpty && !containsN(parsedRow.barcode)
then unexpectedSequenceQueue.put((parsedRow.barcode, parsedCol.barcode))
if unexpectedSequenceTrackerOpt.isDefined && colBc.nonEmpty && rowBc.isEmpty && !containsN(combinedBarcode)
then unexpectedSequenceQueue.put((combinedBarcode, parsedCol.barcode))

case (None, r, None) =>
updateRowBarcodePositionStats(None, r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,49 @@ class UnexpectedSequencesTest extends FunSuite with TestResources:

}

test("PoolQ should report combined row barcodes in paired-end mode") {
val barcodes = CloseableIterable.ofList(
List(
Barcodes(
Some(FoundBarcode("AAAAAAAAAA".toCharArray, 0)),
Some(FoundBarcode("CCCCCCCCCC".toCharArray, 0)),
Some(FoundBarcode("CCCG".toCharArray, 0)),
None
)
)
)

val tmpPath = Files.createTempDirectory("unexpected-sequences-test")
try
val outputFile = tmpPath.resolve("unexpected-sequences.txt")
val cachePath = tmpPath.resolve("cache")
val ust = new UnexpectedSequenceTracker(cachePath, colReference)
val consumer =
new ScoringConsumer(rowReference, colReference, countAmbiguous = true, false, None, Some(ust), false)

// run PoolQ and write the file
val _ = PoolQ.runProcess(barcodes, consumer).get

UnexpectedSequenceWriter
.write(outputFile, cachePath, 100, colReference, Some(globalReference), 100)
.get

val expected =
s"""Sequence\tTotal\tAAAA\tAAAT\tCCCC\tCCCG\tPotential IDs
|AAAAAAAAAACCCCCCCCCC\t1\t0\t0\t0\t1\t
|""".stripMargin

Using.resource(Source.fromFile(outputFile.toFile)) { contents =>
// now check the contents
val actual = contents.mkString
assertEquals(actual, expected)
}
finally
val _ = tmpPath.toFile.toScala.delete()

end try
}

test("read unexpected sequence cache") {
val cachePath = resourcePath("unexpected-sequences")
val outputFile = Files.createTempFile("unexpected", ".txt")
Expand Down