-
Notifications
You must be signed in to change notification settings - Fork 22
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
perf: speed up TRRecord.GetLengthGenotypes()
#187
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use broadcasting to improve the speed as we scale up the number of samples
aryarm
changed the title
speed up for
refactor: speed up for Aug 11, 2023
TRRecord.GetLengthGenotypes()
TRRecord.GetLengthGenotypes()
@LiterallyUniqueLogin, can I request a review from you since you were the original author of this code? What do you think of these changes? |
aryarm
changed the title
refactor: speed up for
perf: speed up for Nov 9, 2023
TRRecord.GetLengthGenotypes()
TRRecord.GetLengthGenotypes()
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.
This looks good, thanks for the update! Just one minor comment to address.
aryarm
changed the title
perf: speed up for
perf: speed up Dec 20, 2023
TRRecord.GetLengthGenotypes()
TRRecord.GetLengthGenotypes()
LiterallyUniqueLogin
approved these changes
Dec 21, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was playing around with
GetLengthGenotypes
when trying to integrate it into haptools and noticed there might be a potentially faster way of implementing it.This implementation vectorizes the for-loop using broadcasting, improving the speed as we scale up 1) the number of samples and 2) the number of alleles in each TR of a VCF. I benchmarked haptools for 1 (but not 2) via our benchmarking script (with some small adaptations).
I didn't add any tests to this PR because it's just a refactor.
GetLengthGenotypes
already has tests and they all seemed to pass with this new code. But feel free to let me know if there are any tests that it would be good for me to add.