Correlation Test for Non-Mutually-Exclusive Categorical Data I have a table of 288 rows and 4 columns where each row corresponds to a tumour sample, and each column is a gene. All of the values are 0 or 1, to indicate whether there's a mutation in a particular gene for a particular sample, but obviously each sample can have more than one mutation.
I want to test for correlations between pairs of columns, to see if mutations in certain genes are likely to appear in the same sample or if they're likely to not appear in the same sample (the null hypothesis being that they're occur independently). Normally for categorical data I'd use Fisher's exact test, but it seems like all the examples I see use mutually exclusive variables, which is not the case for my dataset.
What would be the most relevant test for this kind of dataset?
 A: Consider first two specific columns, say $A$ and $B$. It is not difficult to calculate the probability directly, without resorting to a generic test.
Say the number of instances is $N$ (your 288), column $A$ has $n$ positives, and $B$ has $K$ positives. Now suppose that the null hypothesis is true, i.e., that $A$ being positive has no bearing on $B$ being positive. Then the number of positives in $B$ in instances corresponding to the positives in $A$ is exactly distributed hypergeometrically, that is, the probability that in the $n$ positives of $A$ you'll see $k$ positives in $B$, is exactly
$$
P(k) = {{K \choose k} {N - K \choose n - k} \over {N \choose n}}
.
$$
Under the null hypothesis, the probability that you would get the result you got or higher, that is, at least $k$, is 
$$\sum_{k' = k}^K P(k').
$$
You should reject the null hypothesis if this probability is smaller than something commonly used (e.g., 0.05, or 0.01). 

In your problem, you don't have $A$ and $B$ pre-determined, but rather must consider all the possibilities. For all possibilities of $A$ and $B$, you might consider doing a Bonferroni correction of the above (i.e., choose a p-value that is divided by the number of possible pairs as the rejection level).
