mglev1n / ldscr

LD Score Regression in R
https://mglev1n.github.io/ldscr/
Other
31 stars 3 forks source link

Heritability Estimation Error #13

Closed rachel-yd closed 7 months ago

rachel-yd commented 8 months ago

To whom it may concern,

I am new to R and the ldscr function. I am trying to run cross-trait LDSC for two munged datasets. But I kept getting the following error message:

*Error in t(weighted.LD[select.from[i]:select.to[i], ]) %% weighted.chi[select.from[i]:select.to[i], : Non-integer argument ✖Estimating heritability for 'dt1' [2.6s]**

The data input format is as required, where dt1 and dt2 are two dataframes with 10 columns (SNP, CHR, BP, A1, A2, BETA, SE, P, N, Z):

rg_res<-ldscr::ldsc_rg( munged_sumstats = list( "dt1"=dt1, "dt2"=dt2), ancestry="EUR")

Is this problem occuring on my end (as in error in the data input) or the package's end? Please kindly advise! Thank you very much.

The rest of the report is as follows: No sample prevalence data provided. Estimating heritabilities on the observed scale. ✔ Using EUR reference from Pan-UKB [137ms] ✔ Reading LD Scores [784ms]
✔ Reading weights [739ms]
✔ Reading M [154ms]
✔ Reading summary statistics for 'dt1' from dataframe [71ms] ℹ 12/59 SNPs remain after merging 'dt1' with LD-score files ℹ Removed 0 SNPs with Chi^2 > 80 from 'dt1'; 12 SNPs remain ✔ Merging 'dt1' with LD-score files [2.5s] ✔ Reading summary statistics for 'dt2' from dataframe [57ms] ℹ 14/79 SNPs remain after merging 'dt2' with LD-score files ℹ Removed 0 SNPs with Chi^2 > 377.277 from 'dt2'; 14 SNPs remain ✔ Merging 'dt2' with LD-score files [1.5s] ✔ Reading summary statistics [4.6s] Error in t(weighted.LD[select.from[i]:select.to[i], ]) %*% weighted.chi[select.from[i]:select.to[i], : Non-integer argument ✖Estimating heritability for 'dt1' [2.6s]

mglev1n commented 8 months ago

Without seeing dt1 or dt2 it is hard to provide advice. Are you able to provide a reproducible example and/or run the examples using the built-in data: https://mglev1n.github.io/ldscr/#usage

Based on the error message, it seems that one of the columns that should contain only numeric values (eg. BETA, SE, P, N, Z) may contain other types.

github-actions[bot] commented 7 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 7 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.