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

Thousand genomes allele count not applied for SVs #619

Closed
holtgrewe opened this issue Aug 25, 2022 · 2 comments · Fixed by #618
Closed

Thousand genomes allele count not applied for SVs #619

holtgrewe opened this issue Aug 25, 2022 · 2 comments · Fixed by #618
Labels
bug Something isn't working

Comments

@holtgrewe
Copy link
Collaborator

Describe the bug
The allele count for SVs appears to be not applied for SVs.

To Reproduce
Steps to reproduce the behavior:

  1. Filter a case with a limit of SVs, e.g., of 10
  2. See that variants with higher G1K counts are in the result

Expected behavior
Such variants should be removed by the filter.

Screenshots
N/A

Additional context
N/A

@holtgrewe holtgrewe added the bug Something isn't working label Aug 25, 2022
@holtgrewe
Copy link
Collaborator Author

Root Cause Analysis

  • The threshold is not incorporated into the query.
  • Root cause is that the form field is called g1k_max_alleles and not g1k_max_carriers. This is not properly reflected in ExtendQueryPartsPublicDatabaseFrequencyJoinAndFilter.

@holtgrewe
Copy link
Collaborator Author

Resolution Proposal
Simply fix the problem in svs.queries.

Affected Components
VarFish Server

Affected Modules/Files
svs.queries

Required Architectural Changes
None

Required Database Changes
None

Backport Possible?
Not desired (SV filtration not officially supported in anthenea)

Resolution Sketch

diff --git a/svs/queries.py b/svs/queries.py
index 95e5bb2..a966291 100644
--- a/svs/queries.py
+++ b/svs/queries.py
@@ -385,6 +385,7 @@ class ExtendQueryPartsPublicDatabaseFrequencyJoinAndFilter(ExtendQueryPartsBase)
     def extend_conditions(self, _query_parts):
         result = []
         for token, _, _ in self.TOKEN_MODEL_FIELD:
+            entity = "alleles" if token == "g1k" else "carriers"
             if (
                 self.kwargs.get("%s_enabled" % token, False)
                 and ("%s_overlap_count" % token) in self.fields
@@ -392,7 +393,7 @@ class ExtendQueryPartsPublicDatabaseFrequencyJoinAndFilter(ExtendQueryPartsBase)
             ):
                 result.append(
                     self.fields["%s_overlap_count" % token]
-                    <= self.kwargs["%s_max_carriers" % token]
+                    <= self.kwargs["%s_max_%s" % (token, entity)]
                 )
         return result
 

holtgrewe added a commit that referenced this issue Aug 25, 2022
Closes: #619
Related-Issue: #619
Projected-Results-Impact: require-revalidation
holtgrewe added a commit that referenced this issue Aug 25, 2022
Closes: #619
Related-Issue: #619
Projected-Results-Impact: require-revalidation
holtgrewe added a commit that referenced this issue Aug 26, 2022
Closes: #619
Related-Issue: #619
Projected-Results-Impact: require-revalidation
holtgrewe added a commit that referenced this issue Aug 29, 2022
Closes: #619
Related-Issue: #619
Projected-Results-Impact: require-revalidation
holtgrewe added a commit that referenced this issue Sep 6, 2022
Closes: #619
Related-Issue: #619
Projected-Results-Impact: require-revalidation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant