fqtk
fqtk copied to clipboard
feat: better error message when barcode length differs from expected
- fixes #31, error message is now more clear
This is my first time writing Rust, so please feel free to make suggestions for better style/design/etc.
A note on the new tests:
Since Samples do not allow empty barcodes:
https://github.com/fulcrumgenomics/fqtk/blob/6ed98a3334eb13f22dd8054d39d9b8f77e76b337/src/lib/samples.rs#L48-L50
My understanding is that new() is the only way to get a new Sample outside of the samples.rs module, since Sample contains a private field (ordinal). Therefore, I dropped the test for BarcodeMatcher being initialized with a Sample with an empty barcode:
https://github.com/fulcrumgenomics/fqtk/blob/6ed98a3334eb13f22dd8054d39d9b8f77e76b337/src/lib/barcode_matching.rs#L178-L185
And modified the test that allowed empty barcodes to be compared to check that it now fails. https://github.com/fulcrumgenomics/fqtk/blob/6ed98a3334eb13f22dd8054d39d9b8f77e76b337/src/lib/barcode_matching.rs#L195-L198