Skip to content

Commit

Permalink
drop scores lower than median and scale to fill [0, 1]
Browse files Browse the repository at this point in the history
  • Loading branch information
bfclarke committed Nov 11, 2024
1 parent 5e09bd5 commit 6e89bd8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion deeprvat/deeprvat/associate.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ def make_regenie_input_(
pseudovar_pos = (this_gene_pos.End - this_gene_pos.Start).to_numpy().astype(int)
ensgids = this_gene_pos.index.to_numpy()

median_score = np.median(burdens[:, 0]) # TODO: This is a hack!!!!
logger.info(f"Writing pseudovariants to {bgen}")
with BgenWriter(
bgen,
Expand All @@ -468,8 +469,10 @@ def make_regenie_input_(
# 1. Warn if burdens are censored to remain > 0
# 2. Offset/scale more intelligently to fill out [0, 1] better
# 3. (maybe) Allow for setting offset/scale as parameter
offset = 0.251
offset = median_score
this_burdens = np.maximum(this_burdens - offset, 0)
max_burden = np.max(this_burdens)
this_burdens = this_burdens / max_burden

# REGENIE assumes by default genotypes are stored alt-first
genotypes = np.stack(
Expand Down

0 comments on commit 6e89bd8

Please sign in to comment.