R/getPathList.R

#' getPathList internal function
#'
#' Takes in a nested list of paths in dataframe format and returns a top-level path assignment
#' @param df The FASTMAP dataframe row
#' @keywords prettify path list
#' @export

getPathList <- function(df) {
  ugly_paths <- getAllPaths(df,root,"")
  formatted <- lapply(unlist(ugly_paths), function(x) { gsub(" unclassified ","",x)})
  formatted <- lapply(formatted, function(x) { gsub(" unclassified","unclassified",x) } )
  to_v <- lapply(formatted,function(x) { gsub(" "," -> ",x)})
  getFinalPathList(unlist(to_v))
}
dcrawfo/himc documentation built on May 12, 2019, 5:24 p.m.