proximity: Remove method

This commit is contained in:
Elias Projahn 2022-01-09 19:52:47 +01:00
parent ac1e8a2d49
commit ac9894e988
4 changed files with 1 additions and 57 deletions

View file

@ -21,7 +21,6 @@ export(plot_positions)
export(plot_rankings) export(plot_rankings)
export(plot_scores) export(plot_scores)
export(preset) export(preset)
export(proximity)
export(ranking) export(ranking)
export(result) export(result)
export(validate) export(validate)

View file

@ -36,8 +36,7 @@ all_methods <- function() {
clustering(), clustering(),
correlation(), correlation(),
neural(), neural(),
adjacency(), adjacency()
proximity()
) )
} }

View file

@ -1,39 +0,0 @@
#' Score the mean distance of genes to the telomeres across species.
#'
#' A score will be given to each gene such that 0.0 corresponds to the maximal
#' mean distance across all genes and 1.0 corresponds to a distance of 0.
#'
#' @return An object of class `geposan_method`.
#'
#' @export
proximity <- function() {
method(
id = "proximity",
name = "Proximity",
description = "Proximity to telomeres",
function(preset, progress) {
species_ids <- preset$species_ids
gene_ids <- preset$gene_ids
cached("proximity", c(species_ids, gene_ids), {
# Prefilter distances by species and gene.
data <- geposan::distances[
species %chin% preset$species_ids &
gene %chin% preset$gene_ids
]
# Compute the score as described above.
data <- data[, .(mean_distance = mean(distance)), by = "gene"]
max_distance <- data[, max(mean_distance)]
data[, score := 1 - mean_distance / max_distance]
progress(1.0)
result(
method = "proximity",
scores = data[, .(gene, score)]
)
})
}
)
}

View file

@ -1,15 +0,0 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/proximity.R
\name{proximity}
\alias{proximity}
\title{Score the mean distance of genes to the telomeres across species.}
\usage{
proximity()
}
\value{
An object of class \code{geposan_method}.
}
\description{
A score will be given to each gene such that 0.0 corresponds to the maximal
mean distance across all genes and 1.0 corresponds to a distance of 0.
}