ranking: Use S3 classes and rename optimize method

This commit is contained in:
Elias Projahn 2021-11-05 14:47:33 +01:00
parent 4792bbaefd
commit 4992bb2930
5 changed files with 55 additions and 31 deletions

View file

@ -14,9 +14,10 @@ function should accept a number between 0.0 and 1.0 for the current
progress.}
}
\value{
A \link{data.table} with one row for each gene identified by it's ID
(\code{gene} column). The additional columns contain the resulting scores per
method and are named after the method IDs.
An object containing the results of the analysis. It contains a
\link{data.table} with one row for each gene identified by it's ID (\code{gene}
column). The additional columns contain the resulting scores per method
and are named after the method IDs.
}
\description{
Analyze by applying the specified preset.

View file

@ -1,13 +1,13 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ranking.R
\name{optimize_weights}
\alias{optimize_weights}
\name{optimal_weights}
\alias{optimal_weights}
\title{Find the best weights to rank the results.}
\usage{
optimize_weights(results, methods, reference_gene_ids, target = "mean")
optimal_weights(analysis, methods, reference_gene_ids, target = "mean")
}
\arguments{
\item{results}{Results from \code{\link[=analyze]{analyze()}} or \code{\link[=ranking]{ranking()}}.}
\item{analysis}{Results from \code{\link[=analyze]{analyze()}} or \code{\link[=ranking]{ranking()}}.}
\item{methods}{Methods to include in the score.}
@ -17,7 +17,8 @@ optimize_weights(results, methods, reference_gene_ids, target = "mean")
"max" and results in the respective rank being optimized.}
}
\value{
Named list pairing method names with their optimal weights.
Named list pairing method names with their optimal weights. This
can be used as an argument to \code{\link[=ranking]{ranking()}}.
}
\description{
This function finds the optimal parameters to \code{\link[=ranking]{ranking()}} that result in the

View file

@ -4,14 +4,20 @@
\alias{ranking}
\title{Rank the results by computing a score.}
\usage{
ranking(results, weights)
ranking(analysis, weights)
}
\arguments{
\item{results}{Results from \code{\link[=analyze]{analyze()}}.}
\item{analysis}{Analysis object resulting from \code{\link[=analyze]{analyze()}}.}
\item{weights}{Named list pairing method names with weighting factors.}
\item{weights}{Named list pairing method names with weighting factors. Only
methods that are contained within this list will be included.}
}
\value{
A ranking object. The object extends the analysis with additional
columns containing the \code{score} and the \code{rank} of each gene. It will be
ordered by rank.
}
\description{
This function takes the result from \code{\link[=analyze]{analyze()}} and creates a score by
This function takes the result of \code{\link[=analyze]{analyze()}} and creates a score by
computing a weighted mean across the different methods' results.
}