Move species count to analysis

This commit is contained in:
Elias Projahn 2021-11-17 22:57:31 +01:00
parent f84d37dd30
commit 33056bfa40
6 changed files with 30 additions and 45 deletions

View file

@ -14,6 +14,8 @@
#' @param methods Methods to apply.
#' @param species_ids IDs of species to include.
#' @param gene_ids IDs of genes to screen.
#' @param min_n_species Minimum number of orthologs that a gene should have to
#' be included in the analysis.
#' @param reference_gene_ids IDs of reference genes to compare to.
#'
#' @return The preset to use with [analyze()].
@ -27,6 +29,7 @@ preset <- function(methods = c(
),
species_ids = NULL,
gene_ids = NULL,
min_n_species = 10,
reference_gene_ids = NULL) {
# The included data gets sorted to be able to produce predictable hashes
# for the object later.
@ -35,6 +38,7 @@ preset <- function(methods = c(
methods = sort(methods),
species_ids = sort(species_ids),
gene_ids = sort(gene_ids),
min_n_species = as.numeric(min_n_species),
reference_gene_ids = sort(reference_gene_ids)
),
class = "geposan_preset"
@ -60,6 +64,8 @@ print.geposan_preset <- function(x, ...) {
length(x$gene_ids)
))
cat(sprintf("\n Species per gene: \u2265 %i", x$min_n_species))
cat(sprintf(
"\n Comparison data: %i reference genes\n",
length(x$reference_gene_ids)