a <- scan("autosome_dnds.txt");head(a)
xh <- scan("high_dnds_region.txt");head(xh)
xo <- scan("X_other_region.txt");head(xo)

x <- xh
y <- xo

# bootstrap:
# sample from H0 separately, no assumption about equal variance
xt <- x - mean(x) + mean(c(x,y))
yt <- y - mean(y) + mean(c(x,y))
boot.t <- c(1:1000)
for (i in 1:1000){
  sample.x <- sample(xt,replace=TRUE)
  sample.y <- sample(yt,replace=TRUE)
  boot.t[i] <- t.test(sample.x,sample.y)$statistic
}
p.h0 <- (1 + sum(abs(boot.t) >= abs(t.test(x,y)$statistic))) / (1000+1) 
p.h0
