mirror of
https://github.com/metabarcoding/obitools4.git
synced 2026-04-30 12:00:39 +00:00
8c7017a99d
- Update obioptions.Version from "Release 4.4.29" to "/v/ Release v5" - Update version.txt from 4.29 → .30 (automated by Makefile)
1.6 KiB
1.6 KiB
Demultiplexing Functionality in obingslibrary
This package provides tools for demultiplexing NGS reads by matching them against known primer pairs and extracting associated barcodes.
Core Types
DemultiplexMatch: Struct holding alignment results for forward/reverse primers, mismatches, barcode coordinates (BarcodeStart,BarcodeEnd), and metadata (e.g., sample/experiment info viaPCR). Includes error handling.
Key Methods
-
Match(sequence):
Scans the inputBioSequenceagainst all primer pairs inNGSLibrary.Markers. Returns a populatedDemultiplexMatchif any primer pair matches. -
ExtractBarcode(sequence, inplace):
Uses the result ofMatch()to:- Extract the barcode region (if valid: non-dimer).
- Reverse-complement if read is in reverse orientation (
IsDirect == false). - Annotate the sequence with:
- Primer names and match details (positions, mismatches).
- Direction (
direct/reverse). - Sample/experiment info (if assignment succeeds), or error message.
Behavior Notes
- Primer dimer detection: If
BarcodeStart > BarcodeEnd, the read is flagged as a primer dimer and not extracted. - Error handling: Errors (e.g., no match, sample unassignment) are stored in
match.Errorand propagated as annotations. - Annotation richness: Output sequences carry rich metadata (sample, experiment, primers, errors), supporting downstream filtering/analysis.
Dependencies
- Uses
logrusfor fatal logging (e.g., subsequence extraction failure). - Integrates with
obiseq.BioSequencefor sequence representation and manipulation.