mirror of
https://github.com/johrpan/geposanui.git
synced 2025-10-26 19:27: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
29
process/presets.R
Normal file
29
process/presets.R
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
library(data.table)
|
||||
|
||||
#' Create a new preset.
|
||||
#'
|
||||
#' A preset is a combination of input values to all processing methods. The
|
||||
#' preset's hash will be used to cache the results of applying those.
|
||||
#'
|
||||
#' @param species_ids IDs of species to include.
|
||||
#' @param reference_gene_ids Reference genes to use.
|
||||
#'
|
||||
#' @return A named list containing the arguments.
|
||||
preset <- function(species_ids, reference_gene_ids) {
|
||||
list(
|
||||
species_ids = species_ids,
|
||||
reference_gene_ids = reference_gene_ids
|
||||
)
|
||||
}
|
||||
|
||||
#' A default preset including only replicatively aging species.
|
||||
preset_replicative_species <- preset(
|
||||
species[replicative == TRUE, id],
|
||||
genes[suggested | verified == TRUE, id]
|
||||
)
|
||||
|
||||
#' A default preset including all species.
|
||||
preset_all_species <- preset(
|
||||
species[, id],
|
||||
genes[suggested | verified == TRUE, id]
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue