From 741c4ddd0a69ddac64f93902f9814f3842fbb994 Mon Sep 17 00:00:00 2001 From: czechb3 Date: Thu, 16 May 2024 09:49:28 +0200 Subject: [PATCH] refactor: update logic to support GDS identifiers --- R/add_annotation.R | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/R/add_annotation.R b/R/add_annotation.R index b777e8ea..cc60bdee 100644 --- a/R/add_annotation.R +++ b/R/add_annotation.R @@ -295,10 +295,12 @@ get_drug_annotation_from_dt <- function(dt) { names(dt)) dt_drug <- dt[, unlist(drug_cols), with = FALSE] dt_long <- data.table::melt(dt_drug, - measure.vars = patterns(paste0("^", - unlist(drug_cols[c("drug", - "drug_name", - "drug_moa")]))), + measure.vars = patterns(gsub("[0-9]", + ".", + paste0("^", + unlist(drug_cols[c("drug", + "drug_name", + "drug_moa")])))), value.name = unlist(drug_cols[c("drug", "drug_name", "drug_moa")]))