From ef55e8d90a973d27adf7644d34c1f34bc91c04ca Mon Sep 17 00:00:00 2001 From: Chunmingl Date: Tue, 3 Jun 2025 11:52:53 -0400 Subject: [PATCH] minor fix for harmonization --- R/twas.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/twas.R b/R/twas.R index 352d55d9..dcc3bd5a 100644 --- a/R/twas.R +++ b/R/twas.R @@ -251,7 +251,8 @@ harmonize_gwas <- function(gwas_file, query_region, ld_variants, col_to_flip=NUL if(is.null(gwas_file)| is.na(gwas_file)) stop("No GWAS file path provided. ") gwas_data_sumstats <- as.data.frame(tabix_region(gwas_file, query_region)) # extension for yml file for column name mapping if (nrow(gwas_data_sumstats) == 0) { - warning(paste0("No GWAS summary statistics found for the region of ", query_region, " in ", study, ". ")) + if (length(names(gwas_file))==0) names(gwas_file) <- gwas_file + warning(paste0("No GWAS summary statistics found for the region of ", query_region, " in ", names(gwas_file), ". ")) return(NULL) } if (colnames(gwas_data_sumstats)[1] == "#chrom") colnames(gwas_data_sumstats)[1] <- "chrom" # colname update for tabix