Skip to content

Instantly share code, notes, and snippets.

View chr1swallace's full-sized avatar

Chris Wallace chr1swallace

View GitHub Profile
## sharing parameter, largish, so we expect to see a big enough difference to check if working
S <- 100
prior.bin.fn <- function(nT1,s=100,mT1=3) {
dbinom(nT1,size=s,prob=mT1/s)/choose(s,nT1)
}
bothpp <- function(data) {
ss1 <- strsplit(data$t1.str,"%")
ss2 <- strsplit(data$t2.str,"%")
data$overlap <- sapply(1:nrow(data), function(i)
library(data.table)
library(parallel)
library(annotSnpStats)
library(snpStats)
library(GUESSFM)
##
inv.logit.fn <-function(x) return(exp(x)/(1+exp(x)))
##
## I don't know how much R you know already. Start at the beginning,
## use online R tutorials, the native help system, and books, and work
## through the steps below. I've tried to write enough that if you
## already know R you won't be bored, so if you don't already know R,
## please don't assume you *have* to complete these tasks!
## install packages - only need to do this first time
install.packages("devtools")
library(devtools)
install_github("chr1swallace/coloc") # has the finemap.abf function