# Intuitive explanation of GSVA analysis

I'm trying to understand the way the GSVA analysis is working behind the scenes.And I was wondering if there is any way to understand it more intuitively the whole process.

So at first according to paper it starts by evaluating whether a gene i is highly or lowly expressed in sample j in the context of the sample population distribution. They use these kernel estimations of the cumulative density functions to transform the initial values so not to be affected by the problematic intensities.

After this "transformation" and a following normalization, GSVA calculates the enrichment scores using the Kolmogorov-Smirnov (KS) like random walk statistic.

As I know, Kolmogorov-Smirnov checks for differences in distributions. Which distributions does it check? Gene-set's against all the others genes? And what is the role of the random walk?

So is there any intuitive way to understand this kind of Kolmogorov-Smirnov (KS) like random walk statistic? How does it actually work? Which one is the null and which the alternative hypothesis in that case?

The most intuitive explanation is also explained in the background section:

Conceptually, this methodology can be understood as a change in coordinate systems for gene expression data, from genes to gene sets.

Which I think it is explained in Figure 1 of the paper, which is also one of the most informative I found about the methods of an algorithm1. I'll will use it to explain what's going on.

1. Fit a distribution function per gene

For each gene expression profile ... a non-parametric kernel estimation ... function is performed.

I can't give more detail because I haven't understood it fully

1. Then they are normalized to make the ranks symmetric around zero

It is an inline formula between equations 2 and 3.

2. The Kolmogorov-Smirnov like random walk statistic is applied to those kernel estimations normalized distributions.

Which two distributions does it compare? The genes in a gene set and all the others (but I'm not totally sure)

The role of random walk is explained a bit later from your quote:

[the random walk] produces a distribution over the genes to assess if the genes in the gene set are more likely to be found at either tail of the rank distribution

Which is later used to calculate the enrichment score by looking the maximum deviation from zero, or by summing the largest and the lowest deviations.