Exact Barcode Counting¶
Count exact barcode matches in sequencing reads. Given a barcode library
and a read structure, count_barcodes() counts how many reads contain
each barcode at the expected position.
exact
¶
Exact-match barcode counting.
Module-level function count_barcodes() migrated from
legacy/barcoder/heuristicount.py. Uses a learned ReadStructure
to extract barcode+flanks at known offset, validates against
flank-augmented library via set lookup.
count_barcodes
¶
count_barcodes(reads1: str, library: set[str], *, structure: ReadStructure, reads2: str | None = None) -> TableTrack
Count barcodes in reads using the learned structure.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reads1
|
str
|
Path to primary reads file. |
required |
library
|
set[str]
|
Set of known barcode sequences. |
required |
structure
|
ReadStructure
|
Learned read structure from discovery. |
required |
reads2
|
str | None
|
Optional path to paired-end reads file. |
None
|
Returns:
| Type | Description |
|---|---|
TableTrack
|
|
TableTrack
|
(valid flanks but not in library) have |
Examples: