From 5c5a8d3a2a53194dba31260a716a2f8b8e591c6d Mon Sep 17 00:00:00 2001 From: reedliu Date: Fri, 14 Apr 2023 23:12:52 +0800 Subject: [PATCH] add new file --- R/transID.R | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/R/transID.R b/R/transID.R index 2d73c26..617a65c 100644 --- a/R/transID.R +++ b/R/transID.R @@ -62,10 +62,17 @@ transId <- function(id, id <- replace_greek(id) keytype <- gentype(id = id, data = all, org = org) %>% tolower() - res <- genInfo(id, org, unique, keepNA,hgVersion) %>% - dplyr::mutate( !! keytype := input_id) %>% - dplyr::select(input_id, all_of(transTo)) %>% - distinct() + if(keytype != 'symbol'){ + res <- genInfo(id, org, unique, keepNA,hgVersion) %>% + dplyr::mutate( !! keytype := input_id) %>% + dplyr::select(input_id, all_of(transTo)) %>% + distinct() + }else{ + res <- genInfo(id, org, unique, keepNA,hgVersion) %>% + dplyr::select(input_id, all_of(transTo)) %>% + distinct() + } + }, error = function(e) { message('Maybe your "trans_to" argument is wrong, please check again...')