R/map_ctd_levels.R

Defines functions map_ctd_levels

map_ctd_levels <- function(results,
                           annot_var="annotLevel"){
  annotLevel <- ctd <- NULL;
  if(!annot_var %in% names(results)) {
    results[,annotLevel:=ifelse(ctd=="DescartesHuman",2,
                                ifelse(ctd=="HumanCellLandscape",3,NA))]
    # stopper("annot_var not found in results.")
  }
  results[,list(annotLevel=unique(get(annot_var))), keyby="ctd"]
}
neurogenomics/MultiEWCE documentation built on May 7, 2024, 1:52 p.m.