R/getClassifications.R

#' getClassifications output generator
#'
#' Takes in a dataframe generated by "generate_snp_data" and returns each subject classified with full classification paths
#' @param source_df The snp_data generated dataframe
#' @keywords path list haplogroup classification
#' @export

getClassifications <- function(source_df) {
  full_paths <- by(source_df,1:nrow(source_df),getPathList,simplify=FALSE)
  source_df$full_path <- unlist(full_paths)
  source_df$haplogroup <- unlist(lapply(source_df$full_path,getGroupFromPath))
  final_frame <- source_df[,names(source_df) %in% c("Individual","haplogroup","full_path")]
}
dcrawfo/himc documentation built on May 12, 2019, 5:24 p.m.