Performing co-localization with the QTL2 scan1snp() outputs

33 views
Skip to first unread message

Saikat Bandyopadhyay

unread,
Feb 27, 2024, 7:00:57 PMFeb 27
to R/qtl2 discussion
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.

Karl Broman

unread,
Feb 29, 2024, 11:41:34 AMFeb 29
to R/qtl2 discussion
To calculate MAF, you could either use the allele frequencies in the founder lines, or use the allele frequencies in the DO population.

And I think how to do that depends on whether you're using the genotyped SNPs present in the cross data, or if you expanding analysis to a database of founder SNPs, such as cc_variants.sqlite

To calculate allele frequencies in the DO population, you could use the function calc_geno_freq() with the allele dosages obtained with genoprob_to_alleleprob(). And you'd first need to use genoprob_to_snpprob() to get the genotype probabilities for SNPs. If you're using the larger database of SNPs, you'd need to add in queries with a function created using create_variant_query_func().

To calculate allele frequencies in the founders, you can use calc_raw_founder_maf() to get MAF for the SNPs in the cross data. To get allele frequencies for the broader SNPs in a database, you'd need to do repeated queries to grab the founder genotypes at all the SNPs, and then calculate MAF directly from those genotypes.

karl
Reply all
Reply to author
Forward
0 new messages