Ahmed Abdalla, re#96, one of the helpful packages for running many models across 1000s of 'omics features is the parallel package. For example, running mixed models across 5000+ proteins we can use code like below. While StataMP is a multiprocessor version of Stata, I think parallel capabilities making manual use of our cores when needed could be part of official Stata as well.
Code:
program define parfor
levelsof gene, local(mygenes)
global mygenes = r(levels) // a global macro is required
foreach i of global mygenes {
// mixed model here for protein differential expression
xsvmat, from(r(table)') rowname(parm) names(col) idstr("`i'") ///
saving(.\parallel\gene_`i', replace)
}
end
parallel initialize 8 // request 8 of 14 available cores
parallel, prog(parfor) by(gene): parfor // by(gene) stops splitting a gene between cores
// code to combine results files here

Comment