mirror of
https://github.com/johrpan/geposan.git
synced 2025-10-25 19:37:23 +02:00
Rename method proximity to distance
This commit is contained in:
parent
463faf0fbe
commit
0f53c3e798
4 changed files with 17 additions and 17 deletions
|
|
@ -14,6 +14,7 @@ export(clustering)
|
|||
export(compare)
|
||||
export(correlation)
|
||||
export(densest)
|
||||
export(distance)
|
||||
export(method)
|
||||
export(neural)
|
||||
export(optimal_weights)
|
||||
|
|
@ -24,7 +25,6 @@ export(plot_rankings)
|
|||
export(plot_scores)
|
||||
export(plot_scores_by_position)
|
||||
export(preset)
|
||||
export(proximity)
|
||||
export(ranking)
|
||||
export(result)
|
||||
export(validate)
|
||||
|
|
|
|||
|
|
@ -33,11 +33,11 @@ method <- function(id, name, description, func) {
|
|||
#' @export
|
||||
all_methods <- function() {
|
||||
list(
|
||||
distance(),
|
||||
adjacency(),
|
||||
clustering(),
|
||||
correlation(),
|
||||
neural(),
|
||||
adjacency(),
|
||||
proximity()
|
||||
neural()
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@
|
|||
#' @return An object of class `geposan_method`.
|
||||
#'
|
||||
#' @export
|
||||
proximity <- function(id = "proximity",
|
||||
name = "Proximity",
|
||||
description = "Proximity to telomeres",
|
||||
distance <- function(id = "distance",
|
||||
name = "Distance",
|
||||
description = "Distance to telomeres",
|
||||
summarize = stats::median) {
|
||||
method(
|
||||
id = id,
|
||||
|
|
@ -25,7 +25,7 @@ proximity <- function(id = "proximity",
|
|||
species_ids <- preset$species_ids
|
||||
gene_ids <- preset$gene_ids
|
||||
|
||||
cached("proximity", c(species_ids, gene_ids), {
|
||||
cached("distance", c(species_ids, gene_ids), {
|
||||
# Prefilter distances by species and gene.
|
||||
data <- geposan::distances[
|
||||
species %chin% preset$species_ids &
|
||||
|
|
@ -39,12 +39,12 @@ proximity <- function(id = "proximity",
|
|||
]
|
||||
|
||||
# Normalize scores.
|
||||
data[, score := 1 - combined_distance / max(combined_distance)]
|
||||
data[, score := combined_distance / max(combined_distance)]
|
||||
|
||||
progress(1.0)
|
||||
|
||||
result(
|
||||
method = "proximity",
|
||||
method = "distance",
|
||||
scores = data[, .(gene, score)],
|
||||
details = list(data = data)
|
||||
)
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/method_proximity.R
|
||||
\name{proximity}
|
||||
\alias{proximity}
|
||||
% Please edit documentation in R/method_distance.R
|
||||
\name{distance}
|
||||
\alias{distance}
|
||||
\title{Score the distance of genes to the telomeres across species.}
|
||||
\usage{
|
||||
proximity(
|
||||
id = "proximity",
|
||||
name = "Proximity",
|
||||
description = "Proximity to telomeres",
|
||||
distance(
|
||||
id = "distance",
|
||||
name = "Distance",
|
||||
description = "Distance to telomeres",
|
||||
summarize = stats::median
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue