diff --git a/DESCRIPTION b/DESCRIPTION index 2fe19a0..da7edd4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: MungeSumstats Type: Package Title: Standardise summary statistics from GWAS -Version: 1.9.11 +Version: 1.9.12 Authors@R: c(person(given = "Alan", family = "Murphy", diff --git a/NEWS.md b/NEWS.md index d9e4c3c..f43f370 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,10 @@ +## CHANGES IN VERSION 1.9.12 + +### Bug fix +* In `check_no_rs_snp` the order of operations had to be reversed to ensure all +values were present before sorting column headers when `imputation_ind=TRUE` and +imputing rsIDs. + ## CHANGES IN VERSION 1.9.11 ### New features diff --git a/R/check_no_rs_snp.R b/R/check_no_rs_snp.R index 92038de..b0fa88c 100644 --- a/R/check_no_rs_snp.R +++ b/R/check_no_rs_snp.R @@ -264,14 +264,14 @@ check_no_rs_snp <- function(sumstats_dt, path, ref_genome, snp_ids_are_rs_ids, miss_rs_chr_bp[, "SNP"]), ] # remove temp columns miss_rs_chr_bp[, (format) := NULL] - # get columns in same order as rest of data table - data.table::setcolorder(miss_rs_chr_bp, col_headers) # join with full dataset # If IMPUTATION column added add it to other DT if (imputation_ind && !"IMPUTATION_SNP" %in% names(miss_rs_chr_bp)) { miss_rs_chr_bp[, IMPUTATION_SNP := NA] } + # get columns in same order as rest of data table + data.table::setcolorder(miss_rs_chr_bp, col_headers) sumstats_dt <- data.table::rbindlist( list(sumstats_dt, miss_rs_chr_bp)) }