ranking: Fix error copying the input

This commit is contained in:
Elias Projahn 2021-11-12 10:33:33 +01:00
parent 4dda7fa49e
commit 0e641e4dd2

View file

@ -30,10 +30,11 @@ ranking <- function(analysis, weights, min_n_species = 10) {
# Exclude genes with too few species. # Exclude genes with too few species.
ranking <- analysis$results[ ranking <- analysis$results[
genes_n_species[gene, n_species] >= min_n_species, genes_n_species[gene, n_species] >= min_n_species
.(score = 0.0)
] ]
ranking[, score := 0.0]
for (method in names(weights)) { for (method in names(weights)) {
weighted <- weights[[method]] * ranking[, ..method] weighted <- weights[[method]] * ranking[, ..method]
ranking[, score := score + weighted] ranking[, score := score + weighted]