Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading PVAR in pgenlibr #286

Open
GabrielHoffman opened this issue Nov 24, 2024 · 1 comment
Open

Loading PVAR in pgenlibr #286

GabrielHoffman opened this issue Nov 24, 2024 · 1 comment

Comments

@GabrielHoffman
Copy link
Contributor

I'm working on an R package that reads PGEN files and performs statistical analysis in C++ via Rcpp (#283). pgenlibr provides almost everything a user needs.

The R function pgenlibr::NewPvar() to load a .pvar file calls LoadMinimalPvar() in C++:

PglErr LoadMinimalPvar(const char* fname, MinimalPvar* mpp, char* errstr_buf) {

It loads ID, REF and ALT, but not CHR or POS.

Do you have code to include chromosome and position information, so a user can intersect the variants with a BED file of genome intervals?

I'd do this myself, but that function is very hard to follow, and I'd write a new version but I'm concerned that there are some .pvar values it wouldn't parse correctly.

Best,
Gabriel

@chrchang
Copy link
Owner

This wasn't present in the first released version of pgenlibr since --set-all-var-ids provided a simple way to work around the limitation, but okay, now it's embarrassing. I will add this sometime in the next two weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants