ranking: Exclude genes without data

This commit is contained in:
Elias Projahn 2024-04-26 19:35:23 +02:00
parent a9643ca6dc
commit 76980908d7

View file

@ -45,8 +45,8 @@ rank_genes <- function(data = ubigen::gtex_all,
data[, score := (score - min(score, na.rm = TRUE)) /
(max(score, na.rm = TRUE) - min(score, na.rm = TRUE))]
# These are genes that are not expressed at all.
data[is.na(score), score := 0.0]
# Exclude genes that are not expressed at all.
data <- data[!is.na(score)]
setorder(data, -score)
data[, rank := .I]