Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hanars committed Feb 14, 2024
1 parent 5eb3bb6 commit 4fc80a5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion hail_search/queries/sv.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def _filter_annotated_table(self, ht, *args, parsed_intervals=None, exclude_inte
if padded_interval:
padding = int((padded_interval['end'] - padded_interval['start']) * padded_interval['padding'])
ht = ht.filter(hl.all([
ht.start_locus.contig == padded_interval['chrom'],
ht.start_locus.contig == f"chr{padded_interval['chrom']}",
self._locus_in_range(ht.start_locus, padded_interval['start'], padding),
self._locus_in_range(ht.end_locus, padded_interval['end'], padding)
]))
Expand Down
6 changes: 3 additions & 3 deletions hail_search/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,17 +612,17 @@ async def test_location_search(self):
)

await self._assert_expected_search(
[GCNV_VARIANT4], padded_interval={'chrom': '17', 'start': 38724781, 'end': 38738703, 'padding': 0.2},
[GCNV_VARIANT4], padded_interval={'chrom': '17', 'start': 38720781, 'end': 38738703, 'padding': 0.2},
omit_sample_type='SNV_INDEL',
)

await self._assert_expected_search(
[], padded_interval={'chrom': '17', 'start': 38722281, 'end': 38738703, 'padding': 0.1},
[], padded_interval={'chrom': '17', 'start': 38720781, 'end': 38738703, 'padding': 0.1},
omit_sample_type='SNV_INDEL',
)

await self._assert_expected_search(
[SV_VARIANT1], padded_interval={'chrom': '14', 'start': 106692244, 'end': 106742587, 'padding': 0.1},
[SV_VARIANT4], padded_interval={'chrom': '14', 'start': 106692244, 'end': 106742587, 'padding': 0.1},
sample_data=SV_WGS_SAMPLE_DATA,
)

Expand Down
3 changes: 2 additions & 1 deletion seqr/utils/search/hail_search_utils_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ def test_variant_lookup(self):
})
self._test_minimal_search_call(expected_search_body={
'genome_version': 'GRCh38', 'data_type': 'SV_WES', 'annotations': {'structural': ['DEL', 'gCNV_DEL']},
'intervals': ['17:38718997-38738487'], 'sample_data': {'SV_WGS': SV_WGS_SAMPLE_DATA},
'padded_interval': {'chrom': '17', 'start': 38721781, 'end': 38735703, 'padding': 0.2},
'sample_data': {'SV_WGS': SV_WGS_SAMPLE_DATA},
})

# No second lookup call is made for non DELs/DUPs
Expand Down

0 comments on commit 4fc80a5

Please sign in to comment.