hi there, I have a list of genes, and i want to check if this group is enriched with TF (or maybe i should say TFs that bind to these genes) compared to all human genes.
any idea how i do it? i checked enrichr but seems like it doesn't answer my question... Thanks
2 answers
Do some counting:
- Count the number of TF binding sites in genes-of-interest (or their promoters, etc.).
- Count the number of genes-of-interest.
- Count the number of TF binding sites in all genes (or, again, their promoters, etc.).
- Count the number of total genes.
Look up the hypergeometric test in R via ?phyper.
The phyper() function takes at least four arguments:
q: The number of white balls drawn without replacement from an urn which contains both black and white balls.m: The number of white balls in the urn.n: The number of black balls in the urn.k: The number of balls drawn from the urn.
In this case, q is the number of TF binding sites in the genes-of-interest. The m is the number of TF binding sites in all genes. The n is the number of TF binding sites in genes that are not TF binding sites in genes-of-interest (subtract the count of sites in genes-of-interest from the count of sites in genes). The k is the count of genes-of-interest.
The resulting p-value should indicate the likelihood of observing q or fewer TF sites in genes-of-interest by chance, relative to TF sites over all genes. If that value is less than a pre-decided threshold (say 0.01) then you could argue this suggests enrichment for those particular TF sites.
Log in to answer this question.