Skip to content

Commit

Permalink
General usability updates to speed up VIPRS/VIPRSGrid and provide mor…
Browse files Browse the repository at this point in the history
…e control to the user.
  • Loading branch information
shz9 committed Jun 6, 2024
1 parent 4eee62f commit 7f72fd9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.3] - TBD

### Changed

- Fixed bug in `psuedo_metrics` when extracting summary statistics data.


## [0.1.2] - 2024-06-03

### Changed
Expand Down
10 changes: 6 additions & 4 deletions viprs/eval/pseudo_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def _match_variant_stats(test_gdl, prs_beta_table):

from magenpy.utils.model_utils import merge_snp_tables

validation_tab = test_gdl.to_snp_table(col_subset=['CHR', 'SNP', 'A1', 'A2', 'STD_BETA'],
per_chromosome=True)
validation_tab = test_gdl.to_summary_statistics_table(col_subset=['CHR', 'SNP', 'A1', 'A2', 'STD_BETA'],
per_chromosome=True)

required_cols = ['CHR', 'SNP', 'A1', 'A2']
for col in required_cols:
Expand All @@ -41,8 +41,10 @@ def _match_variant_stats(test_gdl, prs_beta_table):
if 'BETA' in prs_beta_table.columns:
beta_cols = ['BETA']
else:
beta_cols = [col for col in prs_beta_table.columns if 'BETA' in col and 'VAR' not in col]
assert len(beta_cols) > 0, "The PRS effect sizes table must contain a column named BETA or BETA_0, BETA_1, etc."
beta_cols = [col for col in prs_beta_table.columns
if 'BETA' in col and 'VAR' not in col]
assert len(beta_cols) > 0, ("The PRS effect sizes table must contain "
"a column named BETA or BETA_0, BETA_1, etc.")

per_chrom_prs_tables = dict(tuple(prs_beta_table.groupby('CHR')))

Expand Down

0 comments on commit 7f72fd9

Please sign in to comment.