-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: better error message when barcode length differs from expected #44
base: main
Are you sure you want to change the base?
Conversation
TimD1
commented
Jul 9, 2024
- fixes Better error when the sample barcode lengths in the meta do not match the barcode lengths in the read structure #31, error message is now more clear
src/lib/barcode_matching.rs
Outdated
@@ -74,7 +74,7 @@ impl BarcodeMatcher { | |||
assert_eq!( | |||
observed_bases.len(), | |||
expected_bases.len(), | |||
"observed_bases: {}, expected_bases: {}", | |||
"Sample barcode length ({}) differs from expected ({}) during barcode matching", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be helpful to additionally include the sequence of the barcode in question?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to know which sample this is caused by, as well as the barcode bases (actual and expected) along with the length.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. I can add that info if I replace BarcodeMatcher.sample_barcodes
with BarcodeMatcher.samples
(vector of Sample
structs storing sample_id
s and barcode
s). It looks like this was the eventual plan anyways:
fqtk/src/lib/barcode_matching.rs
Lines 25 to 27 in 3392552
/// Note - this is to be replaced by a sample struct in task 3. For now we're keeping things | |
/// very simple. | |
sample_barcodes: Vec<BString>, |
- barcode bases and lengths (actual and expected) and sample name are printed - fixes #31 by passing `Sample` to `count_mismatches()` instead of barcode string - all `count_mismatches()` tests updated to match new signature - minor miscellaneous comment typos fixed as well
3392552
to
745cdb8
Compare
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: Lines 48 to 50 in 6ed98a3
My understanding is that fqtk/src/lib/barcode_matching.rs Lines 178 to 185 in 6ed98a3
And modified the test that allowed empty barcodes to be compared to check that it now fails. fqtk/src/lib/barcode_matching.rs Lines 195 to 198 in 6ed98a3
|