R/POLYFUN_gather_ldscores.R

Defines functions POLYFUN_gather_ldscores

Documented in POLYFUN_gather_ldscores

#' Find and import LD score files
#' @keywords internal
#' @family polyfun
#' @examples
#' \dontrun{
#' output_prefix <- file.path(system.file("tools/polyfun/gold","",package = "echofinemap"),"testrun.22")
#' ldscore <- POLYFUN_gather_ldscores(output_prefix=output_prefix)
#' }
POLYFUN_gather_ldscores <- function(output_prefix){
    ldscore.files <-  list.files(dirname(output_prefix),
                                 pattern = ".l2.ldscore.parquet",
                                 full.names = TRUE)
    if(length(ldscore.files)>1){
        messager("PolyFun:: >1 ldscore file detected. Only using the first:",
                 ldscore.files[1])
    }
    parquor <- echodata::read_parquet(ldscore.files[1])
    return(parquor)
}
RajLabMSSM/echofinemap documentation built on Jan. 3, 2023, 1:42 a.m.