Pseudo metrics
_match_variant_stats(test_gdl, prs_beta_table)
¶
Match the standardized marginal betas from the validation set to the inferred PRS effect sizes.
This function takes a GWADataLoader
object from the validation set (with matched LD matrices and
GWAS summary statistics) and a PRS table object and returns a tuple of three arrays:
. The standardized marginal betas from the validation set¶
. The inferred PRS effect sizes¶
. The LD-weighted PRS effect sizes (q)¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
test_gdl
|
A |
required | |
prs_beta_table
|
A pandas DataFrame with the PRS effect sizes. Must contain the columns: CHR, SNP, A1, A2, BETA. |
required |
Returns:
Type | Description |
---|---|
A tuple of three arrays: (1) The standardized marginal betas from the validation set, (2) The inferred PRS effect sizes, (3) The LD-weighted PRS effect sizes (q). |
Source code in viprs/eval/pseudo_metrics.py
pseudo_pearson_r(test_gdl, prs_beta_table)
¶
Perform pseudo-validation of the inferred effect sizes by comparing them to standardized marginal betas from an independent validation set. Here, we follow the pseudo-validation procedures outlined in Mak et al. (2017) and Yang and Zhou (2020), where the correlation between the PRS and the phenotype in an independent validation cohort can be approximated with:
Corr(PRS, y) ~= r'b / sqrt(b'Sb)
Where r
is the standardized marginal beta from a validation set,
b
is the posterior mean for the effect size of each variant and S
is the LD matrix.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
test_gdl
|
An instance of |
required | |
prs_beta_table
|
A pandas DataFrame with the PRS effect sizes. Must contain the columns: CHR, SNP, A1, A2, BETA. |
required |
Source code in viprs/eval/pseudo_metrics.py
pseudo_r2(test_gdl, prs_beta_table)
¶
Compute the R-Squared metric (proportion of variance explained) for a given PRS using standardized marginal betas from an independent test set. Here, we follow the pseudo-validation procedures outlined in Mak et al. (2017) and Yang and Zhou (2020), where the proportion of phenotypic variance explained by the PRS in an independent validation cohort can be approximated with:
R2(PRS, y) ~= 2*r'b - b'Sb
Where r
is the standardized marginal beta from a validation/test set,
b
is the posterior mean for the effect size of each variant and S
is the LD matrix.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
test_gdl
|
An instance of |
required | |
prs_beta_table
|
A pandas DataFrame with the PRS effect sizes. Must contain the columns: CHR, SNP, A1, A2, BETA. |
required |