-
Notifications
You must be signed in to change notification settings - Fork 88
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
Hail backend filter location #3528
Conversation
…oadinstitute/seqr into hail-backend-filter-location
…oadinstitute/seqr into hail-backend-filter-location
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.
It mostly looks good to me, except for one comment.
hail_search/hail_search_query.py
Outdated
@property | ||
def should_add_chr_prefix(self): | ||
reference_genome = hl.get_reference(self._genome_version) | ||
return any(c.startswith('chr') for c in reference_genome.contigs) |
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.
Using an attribute of the class and initializing it in the __init__
function performs better.
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.
no @property
performs better because it will only be initialized if it is actually used which this isn't in lots of searches, but once its initialized the value is reused on every subsequent call and its not recomputed
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 you mind giving more context on why @property
saves the recomputation? We might need @functools.cached_property
to get the caching behavior (and I think exactly the behavior Shifa was asking for plus the benefit of it only being initialized if it's actually used).
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.
oh I think I misunderstood what the property was doing. I'll look into this
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.
The property needs recomputation when self._genome_version
is changed.
…oadinstitute/seqr into hail-backend-filter-location
No description provided.