Added support for arbitrary Bioc SNPlocs tarballs (dbS > 156)#205
Merged
Al-Murphy merged 2 commits intoAl-Murphy:masterfrom Jun 23, 2025
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new dbSNP_tarball argument across several core functions—most notably in R/load_snp_loc_data.R, R/validate_parameters.R, and R/format_sumstats.R—to allow users to supply an arbitrary Bioc SNPlocs tarball (e.g. for builds ≥156) instead of being limited to the hard-coded 144/155 packages. When dbSNP_tarball is provided, load_snp_loc_data() automatically untars the archive, detects either a flat TSV or per-chromosome .rds files, and ingests them via data.table::fread() or readRDS() + rbindlist(). We verified that, after installing SNPlocs.Hsapiens.dbSNP156.GRCh37/GRCh38, calling format_sumstats(..., dbSNP = 156) works seamlessly without supplying a tarball, and that supplying both dbSNP = 156 and dbSNP_tarball = "" also correctly loads the same data from file. For older or unreleased builds (e.g. 157+), users can simply point to a downloaded tarball—even in the absence of an installed Bioc package—and the code will fall back to reading that archive. In testing on a toy summary-stats file, all downstream allele-flipping and RSID-imputation checks in R/check_no_rs_snp.R and R/check_no_snp.R completed successfully with build 156 both with and without the tarball. This enhancement preserves the original fallback behavior for 144/155, adds full flexibility for any future dbSNP release, and ensures backward compatibility.