Test whether count of events is significantly greater in a feature list than the general feature population I begin with a matrix of features (~30000 rows) vs cases (columns). I have binary - TRUE or FALSE - data in each cell indicating whether there is an event spanning the feature for that case. Next, I sum each row to get the total number of cases from the sample set that have an event for each feature. I will call this c for each feature. Next, I retrieve a list of features.  How can I test whether c (the total number of cases with an event for a given feature) is significantly greater than c among the feature population in general? Furthermore, is there some way of calculating some uncertainty measure of my result based on the fact that only known features associated with a particular process are in the list.
NB. My attempt (probably wrong and overly complicated):


*

*Bootstrap with replacement 100000 times to get 100000 samples each of size 1023 from the 30000 features. The 1023 features (for example) are excluded from the population from which the features for each sample are drawn.

*Use var.test across c for each sample vs the 1023 feature list. If the test does not produce a significant value, that sample can be used in step 3. Samples that produce a significant value are discarded. This is done to satisfy the assumption of the Wilcoxon test that the variances between the two test samples are similar.

*Do a Kolmogorov–Smirnov test (ks.test) for each sample brought forward vs the 1023 feature list. If the test does not produce a significant value, that sample can be used in step 4. Samples that produce a significant value are discarded. This is done to satisfy the assumption of the Wilcoxon test that the distributions between the two test samples are similar.

*Do a Wilcoxon test (wilcox.test) for each sample brought forward vs the 1023 feature list. If the mean (or median?) p-value for these tests is significant, I can say that c is significantly greater for this set of features than it is for features that do not belong to this set.

 A: Your idea of prescreening samples to fit the assumptions of the Wilcoxon test, while throwing away anything that does not fit is very wrong, with every step messing up the inference in an additional way. And it is also unnecessarily complicated. The goal of looking at randomly selected gene sets is to figure out how c would look like for a typical set of genes that has nothing to do with copy number aberrations. It would be much simpler if you could define a summary function of the 1023 c values that would capture what you are interested in. Perhaps the mean, or the median, etc. I'll assume that the median c value would be meaningful.


*

*Generate $B$ random gene sets of size 1023.

*For each of the sets compute the median c value, denoted $mc_i, i=1,\ldots,B$

*Compute the median c value for the actual list of interest, $mc_0$

*The p-value would be the proportion of the $mc_i$ values that exceed $mc_0$: $$p=\frac{\# (mc_i \geq mc_0)+1}{B+1}$$ (the "$+1$" terms are often used to avoid 0 p-values, but are not really important).


But you have to be careful with the interpretation of the results. If the test is significant, it does mean that the selected gene set has higher median c value than a random gene set, but it might be due to a variety of reasons. For example, if the stability genes are more likely to be on chromosomes with more CNA's, or if they are more likely to be located close to each other (assuming CNA's cover many neighboring genes simultaneously), etc. You could address some of these alternative explanations by being careful in step 1 above. For example, you could select random gene sets that have the same distribution over the chromosomes as the stability set, or you could impose some restrictions on the spacing of the genes, etc.
