hypeR icon indicating copy to clipboard operation
hypeR copied to clipboard

rctbl_build does not work with method="ks"

Open tetomonti opened this issue 2 years ago • 1 comments

rctbl_build doesn't work at present when running ks test. It would be ideal to fix it and have it report, instead of the 'hits' (not relevant), the features in the "leading edge" (i.e., the features up to the max score)

tetomonti avatar Apr 06 '22 16:04 tetomonti

Anthony, I created a 'dev' branch and edited the ks_enrichment.R file to add "leading edge" functionalities. In particular,

  • the .ks_test function now returns two extra parameters: leading_edge and leading_hits, with the latter a vector of positions of the hits ≤ the leading edge.
  • the ks plot now includes a red dashed vertical line at the leading_edge x-coordinate.
  • in the .ks_enrichment function, the data table has been modified: the column 'hits' now reports the list of "genes" in the leading_hits; and the column overlap now reports the number of genes in the leading edge (instead of the size of the entire set as before). Also, the function returns an extra argument, leading_hits, a character vector of the genes in the leading edge. Right now, this is ignored by the calling function (hypeR), but perhaps worth "propagating" it up, should the user need to access that info.

I have done some perfunctory testing of those functions, and they seem to work fine. Up to you if/when to merge them to the main branch.

tetomonti avatar Apr 09 '22 16:04 tetomonti