diff --git a/.Rbuildignore b/.Rbuildignore index 38ff65d..563c2e2 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -2,3 +2,4 @@ ^\.Rproj\.user$ ^LICENSE\.md$ ^scripts$ +^cache$ diff --git a/R/comparison.R b/R/comparison.R index 02ea172..082d524 100644 --- a/R/comparison.R +++ b/R/comparison.R @@ -24,7 +24,7 @@ compare <- function(ranking, comparison_gene_ids) { comparison_ranking <- ranking[gene %chin% comparison_gene_ids] - p_value <- wilcox.test( + p_value <- stats::wilcox.test( x = comparison_ranking[, score], y = ranking[!gene %chin% comparison_gene_ids, score], alternative = "greater" @@ -46,10 +46,13 @@ compare <- function(ranking, comparison_gene_ids) { #' S3 method to print a comparison object. #' +#' @param x The comparison to print. +#' @param ... Other parameters. +#' #' @seealso [compare()] #' #' @export -print.geposan_comparison <- function(comparison, ...) { +print.geposan_comparison <- function(x, ...) { cat("geposan comparison:") cat(sprintf( paste( @@ -62,14 +65,14 @@ print.geposan_comparison <- function(comparison, ...) { "\n\n p-value for better ranking: %.4f\n", sep = "" ), - comparison$mean, - comparison$min, - comparison$max, - comparison$mean_rank, - comparison$first_rank, - comparison$last_rank, - comparison$p_value + x$mean, + x$min, + x$max, + x$mean_rank, + x$first_rank, + x$last_rank, + x$p_value )) - invisible(comparison) + invisible(x) } diff --git a/R/plots.R b/R/plots.R index 839a51b..6eabcdc 100644 --- a/R/plots.R +++ b/R/plots.R @@ -41,7 +41,12 @@ plot_scores <- function(ranking, gene_sets = NULL, labels = NULL) { } # Include gene information which will be used for labeling - gene_set_data <- merge(gene_set_data, genes, by.x = "gene", by.y = "id") + gene_set_data <- merge( + gene_set_data, + geposan::genes, + by.x = "gene", + by.y = "id" + ) plot <- plot |> plotly::add_trace( data = gene_set_data, diff --git a/R/preset.R b/R/preset.R index 527928a..1e16f79 100644 --- a/R/preset.R +++ b/R/preset.R @@ -43,24 +43,27 @@ preset <- function(methods = c( #' S3 method to print a preset object. #' +#' @param x The preset to print. +#' @param ... Other parameters. +#' #' @seealso [preset()] #' #' @export -print.geposan_preset <- function(preset, ...) { +print.geposan_preset <- function(x, ...) { cat("geposan preset:") cat("\n Included methods: ") - cat(preset$method_ids, sep = ", ") + cat(x$method_ids, sep = ", ") cat(sprintf( "\n Input data: %i species, %i genes", - length(preset$species_ids), - length(preset$gene_ids) + length(x$species_ids), + length(x$gene_ids) )) cat(sprintf( "\n Comparison data: %i reference genes\n", - length(preset$reference_gene_ids) + length(x$reference_gene_ids) )) - invisible(preset) + invisible(x) } diff --git a/man/print.geposan_comparison.Rd b/man/print.geposan_comparison.Rd index 2a2d1f7..10d66c7 100644 --- a/man/print.geposan_comparison.Rd +++ b/man/print.geposan_comparison.Rd @@ -4,7 +4,12 @@ \alias{print.geposan_comparison} \title{S3 method to print a comparison object.} \usage{ -\method{print}{geposan_comparison}(comparison, ...) +\method{print}{geposan_comparison}(x, ...) +} +\arguments{ +\item{x}{The comparison to print.} + +\item{...}{Other parameters.} } \description{ S3 method to print a comparison object. diff --git a/man/print.geposan_preset.Rd b/man/print.geposan_preset.Rd index dce4ed2..eb81490 100644 --- a/man/print.geposan_preset.Rd +++ b/man/print.geposan_preset.Rd @@ -4,7 +4,12 @@ \alias{print.geposan_preset} \title{S3 method to print a preset object.} \usage{ -\method{print}{geposan_preset}(preset, ...) +\method{print}{geposan_preset}(x, ...) +} +\arguments{ +\item{x}{The preset to print.} + +\item{...}{Other parameters.} } \description{ S3 method to print a preset object.