mirror of
https://github.com/johrpan/geposan.git
synced 2025-10-25 19:37:23 +02:00
Fix some package issues
This commit is contained in:
parent
28f9834984
commit
6d9511fa2e
6 changed files with 41 additions and 19 deletions
|
|
@ -2,3 +2,4 @@
|
|||
^\.Rproj\.user$
|
||||
^LICENSE\.md$
|
||||
^scripts$
|
||||
^cache$
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
15
R/preset.R
15
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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue