Skip to content

Commit

Permalink
fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ShifaSZ committed Jul 21, 2023
1 parent 506506f commit 929dde6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions seqr/utils/search/elasticsearch/es_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -1413,8 +1413,9 @@ def _location_filter(genes, intervals, exclude_locations):
}
} for key in ['xpos', 'xstop']]
interval_q = _build_or_filter('range', range_filters)
interval_q |= Q('range', xpos={'lte': xstart}) & Q('range', xstop={'gte': xstop}) &
Q('range', xpos={'gte': get_xpos(interval['chrom'], 0)}) & Q('range', xstop={'lte': get_xpos(interval['chrom'], MAX_POS)})
interval_q |= Q('range', xpos={'lte': xstart}) & Q('range', xstop={'gte': xstop}) & \
Q('range', xpos={'gte': get_xpos(interval['chrom'], MIN_POS)}) & \
Q('range', xstop={'lte': get_xpos(interval['chrom'], MAX_POS)})

if q:
q |= interval_q
Expand Down
3 changes: 2 additions & 1 deletion seqr/utils/search/elasticsearch/es_utils_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1614,7 +1614,8 @@ def test_filtered_get_es_variants(self):
{'bool': {'must': [
{'range': {'xpos': {'lte': 2000001234}}},
{'range': {'xstop': {'gte': 2000005678}}},
{'script': {'script': "doc['xpos'].value / 1000000000 == doc['xstop'].value / 1000000000"}},
{'range': {'xpos': {'gte': 2000000001}}},
{'range': {'xstop': {'lte': 2300000000}}},
]}},
{'terms': {'geneIds': ['ENSG00000223972']}},
{'bool': {'must': [
Expand Down

0 comments on commit 929dde6

Please sign in to comment.