From ac9894e988cfe3bd471a1bfedd9e634a172fa253 Mon Sep 17 00:00:00 2001 From: Elias Projahn Date: Sun, 9 Jan 2022 19:52:47 +0100 Subject: [PATCH] proximity: Remove method --- NAMESPACE | 1 - R/method.R | 3 +-- R/proximity.R | 39 --------------------------------------- man/proximity.Rd | 15 --------------- 4 files changed, 1 insertion(+), 57 deletions(-) delete mode 100644 R/proximity.R delete mode 100644 man/proximity.Rd diff --git a/NAMESPACE b/NAMESPACE index cc7f389..49d5bdf 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -21,7 +21,6 @@ export(plot_positions) export(plot_rankings) export(plot_scores) export(preset) -export(proximity) export(ranking) export(result) export(validate) diff --git a/R/method.R b/R/method.R index a1257f4..c0be5ad 100644 --- a/R/method.R +++ b/R/method.R @@ -36,8 +36,7 @@ all_methods <- function() { clustering(), correlation(), neural(), - adjacency(), - proximity() + adjacency() ) } diff --git a/R/proximity.R b/R/proximity.R deleted file mode 100644 index 70c6d92..0000000 --- a/R/proximity.R +++ /dev/null @@ -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)] - ) - }) - } - ) -} diff --git a/man/proximity.Rd b/man/proximity.Rd deleted file mode 100644 index fa8d822..0000000 --- a/man/proximity.Rd +++ /dev/null @@ -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. -}