R/compare_markers.R

Defines functions compare_markers

Documented in compare_markers

#' Removes markers from data_obj that are not present in the geno_obj
#'
#' @param data_obj a \code{\link{Cape}} object
#' @param geno_obj a genotype object
#'
#' @return The data_obj is returned, and any markers that were
#' not present in geno_obj are removed from data_obj$geno_names
#'
#' 
#' @keywords internal
#' 
compare_markers <- function(data_obj, geno_obj){	
  geno <- get_geno(data_obj, geno_obj)
  missing_markers <- setdiff(data_obj$geno_names[[3]], dimnames(geno)[[3]])
  if(length(missing_markers) > 0){
    message("Removing markers from data_obj that are not present in the geno_obj\n")
    data_obj <- remove_markers(data_obj, missing_markers)
  }
  return(data_obj)	
}

Try the cape package in your browser

Any scripts or data that you put into this service are public.

cape documentation built on Feb. 10, 2021, 5:06 p.m.