Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c31a447
commit 554159c
Showing
2 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
--- | ||
title: "Finemapping experiments" | ||
output: rmarkdown::html_vignette | ||
vignette: > | ||
%\VignetteIndexEntry{Finemapping experiments} | ||
%\VignetteEngine{knitr::rmarkdown} | ||
%\VignetteEncoding{UTF-8} | ||
--- | ||
|
||
```{r, include = FALSE} | ||
knitr::opts_chunk$set( | ||
eval=FALSE, | ||
collapse = TRUE, | ||
comment = "#>" | ||
) | ||
library(gwasglue) | ||
``` | ||
|
||
Trying other methods e.g. PAINTOR and MsCAVIAR | ||
|
||
- Seem really slow | ||
- They give an overall posterior probability, not clear how to extract number of distinct causal variants | ||
|
||
|
||
```{r} | ||
library(tidyverse) | ||
library(ieugwasr) | ||
library(devtools) | ||
library(glue) | ||
load_all() | ||
args <- list() | ||
args$radius <- 50000 | ||
args$ids <- c("bbj-a-52", "ukb-b-20175") | ||
args$bfiles <- c("/Users/gh13047/data/ld_files/ldmat/EAS", "/Users/gh13047/data/ld_files/ldmat/EUR") | ||
args$plink <- "plink" | ||
args$pops <- NULL | ||
args$chr <- 4 | ||
args$position <- 54801228 | ||
regiondata <- do.call(organise_region, args=args) | ||
pres <- run_paintor(regiondata) | ||
dev.new() | ||
plot_PAINTOR(pres) | ||
n <- gwasinfo(args$ids)$sample_size | ||
cres <- run_MsCAVIAR(regiondata, n) | ||
plot_MsCAVIAR(cres) | ||
alpha=0.05 | ||
mt_method="fdr" | ||
ld_thresh=0.05 | ||
prune_bfile=NULL | ||
prune_pop="EUR" | ||
inst <- readRDS("~/repo/mr.trans/data/sbp_eas_eur.rds") | ||
args <- list() | ||
args$radius <- 100000 | ||
args$ids <- c("bbj-a-52", "ukb-b-20175") | ||
args$bfiles <- c("/Users/gh13047/data/ld_files/ldmat/EAS", "/Users/gh13047/data/ld_files/ldmat/EUR") | ||
args$plink <- "plink" | ||
args$pops <- NULL | ||
i <- 1 | ||
paintor_res <- list() | ||
for(i in 1:nrow(inst$inst)) | ||
{ | ||
args$chr <- inst$inst$chr.exposure[i] | ||
args$position <- as.numeric(inst$inst$pos.exposure[i]) | ||
regiondata <- do.call(extract_regional_data, args=args) | ||
paintor_res[[i]] <- run_PAINTOR(regiondata) | ||
} | ||
o <- run_susie(regiondata) | ||
plot_PAINTOR(paintor_res[[i]]) | ||
``` |