From 0e641e4dd22ef226234231816ed1c4757cd20423 Mon Sep 17 00:00:00 2001 From: Elias Projahn Date: Fri, 12 Nov 2021 10:33:33 +0100 Subject: [PATCH] ranking: Fix error copying the input --- R/ranking.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/R/ranking.R b/R/ranking.R index 711b7c5..e9e81e3 100644 --- a/R/ranking.R +++ b/R/ranking.R @@ -30,10 +30,11 @@ ranking <- function(analysis, weights, min_n_species = 10) { # Exclude genes with too few species. ranking <- analysis$results[ - genes_n_species[gene, n_species] >= min_n_species, - .(score = 0.0) + genes_n_species[gene, n_species] >= min_n_species ] + ranking[, score := 0.0] + for (method in names(weights)) { weighted <- weights[[method]] * ranking[, ..method] ranking[, score := score + weighted]