fqtk icon indicating copy to clipboard operation
fqtk copied to clipboard

feat: better error message when barcode length differs from expected

Open TimD1 opened this issue 1 year ago • 1 comments

  • fixes #31, error message is now more clear

TimD1 avatar Jul 09 '24 16:07 TimD1

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

TimD1 avatar Jul 10 '24 21:07 TimD1