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

Importing plink pgen/pvar support from pgenlibr into other R packages at the the C++ level #283

Closed
GabrielHoffman opened this issue Oct 30, 2024 · 1 comment

Comments

@GabrielHoffman
Copy link
Contributor

Thank you for plink2 and the pgenlibr library.

I am writing an R package that uses an Rcpp backend for analysis, I would like to add support for plink pgen/pvar files. One option is to copy the code from the pgenlibr/src into my own package. But this 1) requires manual updates when pgenlibr changes and 2) doesn't address the issue for other package developers.

But there is an easy fix. Files in inst/include are retained in the path to the installed R package (code in src is not). This allows a package developer to link to C/C++ code distributed by other R packages.

In the pgenlibr package, this just involves moving the symlinks to include/, libdeflate/, simde/, and zstd/ from src/ to inst/include/. And updating the Makefile to include -I../inst/include/.

I tried it and it works great. Would you be interested in this update or including a merge request?

Best,
Gabriel

@chrchang
Copy link
Owner

Sure, that update sounds reasonable.

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