chr1swallace / coloc

Repo for the R package coloc
138 stars 44 forks source link

coloc.abf and check_dataset returen "missing value where TRUE/FALSE needed" #159

Open huntPis opened 3 months ago

huntPis commented 3 months ago

hello, I am a beginner of coloc user, I got error when runing check_dataset and coloc.abf, my input list dose not have any NA, here is my code ##########################

check input

anyNA(list1) [1] FALSE anyNA(list2) [1] FALSE str(list1)

str(list1) List of 8 $ position: num [1:114593] 79797290 79788248 79896888 79552681 79552543 ... $ pvalues : num [1:114593] 0.75524 0.671048 0.000152 0.937623 0.937038 ... $ type : chr "quant" $ N : num [1:114593] 35892 35892 35892 35892 35892 ... $ MAF : num [1:114593] 0.0132 0.0132 0.0177 0.3483 0.3138 ... $ snp : chr [1:114593] "rs74532386" "rs145328330" "rs200058464" "rs445605" ... $ beta : num [1:114593] 0.011 0.0151 0.1183 -0.0006 0.0006 ... $ varbeta : num [1:114593] 1.21e-04 2.28e-04 1.40e-02 3.60e-07 3.60e-07 ...

str(list2) List of 8 $ position: num [1:114593] 80089632 80080590 80189230 77312681 77312543 ... $ pvalues : num [1:114593] 5.19e-06 8.95e-06 4.68e-05 7.06e-05 8.60e-05 ... $ type : chr "cc" $ N : num [1:114593] 6165 6165 6165 6165 6165 ... $ MAF : num [1:114593] 0.0218 0.0214 0.0222 0.3759 0.3433 ... $ snp : chr [1:114593] "rs74532386" "rs145328330" "rs200058464" "rs445605" ... $ beta : num [1:114593] -0.857 0.838 0.736 0.209 -0.206 ... $ varbeta : num [1:114593] 0.7343 0.7014 0.5423 0.0437 0.0423 ...

run coloc

check_dataset(list2,warn.minp=1e-10) res0 <- coloc.abf(dataset1=list1, dataset2=list2, p1 = 1e-04, p2 = 1e-04, p12 = 1e-05) ########################## I got same error " Error in if (min(p) > warn.minp) warning("minimum p value is: ", format.pval(min(p)), : missing value where TRUE/FALSE needed"

Thank you for your assistance.

pottj commented 2 months ago

Hello, I ran into the same problem (two continuous traits, no NAs, but the same error message), and I fixed it by checking and filtering all SNPs with beta == 0 in my first trait (2 SNPs). I guess when approximating the sdY from beta, varbeta, N, and MAF, beta must not be 0? Maybe this helps in your case as well?