# Statistical test for determining hot spot in a heat map

I'm analyzing high through proteomic data and have several thousand 5x5 matrices, where in each matrix the rows and columns refer to different biological conditions, and each cell refers to gene expression in that pair of biological conditions.

I expect there to be three kinds of proteins in this dataset:

In most cases I expect there to be no large variation, but random fluctuations between cells:

  0  0 -1 -2  1
2  1  0 -1 -1
0  0  1  2  0
1 -2  1  3  0
-3  1  2  0  0


In a few cases, some of the samples might be contaminated, and there might be some extreme outliers, e.g. in a case where (2,2) and (3,4) are outliers:

  1  0  0 -2  1
0 84  1 -1 -1
-1  0  0  2  0
0  1  99 3  0
1 -3  2  0  0


However, the cases that I'm interested in, are those in which protein expression changes towards a certain optimal pair of biological conditions, e.g. where proteins change expression reaching an optimal point at the (3,4) cell:

  0  0  5 12  8
1  5 20 36 21
0 10 31 52 40
1 -2 17 23 30
-3  1 12  5  8


Is there a statistical test to identify the optimal cell in the above example, that is also robust to handling outliers and random fluctuation as in the first two cases?

Local measures of spatial association will be able to differentiate between points which are a local peak with ascending values nearby (like your point $$(3,4)$$ in your last matrix) versus points that have an "outlying" value on their own (like your points $$(2,2)$$ and $$(4,3)$$ in your second matrix). I would suggest you start by choosing an appropriate measure of local spatial association for your matrix data, and then compute this for those matrices to see how it differentiates these kinds of points. In constructing your measure, you will need to decide on what constitutes a "close" point (e.g., are diagonals considered the same distance as adjacent squares) and this will affect your chosen spatial measure. Nevertheless, any reasonable measure of this kind should be able to differentiate the two cases of concern to you.