Repository: Clinical-Genomics/scout

Issue:
CADD score filter monday-issue! 
Thank you kindly for the quick inclusion of CADD score filtering! Will make a couple of our doctors very happy.

One major caveat though: the current version seems to filter out unknown CADD scores as well (similar to the unknown frequency bug)! Not intended usage..


Discussion:

Patch:
diff --git a/scout/adapter/mongo/query.py b/scout/adapter/mongo/query.py
index 3a07b82d8..055963b99 100644
--- a/scout/adapter/mongo/query.py
+++ b/scout/adapter/mongo/query.py
@@ -114,15 +114,16 @@ class QueryHandler(object):
             cadd_query = {'cadd_score': {'$gt': float(cadd)}}
             logger.debug("Adding cadd_score: %s to query" % cadd)
 
-            if query.get('cadd_inclusive') == 'yes':
+            if query.get('cadd_inclusive') == True:
                 cadd_query = {
                     '$or': [
                         cadd_query,
                         {'cadd_score': {'$exists': False}}
-                    ]}
+                        ]}
                 logger.debug("Adding cadd inclusive to query")
 
             mongo_query['$and'].append(cadd_query)
+                    
 
         if query.get('genetic_models'):
             models = query['genetic_models']


Test patch:
diff --git a/tests/adapter/test_query.py b/tests/adapter/test_query.py
index e5aee3586..2d12aa555 100644
--- a/tests/adapter/test_query.py
+++ b/tests/adapter/test_query.py
@@ -57,7 +57,7 @@ def test_build_cadd_exclusive(adapter):
 def test_build_cadd_inclusive(adapter):
     case_id = 'cust000'
     cadd = 10.0
-    cadd_inclusive = 'yes'
+    cadd_inclusive = True
     query = {'cadd_score': cadd, 'cadd_inclusive': cadd_inclusive}
 
     mongo_query = adapter.build_query(case_id, query=query)