R/parse_dropped_INFO.R

Defines functions parse_dropped_INFO

Documented in parse_dropped_INFO

#' Parse number of SNPs dropped due to being below the INFO threshold
#' 
#' Support function for \link[MungeSumstats]{parse_logs}.
#' 
#' @param l Lines of text from log file.
#' 
#' @return Numeric
#' @keywords internal
parse_dropped_INFO <- function(l){
  line <- grep("SNPs are below the INFO threshold of",l,
               value = TRUE)[1]
  if(is.na(line)) return(NA)
  as.integer(trimws(gsub("There are|,","",strsplit(line," SNPs")[[1]][1])))
}
neurogenomics/MungeSumstats documentation built on Aug. 10, 2024, 5:59 a.m.