I can't wrap my head around those negative NES scores one should be able to calculate negative NES. But how is this possible?
It is really straight forward to calculate the ES for a given gene set which can, of course be negative depending on the position of the genes in our ranked list. However, in the 2005 PNAS paper (as well as other various sources on the web) it says that the NES for a given set S is calculated as follows:
NES(S) = ES(S) / [avg(ES(S,pi)] with the same sign as ES(S) where ES(S,pi) is the ES of the very same set S through n permutation. The thing is, if I am dividing by things of the same sign I always end up with positive NES, so how is it possible to get negative NES values??
[this is a direct quote from the 2005 PNAS paper Subramanian et al.:
Adjust for variation in gene set size. Normalize the ES(S, π) and the observed ES(S), separately rescaling the positive and negative scores by dividing by the mean of the ES(S, π) to yield the normalized scores NES(S, π) and NES(S) (see Supporting Text).
Thanks, any help is highly appreciated.