Conversation
…nstitute/seqr into variant-clickhouse-tables
…/seqr into variant-clickhouse-tables
…/seqr into variant-clickhouse-tables
…iant-clickhouse-tables
…/seqr into variant-clickhouse-tables
…/seqr into variant-clickhouse-tables
| def _annotate_filtered_transcripts(self, results, consequence_field, transcript_filters, *args, require_mane_canonical=False, **kwargs): | ||
| if require_mane_canonical: | ||
| filtered_expr = ArrayFilter(consequence_field, conditions=[{'canonical': (0, '{field} > {value}')}]) | ||
| if 'isManeSelect' in self.sorted_transcript_consequence_fields: |
There was a problem hiding this comment.
this is the only new behavior added in this PR - adds the require_mane_canonical flag that uses the new isManeSelect field so restricting to primary consequence is doen at query time instead of in post-processing
| return lookup | ||
|
|
||
|
|
||
| def get_variant_main_transcripts_by_key(genome_version, dataset_type, selected_transcripts_by_key, include_clinvar=False, additional_values=None): |
There was a problem hiding this comment.
slightly different versions of this logic were implemented in 3 different places in the code, this moves the logic into a single shared helper
| ('_overwrite_base_manager', django.db.models.manager.Manager()), | ||
| ], | ||
| ), | ||
| migrations.RunSQL( |
There was a problem hiding this comment.
this is a no-op as the foreign keys are not actually enforced in clickhouse at the db level, but this just tells django that they have been updated
| @@ -5,12 +5,8 @@ | |||
| from django.db.models import Q, F | |||
| from django.db.models.functions import JSONObject | |||
There was a problem hiding this comment.
The logic for the command changed quite a bit, as previously we had to get the full results back from search and then post-process them to filter based on whether or not they pass their transcript filters with a valid mane transcript. Since mane select in now available on the main variants table this filtering is done at search time and no post-processing is needed. Therefore, rather than getting back the formatted results from search we get back just the minimal genotypes and keys. We then use the shared utility function for bulk saving variants to handle getting and formatting the fields we need for actually saving a variant model, as this allows us to encapsulate that functionality in one place instead of having multiple different implementations. A restriction of this is that we need to call the bulk update method on a per-dataset type bases instead of once for everything, but that should not have a real performance impact
| super().setUpClass() | ||
|
|
||
| @classmethod | ||
| def _clean_up_clickhouse_db(cls): |
There was a problem hiding this comment.
To be clear, this exact TRUNCATE sql is run as part of every test class tear down, it juts doe snot always propogate, and this was the only way I could reliably get tests to pass
No description provided.