[adegenet-forum] pairwise.fst

takele taye takele_taye at yahoo.com
Thu Oct 4 22:02:09 CEST 2012


Dear
I get difficulties to estimate the significance level for pairwise.fst values. It is running on a PC for a month no output yet. Moreover, I  couldn't able to run a parallel computation as this does not allow to perform this. The input data is the one I used for STRUCTURE analysis. My script is
library (adegenet)
library(ade4)
ttt<- read.structure(file="oh.str", n.ind=94, n.loc=47486,  onerowperind=TRUE, col.lab=NULL, col.pop=1, ask=FALSE)x <- ttt[sample(1:nrow(ttt at tab), )] mat.obs <- pairwise.fst(x, res.type="matrix") NBPERM <- 1000 mat.perm <- lapply(1:NBPERM, function(i) pairwise.fst(x, pop=sample(pop(x)), res.type="matrix"))
meanmatobs= mean(c(mat.obs[1,2] < na.omit(sapply(1:NBPERM, function(i) mat.perm[[i]][1,2])), TRUE))

test12 <- as.randtest(na.omit(sapply(1:NBPERM, function(i) mat.perm[[i]][1,2])), mat.obs[1,2], alter="greater")test12Monte-Carlo testCall: as.randtest(sim = na.omit(sapply(1:NBPERM, function(i) mat.perm[[i]][1,     2])), obs = mat.obs[1, 2], alter = "greater")

allTests <- list() for(i in 1:(nrow(mat.obs)-1)){   for(j in 2:nrow(mat.obs)){   allTests[[paste(rownames(mat.obs)[i],rownames(mat.obs)[j],sep="-")]] <- as.randtest(na.omit(sapply(1:NBPERM, function(k) mat.perm[[k]][i,j])), mat.obs[i,j], alter="greater")   }}
Any help is appreciated
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20121004/a3984d00/attachment.html>


More information about the adegenet-forum mailing list