Skip to content

Commit

Permalink
Reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
szhan committed Jun 12, 2024
1 parent ec057df commit 52fed66
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lshmm/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,19 +123,20 @@ def convert_haplotypes_to_unphased_genotypes(query):

@jit.numba_njit
def get_num_copiable_entries(ref_panel):
assert ref_panel.ndim in [2, 3], \
"Reference panel array has incorrect dimensions."
assert np.all(ref_panel != MISSING), \
"Reference panel cannot contain any MISSING values."
assert ref_panel.ndim in [2, 3], "Reference panel array has incorrect dimensions."
assert np.all(
ref_panel != MISSING
), "Reference panel cannot contain any MISSING values."
if ref_panel.ndim == 2:
num_copiable_entries = np.sum(ref_panel != NONCOPY, axis=1)
else:
num_sites = ref_panel.shape[0]
num_copiable_entries = np.zeros(num_sites, dtype=np.int32)
for i in range(num_sites):
num_copiable_entries[i] = np.sum(ref_panel[i, :, :] != NONCOPY)
assert np.all(num_copiable_entries > 0), \
"Number of copiable entries must be greater than zero at all sites."
assert np.all(
num_copiable_entries > 0
), "Number of copiable entries must be greater than zero at all sites."
return num_copiable_entries


Expand Down

0 comments on commit 52fed66

Please sign in to comment.