mirror of
https://github.com/johrpan/geposan.git
synced 2025-10-26 02:37:25 +01:00
Allow customizing method metadata
This commit is contained in:
parent
0e4f4621ed
commit
c6ca93b009
12 changed files with 139 additions and 30 deletions
|
|
@ -28,6 +28,9 @@ densest <- function(data) {
|
||||||
#' combined. The resulting value is compared to the reference genes and
|
#' combined. The resulting value is compared to the reference genes and
|
||||||
#' determines the gene's score in relation to other genes.
|
#' determines the gene's score in relation to other genes.
|
||||||
#'
|
#'
|
||||||
|
#' @param id Unique ID for the method and its results.
|
||||||
|
#' @param name Human readable name for the method.
|
||||||
|
#' @param description Method description.
|
||||||
#' @param distance_estimate A function that will be used to summarize the
|
#' @param distance_estimate A function that will be used to summarize the
|
||||||
#' distance values for each gene. See [densest()] for the default
|
#' distance values for each gene. See [densest()] for the default
|
||||||
#' implementation.
|
#' implementation.
|
||||||
|
|
@ -39,11 +42,15 @@ densest <- function(data) {
|
||||||
#' @seealso [species_adjacency()]
|
#' @seealso [species_adjacency()]
|
||||||
#'
|
#'
|
||||||
#' @export
|
#' @export
|
||||||
adjacency <- function(distance_estimate = densest, summarize = stats::median) {
|
adjacency <- function(id = "adjacency",
|
||||||
method(
|
|
||||||
id = "adjacency",
|
|
||||||
name = "Adjacency",
|
name = "Adjacency",
|
||||||
description = "Adjacency to reference genes",
|
description = "Adjacency to reference genes",
|
||||||
|
distance_estimate = densest,
|
||||||
|
summarize = stats::median) {
|
||||||
|
method(
|
||||||
|
id = id,
|
||||||
|
name = name,
|
||||||
|
description = description,
|
||||||
function(preset, progress) {
|
function(preset, progress) {
|
||||||
species_ids <- preset$species_ids
|
species_ids <- preset$species_ids
|
||||||
gene_ids <- preset$gene_ids
|
gene_ids <- preset$gene_ids
|
||||||
|
|
|
||||||
|
|
@ -70,16 +70,22 @@ clusteriness <- function(data,
|
||||||
#' The result will be cached and can be reused for different presets, because
|
#' The result will be cached and can be reused for different presets, because
|
||||||
#' it is independent of the reference genes in use.
|
#' it is independent of the reference genes in use.
|
||||||
#'
|
#'
|
||||||
|
#' @param id Unique ID for the method and its results.
|
||||||
|
#' @param name Human readable name for the method.
|
||||||
|
#' @param description Method description.
|
||||||
|
#'
|
||||||
#' @return An object of class `geposan_method`.
|
#' @return An object of class `geposan_method`.
|
||||||
#'
|
#'
|
||||||
#' @seealso [clusteriness()]
|
#' @seealso [clusteriness()]
|
||||||
#'
|
#'
|
||||||
#' @export
|
#' @export
|
||||||
clustering <- function() {
|
clustering <- function(id = "clustering",
|
||||||
method(
|
|
||||||
id = "clustering",
|
|
||||||
name = "Clustering",
|
name = "Clustering",
|
||||||
description = "Clustering of genes",
|
description = "Clustering of genes") {
|
||||||
|
method(
|
||||||
|
id = id,
|
||||||
|
name = name,
|
||||||
|
description = description,
|
||||||
function(preset, progress) {
|
function(preset, progress) {
|
||||||
species_ids <- preset$species_ids
|
species_ids <- preset$species_ids
|
||||||
gene_ids <- preset$gene_ids
|
gene_ids <- preset$gene_ids
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
#' Score genes based on their correlation with the reference genes.
|
#' Score genes based on their correlation with the reference genes.
|
||||||
#'
|
#'
|
||||||
|
#' @param id Unique ID for the method and its results.
|
||||||
|
#' @param name Human readable name for the method.
|
||||||
|
#' @param description Method description.
|
||||||
#' @param summarize A function for combining the different correlation
|
#' @param summarize A function for combining the different correlation
|
||||||
#' coefficients into one metric. By default, [stats::median()] is used. Other
|
#' coefficients into one metric. By default, [stats::median()] is used. Other
|
||||||
#' suggested options include [max()] and [mean()].
|
#' suggested options include [max()] and [mean()].
|
||||||
|
|
@ -7,11 +10,14 @@
|
||||||
#' @return An object of class `geposan_method`.
|
#' @return An object of class `geposan_method`.
|
||||||
#'
|
#'
|
||||||
#' @export
|
#' @export
|
||||||
correlation <- function(summarize = stats::median) {
|
correlation <- function(id = "correlation",
|
||||||
method(
|
|
||||||
id = "correlation",
|
|
||||||
name = "Correlation",
|
name = "Correlation",
|
||||||
description = "Correlation with reference genes",
|
description = "Correlation with reference genes",
|
||||||
|
summarize = stats::median) {
|
||||||
|
method(
|
||||||
|
id = id,
|
||||||
|
name = name,
|
||||||
|
description = description,
|
||||||
function(preset, progress) {
|
function(preset, progress) {
|
||||||
species_ids <- preset$species_ids
|
species_ids <- preset$species_ids
|
||||||
gene_ids <- preset$gene_ids
|
gene_ids <- preset$gene_ids
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
#' Find genes by training and applying a neural network.
|
#' Find genes by training and applying a neural network.
|
||||||
#'
|
#'
|
||||||
|
#' @param id Unique ID for the method and its results.
|
||||||
|
#' @param name Human readable name for the method.
|
||||||
|
#' @param description Method description.
|
||||||
#' @param seed The seed will be used to make the results reproducible.
|
#' @param seed The seed will be used to make the results reproducible.
|
||||||
#' @param n_models This number specifies how many sets of training data should
|
#' @param n_models This number specifies how many sets of training data should
|
||||||
#' be created. For each set, there will be a model trained on the remaining
|
#' be created. For each set, there will be a model trained on the remaining
|
||||||
|
|
@ -14,11 +17,16 @@
|
||||||
#' @return An object of class `geposan_method`.
|
#' @return An object of class `geposan_method`.
|
||||||
#'
|
#'
|
||||||
#' @export
|
#' @export
|
||||||
neural <- function(seed = 180199, n_models = 5, control_ratio = 0.5) {
|
neural <- function(id = "neural",
|
||||||
method(
|
|
||||||
id = "neural",
|
|
||||||
name = "Neural",
|
name = "Neural",
|
||||||
description = "Assessment by neural network",
|
description = "Assessment by neural network",
|
||||||
|
seed = 180199,
|
||||||
|
n_models = 5,
|
||||||
|
control_ratio = 0.5) {
|
||||||
|
method(
|
||||||
|
id = id,
|
||||||
|
name = name,
|
||||||
|
description = description,
|
||||||
function(preset, progress) {
|
function(preset, progress) {
|
||||||
species_ids <- preset$species_ids
|
species_ids <- preset$species_ids
|
||||||
gene_ids <- preset$gene_ids
|
gene_ids <- preset$gene_ids
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,9 @@
|
||||||
#' A score will be given to each gene such that 0.0 corresponds to the maximal
|
#' A score will be given to each gene such that 0.0 corresponds to the maximal
|
||||||
#' distance across all genes and 1.0 corresponds to a distance of 0.
|
#' distance across all genes and 1.0 corresponds to a distance of 0.
|
||||||
#'
|
#'
|
||||||
|
#' @param id Unique ID for the method and its results.
|
||||||
|
#' @param name Human readable name for the method.
|
||||||
|
#' @param description Method description.
|
||||||
#' @param summarize A function for combining the different proximities into one
|
#' @param summarize A function for combining the different proximities into one
|
||||||
#' metric. By default, [stats::median()] is used. Other suggested options
|
#' metric. By default, [stats::median()] is used. Other suggested options
|
||||||
#' include [min()] and [mean()].
|
#' include [min()] and [mean()].
|
||||||
|
|
@ -10,11 +13,14 @@
|
||||||
#' @return An object of class `geposan_method`.
|
#' @return An object of class `geposan_method`.
|
||||||
#'
|
#'
|
||||||
#' @export
|
#' @export
|
||||||
proximity <- function(summarize = stats::median) {
|
proximity <- function(id = "proximity",
|
||||||
method(
|
|
||||||
id = "proximity",
|
|
||||||
name = "Proximity",
|
name = "Proximity",
|
||||||
description = "Proximity to telomeres",
|
description = "Proximity to telomeres",
|
||||||
|
summarize = stats::median) {
|
||||||
|
method(
|
||||||
|
id = id,
|
||||||
|
name = name,
|
||||||
|
description = description,
|
||||||
function(preset, progress) {
|
function(preset, progress) {
|
||||||
species_ids <- preset$species_ids
|
species_ids <- preset$species_ids
|
||||||
gene_ids <- preset$gene_ids
|
gene_ids <- preset$gene_ids
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,9 @@
|
||||||
#' to the reference genes within that species. Afterwards, the results are
|
#' to the reference genes within that species. Afterwards, the results are
|
||||||
#' summarized across species and determine the gene's score.
|
#' summarized across species and determine the gene's score.
|
||||||
#'
|
#'
|
||||||
|
#' @param id Unique ID for the method and its results.
|
||||||
|
#' @param name Human readable name for the method.
|
||||||
|
#' @param description Method description.
|
||||||
#' @param distance_estimate Function for combining the distance differences
|
#' @param distance_estimate Function for combining the distance differences
|
||||||
#' within one species.
|
#' within one species.
|
||||||
#' @param summarize Function for summarizing the distance values across species.
|
#' @param summarize Function for summarizing the distance values across species.
|
||||||
|
|
@ -13,12 +16,15 @@
|
||||||
#' @seealso [adjacency()]
|
#' @seealso [adjacency()]
|
||||||
#'
|
#'
|
||||||
#' @export
|
#' @export
|
||||||
species_adjacency <- function(distance_estimate = stats::median,
|
species_adjacency <- function(id = "species_adjacency",
|
||||||
summarize = stats::median) {
|
|
||||||
method(
|
|
||||||
id = "species_adjacency",
|
|
||||||
name = "Species adj.",
|
name = "Species adj.",
|
||||||
description = "Species adjacency",
|
description = "Species adjacency",
|
||||||
|
distance_estimate = stats::median,
|
||||||
|
summarize = stats::median) {
|
||||||
|
method(
|
||||||
|
id = id,
|
||||||
|
name = name,
|
||||||
|
description = description,
|
||||||
function(preset, progress) {
|
function(preset, progress) {
|
||||||
species_ids <- preset$species_ids
|
species_ids <- preset$species_ids
|
||||||
gene_ids <- preset$gene_ids
|
gene_ids <- preset$gene_ids
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,21 @@
|
||||||
\alias{adjacency}
|
\alias{adjacency}
|
||||||
\title{Score genes based on their proximity to the reference genes.}
|
\title{Score genes based on their proximity to the reference genes.}
|
||||||
\usage{
|
\usage{
|
||||||
adjacency(distance_estimate = densest, summarize = stats::median)
|
adjacency(
|
||||||
|
id = "adjacency",
|
||||||
|
name = "Adjacency",
|
||||||
|
description = "Adjacency to reference genes",
|
||||||
|
distance_estimate = densest,
|
||||||
|
summarize = stats::median
|
||||||
|
)
|
||||||
}
|
}
|
||||||
\arguments{
|
\arguments{
|
||||||
|
\item{id}{Unique ID for the method and its results.}
|
||||||
|
|
||||||
|
\item{name}{Human readable name for the method.}
|
||||||
|
|
||||||
|
\item{description}{Method description.}
|
||||||
|
|
||||||
\item{distance_estimate}{A function that will be used to summarize the
|
\item{distance_estimate}{A function that will be used to summarize the
|
||||||
distance values for each gene. See \code{\link[=densest]{densest()}} for the default
|
distance values for each gene. See \code{\link[=densest]{densest()}} for the default
|
||||||
implementation.}
|
implementation.}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,18 @@
|
||||||
\alias{clustering}
|
\alias{clustering}
|
||||||
\title{Process genes clustering their distance to telomeres.}
|
\title{Process genes clustering their distance to telomeres.}
|
||||||
\usage{
|
\usage{
|
||||||
clustering()
|
clustering(
|
||||||
|
id = "clustering",
|
||||||
|
name = "Clustering",
|
||||||
|
description = "Clustering of genes"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
\arguments{
|
||||||
|
\item{id}{Unique ID for the method and its results.}
|
||||||
|
|
||||||
|
\item{name}{Human readable name for the method.}
|
||||||
|
|
||||||
|
\item{description}{Method description.}
|
||||||
}
|
}
|
||||||
\value{
|
\value{
|
||||||
An object of class \code{geposan_method}.
|
An object of class \code{geposan_method}.
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,20 @@
|
||||||
\alias{correlation}
|
\alias{correlation}
|
||||||
\title{Score genes based on their correlation with the reference genes.}
|
\title{Score genes based on their correlation with the reference genes.}
|
||||||
\usage{
|
\usage{
|
||||||
correlation(summarize = stats::median)
|
correlation(
|
||||||
|
id = "correlation",
|
||||||
|
name = "Correlation",
|
||||||
|
description = "Correlation with reference genes",
|
||||||
|
summarize = stats::median
|
||||||
|
)
|
||||||
}
|
}
|
||||||
\arguments{
|
\arguments{
|
||||||
|
\item{id}{Unique ID for the method and its results.}
|
||||||
|
|
||||||
|
\item{name}{Human readable name for the method.}
|
||||||
|
|
||||||
|
\item{description}{Method description.}
|
||||||
|
|
||||||
\item{summarize}{A function for combining the different correlation
|
\item{summarize}{A function for combining the different correlation
|
||||||
coefficients into one metric. By default, \code{\link[stats:median]{stats::median()}} is used. Other
|
coefficients into one metric. By default, \code{\link[stats:median]{stats::median()}} is used. Other
|
||||||
suggested options include \code{\link[=max]{max()}} and \code{\link[=mean]{mean()}}.}
|
suggested options include \code{\link[=max]{max()}} and \code{\link[=mean]{mean()}}.}
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,22 @@
|
||||||
\alias{neural}
|
\alias{neural}
|
||||||
\title{Find genes by training and applying a neural network.}
|
\title{Find genes by training and applying a neural network.}
|
||||||
\usage{
|
\usage{
|
||||||
neural(seed = 180199, n_models = 5, control_ratio = 0.5)
|
neural(
|
||||||
|
id = "neural",
|
||||||
|
name = "Neural",
|
||||||
|
description = "Assessment by neural network",
|
||||||
|
seed = 180199,
|
||||||
|
n_models = 5,
|
||||||
|
control_ratio = 0.5
|
||||||
|
)
|
||||||
}
|
}
|
||||||
\arguments{
|
\arguments{
|
||||||
|
\item{id}{Unique ID for the method and its results.}
|
||||||
|
|
||||||
|
\item{name}{Human readable name for the method.}
|
||||||
|
|
||||||
|
\item{description}{Method description.}
|
||||||
|
|
||||||
\item{seed}{The seed will be used to make the results reproducible.}
|
\item{seed}{The seed will be used to make the results reproducible.}
|
||||||
|
|
||||||
\item{n_models}{This number specifies how many sets of training data should
|
\item{n_models}{This number specifies how many sets of training data should
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,20 @@
|
||||||
\alias{proximity}
|
\alias{proximity}
|
||||||
\title{Score the distance of genes to the telomeres across species.}
|
\title{Score the distance of genes to the telomeres across species.}
|
||||||
\usage{
|
\usage{
|
||||||
proximity(summarize = stats::median)
|
proximity(
|
||||||
|
id = "proximity",
|
||||||
|
name = "Proximity",
|
||||||
|
description = "Proximity to telomeres",
|
||||||
|
summarize = stats::median
|
||||||
|
)
|
||||||
}
|
}
|
||||||
\arguments{
|
\arguments{
|
||||||
|
\item{id}{Unique ID for the method and its results.}
|
||||||
|
|
||||||
|
\item{name}{Human readable name for the method.}
|
||||||
|
|
||||||
|
\item{description}{Method description.}
|
||||||
|
|
||||||
\item{summarize}{A function for combining the different proximities into one
|
\item{summarize}{A function for combining the different proximities into one
|
||||||
metric. By default, \code{\link[stats:median]{stats::median()}} is used. Other suggested options
|
metric. By default, \code{\link[stats:median]{stats::median()}} is used. Other suggested options
|
||||||
include \code{\link[=min]{min()}} and \code{\link[=mean]{mean()}}.}
|
include \code{\link[=min]{min()}} and \code{\link[=mean]{mean()}}.}
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,21 @@
|
||||||
\alias{species_adjacency}
|
\alias{species_adjacency}
|
||||||
\title{Score genes based on their adjacency to the reference genes within species.}
|
\title{Score genes based on their adjacency to the reference genes within species.}
|
||||||
\usage{
|
\usage{
|
||||||
species_adjacency(distance_estimate = stats::median, summarize = stats::median)
|
species_adjacency(
|
||||||
|
id = "species_adjacency",
|
||||||
|
name = "Species adj.",
|
||||||
|
description = "Species adjacency",
|
||||||
|
distance_estimate = stats::median,
|
||||||
|
summarize = stats::median
|
||||||
|
)
|
||||||
}
|
}
|
||||||
\arguments{
|
\arguments{
|
||||||
|
\item{id}{Unique ID for the method and its results.}
|
||||||
|
|
||||||
|
\item{name}{Human readable name for the method.}
|
||||||
|
|
||||||
|
\item{description}{Method description.}
|
||||||
|
|
||||||
\item{distance_estimate}{Function for combining the distance differences
|
\item{distance_estimate}{Function for combining the distance differences
|
||||||
within one species.}
|
within one species.}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue