This is a tricky question, because how to define relationship between two genes quite be complicated. To my understanding, bioinformoicans tend to use something like hierarchical clustering, heat-map for comparing genes.
The simplest approach is just take the whole gene expression matrix and apply it to R's
cor function. According to:
you may want to use the
qpPCC function. Please note:
- All it does is to feed all your samples into the algorithm. The function ignores your sample labels.
- You get a measure of linear correlation between two pairs of genes. But the function doesn't actually know what you mean by "expressing". It doesn't know what pattern you're talking about, all it does is just compare linear correlation between the two genes.