chr1swallace/coloc

Error when running COLOC

smsinks opened this issue · 2 comments

Could you please help with the following error message.

I am attempting to execute COLOC on two GWAS summary statistics. However, when I try to run COLOC using the code provided below, an error is produced and displayed as follows:

> coloc_results <- coloc.abf(trait_eur_common,trait_afr_common, p1 = 1e-4, p2 = 1e-4)
Error in if (!(d$type %in% c("quant", "cc"))) stop("dataset ", suffix,  : 
  the condition has length > 1

Below are the headers of the two data frames for the GWAS summary statistics:

head(trait_eur_common)
                         SNP      beta   varbeta         p    freq  type
2  10:100090169_CTGCAGAAGA_C -2.622807 0.9998531 8.711e-03 0.21322 quant
25        10:101375113_CAA_C -3.900371 1.0001900 9.634e-05 0.86621 quant
30          10:10153657_TA_T  3.840330 1.0001721 1.232e-04 0.31934 quant
32         10:101662858_AT_A -5.319106 1.0000399 1.044e-07 0.45663 quant
39         10:101872090_GT_G -3.459913 0.9999495 5.400e-04 0.50672 quant
45        10:102617719_ACT_A  0.000000 0.0000000 1.745e-22 0.10627 quant

> head(trait_afr_common)
                         SNP      beta   varbeta        p     freq  type
2  10:100090169_CTGCAGAAGA_C -2.903418 1.0002879 0.003701 0.032139 quant
25        10:101375113_CAA_C -2.613851 0.9998860 0.008945 0.757490 quant
30          10:10153657_TA_T -2.857322 1.0002255 0.004281 0.363300 quant
32         10:101662858_AT_A  2.597431 1.0003320 0.009416 0.577550 quant
39         10:101872090_GT_G  2.616783 0.9998343 0.008865 0.333510 quant
45        10:102617719_ACT_A  2.831188 1.0001328 0.004643 0.204350 quant

A more informative error is thrown by the current version of coloc:

Error in check_dataset(d = dataset1, 1) : 
  dataset 1: missing required element(s) snp

The error highlights the issue: the "SNP" column needs to be renamed to "snp".