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

Add max diff option (-x) #54

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Add max diff option (-x) #54

wants to merge 3 commits into from

Conversation

boasvdp
Copy link

@boasvdp boasvdp commented Mar 5, 2024

Stops counting SNP differences above a certain threshold (default: 9_999_999). Adds nearly negligible overhead by comparing diff to maxdiff (https://github.com/boasvdp/snp-dists/blob/master/main.c#L28).

Comparison on an alignment of 500 simulated (non-masked) TB genomes which differ ~2000 SNPs on average, measured using /usr/bin/time -v and 8 threads:

Method Max diff Elapsed (wall clock) time (m:ss)
original snp-dists N/A 2:15.59
this PR 9_999_999 2:16.95
this PR 1000 1:09.18
this PR 200 0:18.94

Inspired by the -x option in cgmlst-dists.

Copy link
Contributor

@kloetzl kloetzl left a comment

Choose a reason for hiding this comment

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

Looks good to me. If performance is an issue we can try and optimize harder.

main.c Outdated Show resolved Hide resolved
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.

2 participants