Skip to content

Commit

Permalink
fix ind file parsing: use re.split
Browse files Browse the repository at this point in the history
  • Loading branch information
tschuelia committed Jan 14, 2025
1 parent b0e183c commit 58136a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pandora/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _check_ind_file(ind_file: pathlib.Path):

for line in ind_file.open():
try:
ind_id, _, _ = line.strip().split()
ind_id, _, _ = re.split(r"\s+", line.strip(), maxsplit=2)
except ValueError:
# too few or too many lines
raise PandoraConfigException(
Expand Down Expand Up @@ -1353,7 +1353,7 @@ def numpy_dataset_from_eigenfiles(eigen_prefix: pathlib.Path) -> NumpyDataset:
populations = []

for line in ind_file.open():
sid, _, pop = line.strip().split()
sid, _, pop = re.split(r"\s+", line.strip(), maxsplit=2)
sample_ids.append(sid.strip())
populations.append(pop.strip())

Expand Down

0 comments on commit 58136a8

Please sign in to comment.