Fixed the huge variance issue, shown by the PlotSignatures() plots. At the end, the problem wasn't in adding the permutations into one common matrix. That indeed is handled well by the cpp libraries. The problem was sharing the phylostrata vector between threads (even though it was copies by value not reference).
It also improved the gamma fit very significantly, so at the end, I would suggest to use the gamma p-value.
Fixed the huge variance issue, shown by the
PlotSignatures()
plots. At the end, the problem wasn't in adding the permutations into one common matrix. That indeed is handled well by the cpp libraries. The problem was sharing the phylostrata vector between threads (even though it was copies by value not reference).It also improved the gamma fit very significantly, so at the end, I would suggest to use the gamma p-value.