From b86ee57631d6719a5f630be488d69d411846c96f Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Wed, 27 Nov 2024 21:25:10 +0000 Subject: [PATCH] resolve first failing transform test --- haptools/data/haplotypes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/haptools/data/haplotypes.py b/haptools/data/haplotypes.py index f70e4709..ba33d0a5 100644 --- a/haptools/data/haplotypes.py +++ b/haptools/data/haplotypes.py @@ -1203,7 +1203,7 @@ def __iter__( # if the user requested a specific region or subset of haplotypes and the file # is indexed, then we should handle it using tabix # else, we use a regular text opener - b/c there's no benefit to using tabix - if region or (haplotypes and indexed): + if (region or haplotypes) and indexed: haps_file = TabixFile(str(self.fname)) metas, extras = self.check_header(list(haps_file.header)) types = self._get_field_types(extras, metas.get("order")) @@ -1232,8 +1232,8 @@ def __iter__( ) haps_file.close() else: - # the file is not indexed, so we can't assume it's sorted, either - # use hook_compressed to automatically handle gz files + # The file is not indexed, so we can't assume it's sorted, either + # Use hook_compressed to automatically handle gz files with self.hook_compressed(self.fname, mode="r") as haps: self.log.info("Not taking advantage of indexing.") header_lines = []