mirror of
https://github.com/johrpan/geposan.git
synced 2025-10-26 10:47:25 +01:00
ranking: Compute percentiles
This commit is contained in:
parent
48ff555e88
commit
a0dce372b6
2 changed files with 5 additions and 4 deletions
|
|
@ -8,8 +8,8 @@
|
|||
#' methods that are contained within this list will be included.
|
||||
#'
|
||||
#' @returns A ranking object. The object extends the analysis result with
|
||||
#' additional columns containing the `score` and the `rank` of each gene. It
|
||||
#' will be ordered by rank.
|
||||
#' additional columns containing the `score`, the `rank` and the `percentile`
|
||||
#' for each gene. It will be ordered by rank.
|
||||
#'
|
||||
#' @export
|
||||
ranking <- function(analysis, weights) {
|
||||
|
|
@ -36,6 +36,7 @@ ranking <- function(analysis, weights) {
|
|||
|
||||
setorder(ranking, -score)
|
||||
ranking[, rank := .I]
|
||||
ranking[, percentile := 1 - rank / nrow(ranking)]
|
||||
|
||||
structure(
|
||||
ranking,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue