Skip to content
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

Fix early return and counting of mismatches with no-calls in barcodes. #48

Merged
merged 2 commits into from
Aug 19, 2024

Conversation

theJasonFan
Copy link
Member

Closes #47.

The snippet from barcode matcher was returning None too early if there are Ns in both expected barcodes and observed barcodes.

fn assign( ...) -> ... {
...
    if num_no_calls > self.max_mismatches as usize {
        None
    }
...

E.g. When max_mistmatches == 0, observed barcode ANAAAA should match NNAAAA, but the snippet below returns None early.

To allow for no-calls in barcodes, we have to relax the optimization here and exit early if the number of observed no-calls is greater than the maximum number Ns for any sample barcode plus the maximum allowable number of mismatches.

@theJasonFan theJasonFan requested a review from nh13 August 19, 2024 17:01
@theJasonFan theJasonFan changed the title Fix early return and counting of mismatches when n in barcodes. Fix early return and counting of mismatches with no-calls in barcodes. Aug 19, 2024
Copy link
Member

@nh13 nh13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice catch!

@theJasonFan theJasonFan merged commit dd803fc into main Aug 19, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Demultiplexing "N"-barcode as no-op
2 participants