Skip to content

Commit

Permalink
scale gene impairment scores to fill full dosage range for REGENIE
Browse files Browse the repository at this point in the history
  • Loading branch information
bfclarke committed Oct 30, 2024
1 parent 113fa72 commit 229e059
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion deeprvat/deeprvat/associate.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,14 @@ def make_regenie_input_(
) as f:
for i in trange(n_genes):
varid = f"pseudovariant_gene_{ensgids[i]}"
this_burdens = burdens[:, i] # Rescale scores to be in range (0, 2)
this_burdens = burdens[:, i]

# Rescale scores to fill out range [0, 1] (making dosages in [0, 2])
min_burden = np.min(this_burdens)
max_burden = np.max(this_burdens)
this_burdens = (this_burdens - min_burden) / (max_burden - min_burden)

# REGENIE assumes by default genotypes are stored alt-first
genotypes = np.stack(
(this_burdens, np.zeros(this_burdens.shape), 1 - this_burdens),
axis=1,
Expand Down

0 comments on commit 229e059

Please sign in to comment.