I have two lists of genes as follows:
DEList
has 282 gene namesAllList
has 32805 gene namesDEList
is a subset ofAllList
.
In both lists I've looked for genes which have a specific parameter (e.g. binding site for pol3 and binding site for pol2). The results of this search is in the table below.
pol3DE
4pol2DE
190pol3all
85pol2all
12365
pol3DE
and pol2DE
are both subsets of the list DEList
with the specific parameter binding site for pol3
and binding site for pol2
respectively. pol3all
and pol2all
are both subsets of the list AllList
with the same specific parameters as above.
I would like to calculate the p-value to see if a higher proportion of pol2-specific genes are in the DEList
than the AllList
, and likewise for the pol3-specific genes in DEList
relative to AllList
.
If I understand it correctly I have six different parameters:
AllList
- 32805DEList
- 282pol3DE
- 4pol2DE
- 190pol3all
- 85pol2all
- 12365
How do I create the contingency table for the Fisher's exact test in this case?
Can I even use the Fisher's exact test for that, or do I need to use a different one (Xi square, equality of proportion)?
EDIT:
What I would like to know is not the significance of each group on its own, but whether or not the proportion of of pol2 in the comparison DEList relative to AllList is higher than the proportion of pol3 for the same comparison. So Just making two McNemar tests wouldn't really solve the problem, unless I can compare the two p-values. I have run the two tests and both p-values are very low, i.e. supposedly significant, but what about against each other. Is there a way to compare this?
pol3 = as.table(rbind(c(32720, 0),
c( 81, 4) ))
colnames(pol3) <- rownames(pol3) <- c("No", "Yes")
names(dimnames(pol3)) = c("all", "DE")
pol3
mcnemar.test(pol3, correct=FALSE)
McNemar's Chi-squared test
data: pol3
McNemar's chi-squared = 81, df = 1, p-value < 2.2e-16
pol2 = as.table(rbind(c(32720, 0),
c( 81, 4) ))
colnames(pol2) <- rownames(pol2) <- c("No", "Yes")
names(dimnames(pol2)) = c("all", "DE")
pol2
mcnemar.test(pol2, correct=FALSE)
McNemar's Chi-squared test
data: pol2
McNemar's chi-squared = 81, df = 1, p-value < 2.2e-16