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

Add utility downloader #29

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open

Conversation

muschellij2
Copy link
Contributor

I added functions to download the utilities so that if ukbmd5 and such would be in your PATH, then Sys.which finds it, it will use that. Otherwise, it will download that binary file and run Sys.chmod so that it can run it as an executable. By default, it downloads them to the temporary directory to not violate CRAN policy.

For example:

file = "ukbXXXX.enc"
checksum = "XXXasdf4XXXX"
out = ukb_md5(file)
stopifnot(out == checksum)

out = ukb_unpack(file, key = keyfile)

@muschellij2
Copy link
Contributor Author

Any thoughts on merging this?

Also - do you think adding in the option to ukb_df to put in a CSV that has the withdraw eids?

@kenhanscombe
Copy link
Owner

Hey, sorry for the delay just looking at this now. Good idea. Mainly updating documentation and style. Will push commits to your branch shortly.

Edited code style to match ukbtools package, and ukbtools and UKB
naming conventions. Also added documentation for each function.
@kenhanscombe
Copy link
Owner

Could you separate "utilities" and "withdrawals" additions, preferrably to separate feature branches?

We may be able to incorporate the withdrawals additions before the utilities – I could not get noah to work on macOS 10.14.6 mojave. More generally I'm concerned that noah is archived and therefore no longer supported, and my problems with noah are in fact an unresolved issue #43.

I think I'm inclined to take the addition of utilies in a different direction: I've created a docker image which contains all the md5 checksum'd programs and utilities. It's seems far easier to bind mount to a local directory and ukbunpack, ukbconv, etc. using the linux container (regardless of local operating system). Yes, it will require users to install docker but that's straightforward and supported. Will push this functionality to a feature branch shortly.

Depending how well that works, we may still use your "direct" approach for linux and windows users.

@muschellij2
Copy link
Contributor Author

muschellij2 commented Sep 1, 2020 via email

@muschellij2
Copy link
Contributor Author

muschellij2 commented Sep 1, 2020 via email

@kenhanscombe
Copy link
Owner

Thanks, John.

I think you're right; we'll have to use an OS switch of sorts with docker for mac OS – singularity will work for linux but not for mac (beta version exists but future seems uncertain). Not sure about other OSs. I'm pretty sure I can hide the docker interactions in the backend so that users are only exposed to (pretty much) the list of functions you wrote.

Considering above, I'll work on incorporating the OS switch option (with docker for mac OS, and any other OSs that support docker) into your PR. Will push when I have something substantive.

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

Successfully merging this pull request may close these issues.

2 participants