Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ld score regression #3568

Open
iris-garden opened this issue May 6, 2024 · 0 comments
Open

Ld score regression #3568

iris-garden opened this issue May 6, 2024 · 0 comments
Labels
discourse migrated from discuss.hail.is

Comments

@iris-garden
Copy link
Owner

Note

The following post was exported from discuss.hail.is, a forum for asking questions about Hail which has since been deprecated.

(Dec 06, 2023 at 16:46) anh151 said:

Hello,
I am trying to run LD score regression on my GWAS results in order to assess polygenecity vs confounding from my population. My GWAS was a linear regression of ~8.8 million variants and 900 samples.

I followed the example available at the link below. I was able to replicate the analysis one of the 1kg datasets available through hail on chromsome 21.
https://ibg.colorado.edu/cdrom2023/session/Day-5b%20Hail%20I,%20Tim%20Poterba/2021_IBG_Hail/05-advanced-hail-functionality.ipynb

gwas_control_gene = hl.read_table(gwas_results_file)
mt = hl.read_matrix_table(mt_gwas_ready_file)

ht_scores = hl.experimental.ld_score(
    entry_expr=mt.n_alt_alleles,
    locus_expr=mt.locus,
    radius=1e6
)

betas = gwas_control_gene
betas = betas.annotate(z_score = betas.beta / betas.standard_error)
betas = betas.annotate(chi_sq_statistic = betas.z_score ** 2)

ht_results = hl.experimental.ld_score_regression(
    weight_expr=ht_scores[ht.locus].univariate,
    ld_score_expr=ht_scores[ht.locus].univariate,
    chi_sq_exprs=betas[ht.key].chi_sq_statistic,
    n_samples_exprs=betas[ht.key].n
)

However, when I run it on my GWAS data, I get the results shown below. Can you provide some more information on what would cause an NaN result?
image

Thanks,
Andrew

(Dec 12, 2023 at 16:00) anh151 said:

Couldn’t get it to work and couldn’t figure out why. Ended up using the ldsc package using the example below:
https://cloufield.github.io/GWASTutorial/08_LDSC/

@iris-garden iris-garden added the discourse migrated from discuss.hail.is label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discourse migrated from discuss.hail.is
Projects
None yet
Development

No branches or pull requests

1 participant