The main outer loop in ComputeAllCategoryNulls is across GO categories, with an inner loop computing the relevant statistic (e.g., a pairwise correlation) for matching genes. For genes annotated to multiple categories, this repeats an identical correlation computation multiple times. It would be much faster to compute the statistic for all genes first, and then agglomerate them into categories.
The main outer loop in
ComputeAllCategoryNulls
is across GO categories, with an inner loop computing the relevant statistic (e.g., a pairwise correlation) for matching genes. For genes annotated to multiple categories, this repeats an identical correlation computation multiple times. It would be much faster to compute the statistic for all genes first, and then agglomerate them into categories.