mirror of
https://github.com/johrpan/geposanui.git
synced 2025-10-26 11:17:24 +01:00
Reorganize source files and generalize presets
This commit is contained in:
parent
8104e9bd8a
commit
68354bf808
14 changed files with 119 additions and 147 deletions
63
methods.R
63
methods.R
|
|
@ -1,63 +0,0 @@
|
|||
source("clusteriness.R")
|
||||
source("correlation.R")
|
||||
source("neural.R")
|
||||
source("proximity.R")
|
||||
|
||||
#' Construct a new method.
|
||||
#'
|
||||
#' A method describes a way to perform a computation on gene distance data that
|
||||
#' results in a single score per gene. The function should accept the following
|
||||
#' parameters in this order:
|
||||
#'
|
||||
#' - `distances` Distance data to use.
|
||||
#' - `species_ids` Species, whose data should be included.
|
||||
#' - `gene_ids` Genes to process.
|
||||
#' - `reference_gene_ids` Genes to compare to.
|
||||
#'
|
||||
#' The function should return a `data.table` with the following columns:
|
||||
#'
|
||||
#' - `gene` Gene ID of the processed gene.
|
||||
#' - `score` Score for the gene between 0.0 and 1.0.
|
||||
#'
|
||||
#' @param id Internal identifier for the method.
|
||||
#' @param name Human readable name for the method.
|
||||
#' @param description Short human readable description.
|
||||
#' @param fn Function to perform the computation.
|
||||
#'
|
||||
#' @return A named list containing the arguments.
|
||||
method <- function(id, name, description, fn) {
|
||||
list(
|
||||
id = id,
|
||||
name = name,
|
||||
description = description,
|
||||
fn = fn
|
||||
)
|
||||
}
|
||||
|
||||
#' All methods to be included in the analysis.
|
||||
methods <- list(
|
||||
method(
|
||||
"clusteriness",
|
||||
"Clustering",
|
||||
"Clustering of genes",
|
||||
process_clusteriness
|
||||
),
|
||||
method(
|
||||
"correlation",
|
||||
"Correlation",
|
||||
"Correlation with known genes",
|
||||
process_correlation
|
||||
),
|
||||
method(
|
||||
"proximity",
|
||||
"Proximity",
|
||||
"Proximity to telomeres",
|
||||
process_proximity
|
||||
),
|
||||
method(
|
||||
"neural",
|
||||
"Neural",
|
||||
"Assessment by neural network",
|
||||
process_neural
|
||||
)
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue