Skip to content

Commit

Permalink
bug fix: order of flow for imp SNP with imp col
Browse files Browse the repository at this point in the history
  • Loading branch information
Al-Murphy committed Jul 17, 2023
1 parent 8df9b70 commit 7f292ca
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions R/check_no_rs_snp.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down

0 comments on commit 7f292ca

Please sign in to comment.