I am trying to perform
co-localization
analysis with the outputs from the qtl2. I have performed the scan1snp for QTLs and eQTL with the same DO mice samples. For each trait in the QTL, I want to use the `coloc.abf()`. However, this would require a combination of P-value and MAF.
I have used the following function to convert the LOD to p-values:
```R
convert_lod_to_p <- function(lod){
chi_square_stats <- 2 * log(10) * lod
p_values <- pchisq(chi_square_stats, df = 1, lower.tail = FALSE)
return(p_values)
}
```
However, I am not sure if this is a correct approach and how to get the MAF.
```R
# I am trying to create a function to achieve my goal
pheno_coloc <- function(pheno_name){
pheno_qtl <- qtl_snp_association %>% filter(phenotype == pheno_name)
eqtl_associations_filt <- snp_eqtl_associations %>% filter(
snp %in% pheno_qtl$snp
)
# convert the LOD scores to a p-value
pheno_bone_qtl$p_value <- convert_lod_to_p(pheno_bone_qtl$lod)
for(i in 6:ncol(eqtl_associations_filt)){
eqtl_associations_filt[,i] <- convert_lod_to_p(eqtl_associations_filt[,i])
}
# rest of the coloc code ....
}
```
Alternatively, beta and var beta can be used, but I am also not sure how to compute these.
Perhaps this is really naive, but I would really appreciate the help.