diff --git a/R/method.R b/R/method.R index a407f57..3c39db3 100644 --- a/R/method.R +++ b/R/method.R @@ -3,6 +3,7 @@ #' @param id Unique identifier for the method. #' @param name Human readable name. #' @param description Slightly longer description. +#' @param help Context help for user interfaces. #' @param func Function to apply the method. The function should accept two #' parameters: an object of class `geposan_preset` as input and a function to #' report progress information to as a numeric value. The return value should @@ -11,10 +12,11 @@ #' @return An object of class `geposan_method`. #' #' @export -method <- function(id, name, description, func) { +method <- function(id, name, description, help, func) { stopifnot(is.character(id) & length(id) == 1) stopifnot(is.character(name) & length(name) == 1) stopifnot(is.character(description) & length(description) == 1) + stopifnot(is.character(help) & length(help) == 1) stopifnot(is.function(func)) structure( @@ -22,6 +24,7 @@ method <- function(id, name, description, func) { id = glue::glue("geposan_method_{id}"), name = name, description = description, + help = help, func = func ), class = "geposan_method" diff --git a/R/method_adjacency.R b/R/method_adjacency.R index efc0bc8..edfce70 100644 --- a/R/method_adjacency.R +++ b/R/method_adjacency.R @@ -22,6 +22,11 @@ adjacency <- function(id = "adjacency", id = id, name = name, description = description, + help = paste0( + "Adjacency to the reference genes across species. This method penalizes ", + "genes that do not occur in the region typical for the reference genes, ", + "without artificially defining a fixed boundary." + ), function(preset, progress) { species_ids <- preset$species_ids gene_ids <- preset$gene_ids diff --git a/R/method_clustering.R b/R/method_clustering.R index 0d62e4f..37a46a1 100644 --- a/R/method_clustering.R +++ b/R/method_clustering.R @@ -73,6 +73,10 @@ clustering <- function(id = "clustering", id = id, name = name, description = description, + help = paste0( + "Proportion of orthologs that have similar telomeric distances across ", + "species. This favors genes whose position is evolutionarily conserved." + ), function(preset, progress) { species_ids <- preset$species_ids gene_ids <- preset$gene_ids diff --git a/R/method_correlation.R b/R/method_correlation.R index 2eec60c..0de151a 100644 --- a/R/method_correlation.R +++ b/R/method_correlation.R @@ -18,6 +18,12 @@ correlation <- function(id = "correlation", id = id, name = name, description = description, + help = paste0( + "Spearman's rank correlation of the telomeric distances of the gene in ", + "comparison with the reference gene set. This helps to assess if the ", + "gene is as close or distant to telomeres as the reference genes within ", + "each species." + ), function(preset, progress) { species_ids <- preset$species_ids gene_ids <- preset$gene_ids diff --git a/R/method_distance.R b/R/method_distance.R index 217fa01..dc8a0c0 100644 --- a/R/method_distance.R +++ b/R/method_distance.R @@ -21,6 +21,7 @@ distance <- function(id = "distance", id = id, name = name, description = description, + help = "Median distance to the telomeres across species.", function(preset, progress) { species_ids <- preset$species_ids gene_ids <- preset$gene_ids diff --git a/R/method_random_forest.R b/R/method_random_forest.R index cb29d66..53bf0bb 100644 --- a/R/method_random_forest.R +++ b/R/method_random_forest.R @@ -28,6 +28,11 @@ random_forest <- function(id = "rforest", id = id, name = name, description = description, + help = paste0( + "Assessment of a random forest model trained on reference gene ", + "distances. It may derive patterns in positional data that have not ", + "been covered by other methods." + ), function(preset, progress) { species_ids <- preset$species_ids gene_ids <- preset$gene_ids diff --git a/man/method.Rd b/man/method.Rd index 39e0867..8217202 100644 --- a/man/method.Rd +++ b/man/method.Rd @@ -4,7 +4,7 @@ \alias{method} \title{Describe a new method for analyzing gene position data.} \usage{ -method(id, name, description, func) +method(id, name, description, help, func) } \arguments{ \item{id}{Unique identifier for the method.} @@ -13,6 +13,8 @@ method(id, name, description, func) \item{description}{Slightly longer description.} +\item{help}{Context help for user interfaces.} + \item{func}{Function to apply the method. The function should accept two parameters: an object of class \code{geposan_preset} as input and a function to report progress information to as a numeric value. The return value should