ajaynadig / bhr

Suite of heritability and genetic correlation estimation tools for exome-sequencing data
MIT License
31 stars 6 forks source link

Missing value of Lambda GC in genetic correlation estimation #12

Closed Asukayj closed 1 year ago

Asukayj commented 1 year ago

Dear BHR team,

Thanks for your work again on the previous issues! I have encountered some new problems in estimating the genetic correlations. Here is the details of the error:

>   va_cor<-BHR(mode = "bivariate",
+                       trait1_sumstats = sumstats_1,
+                       trait2_sumstats = sumstats_2,
+                       annotations = list(baseline_ori),
+                       num_null_conditions=5,
+                       use_null_conditions_rg=TRUE)
Burden Heritability Regression
Daniel Weiner, Ajay Nadig, and Luke O'Connor, 2023
Running BHR at 2023-04-10 23:16:36
For trait 1, MAF ranges from 1.5e-05 to 9.9e-05
...seems reasonable
For trait 2, MAF ranges from 1.3e-06 to 1.1e-05
...seems reasonable
Lambda GC:  NA
Error in if (lambda_gc > 0.5 & lambda_gc < 2) { : 
  missing value where TRUE/FALSE needed
In addition: Warning messages:
1: In qchisq(p = 1 - (0.05/nrow(trait1_sumstats)), df = 1) : NaNs produced
2: In qchisq(p = 1 - (0.05/nrow(trait2_sumstats)), df = 1) : NaNs produced

However, when I checked the 'qchisq' function above, it seems that there should not be the errors:

> trait1_sumstats = sumstats_1
> trait2_sumstats = sumstats_2
> qchisq(p = 1 - (0.05/nrow(trait1_sumstats)), df = 1)
[1] 25.37991
> qchisq(p = 1 - (0.05/nrow(trait2_sumstats)), df = 1)
[1] 27.98246

For my summary stat files, the sumstats_1 contains about 100k rows (N=30k) and sumstats_2 contains about 400k rows (N=400k). I appreciate your help and thanks in advance!

Best, Yijun

Asukayj commented 1 year ago

Sorry! It seems that there is something wrong with the name space of my sumstats_2 and it works now.