mirror of
https://github.com/johrpan/geposan.git
synced 2025-10-26 02:37: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,
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ methods that are contained within this list will be included.}
|
|||
}
|
||||
\value{
|
||||
A ranking object. The object extends the analysis result with
|
||||
additional columns containing the \code{score} and the \code{rank} of each gene. It
|
||||
will be ordered by rank.
|
||||
additional columns containing the \code{score}, the \code{rank} and the \code{percentile}
|
||||
for each gene. It will be ordered by rank.
|
||||
}
|
||||
\description{
|
||||
This function takes the result of \code{\link[=analyze]{analyze()}} and creates a score by
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue