14 months ago by
Walter and Eliza Hall Institute of Medical Research, Melbourne, Australia
The worm gives the obvious thing, which is the relative density of gene-set genes in a span about each position. If the height of the worm is 1.3, then the number of set genes around that point is 30% higher than if the coverage was uniform.
You can read complete details of the computation from the documentation. On the help("barcodeplot") page, there is a link near the bottom to help("tricubeMovingAverage") which is the function that does the detailed worm computations.
It is of course not the same as the Broad Institute's GSEA plot, because the GSEA plots correspond to GSEA's Kolmogorov-Smirnov test and don't make sense in any other context. We are not doing the Kolmogorov-Smirnov test, so it makes no sense to make the same plot. Instead we make a simpler and more intuitive plot (so it seems to me anyway) that makes sense in a more general context.
I am not sure why you are changing the span to 0.05. That is much too small a value to be of practical use.
There is no reason why the peak, if there is a peak, should be in the colored region of the bar. The colored region doesn't have anything to do with the camera test.
There isn't really any enrichment score value other than the peak relative density shown on the plot. The plot function doesn't return this value as a formal function value. If you want a formal score, it is better to use the camera test, and then the p-value itself is the enrichment score.