diff --git a/DESCRIPTION b/DESCRIPTION index 197d324..7abd645 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -29,8 +29,9 @@ Imports: doParallel, lifecycle, xml2, - rvest -RoxygenNote: 7.1.0 + rvest, + utils +RoxygenNote: 7.1.1 Suggests: knitr, rmarkdown, diff --git a/NAMESPACE b/NAMESPACE index f309881..5826c91 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -26,6 +26,12 @@ export(ukb_icd_diagnosis) export(ukb_icd_freq_by) export(ukb_icd_keyword) export(ukb_icd_prevalence) +export(ukb_util_conv) +export(ukb_util_encoding) +export(ukb_util_fetch) +export(ukb_util_get) +export(ukb_util_md5) +export(ukb_util_unpack) import(dplyr) import(ggplot2) import(grid) diff --git a/NEWS.md b/NEWS.md index 7c10424..45697ab 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,7 +3,9 @@ Bug fix: -dplyr update broke `ukb_icd_diagnosis`. Fixed in dev version. +* dplyr update broke `ukb_icd_diagnosis`. Fixed in dev version. + +* Added `ukb_util_*` functions to be able to perform system-level calls for fetching, unpacking, converting UKB files. diff --git a/R/dataset.R b/R/dataset.R index d074bf3..b35bcc1 100644 --- a/R/dataset.R +++ b/R/dataset.R @@ -6,6 +6,7 @@ globalVariables( "Kinship", "categorized_var", "dx", "freq", "tile_range", "lower", "upper", "mid", "frequency", "disease")) + #' Reads a UK Biobank phenotype fileset and returns a single dataset. #' #' A UK Biobank \emph{fileset} includes a \emph{.tab} file containing the raw data with field codes instead of variable names, an \emph{.r} (\emph{sic}) file containing code to read raw data (inserts categorical variable levels and labels), and an \emph{.html} file containing tables mapping field code to variable name, and labels and levels for categorical variables. @@ -14,6 +15,10 @@ globalVariables( #' @param path The path to the directory containing your UKB fileset. The default value is the current directory. #' @param n_threads Either "max" (uses the number of cores, `parallel::detectCores()`), "dt" (default - uses the data.table default, `data.table::getDTthreads()`), or a numerical value (in which case n_threads is set to the supplied value, or `parallel::detectCores()` if it is smaller). #' @param data.pos Locates the data in your .html file. The .html file is read into a list; the default value data.pos = 2 indicates the second item in the list. (The first item in the list is the title of the table). You will probably not need to change this value, but if the need arises you can open the .html file in a browser and identify where in the file the data is. +#' @param temporary Should the `R` file be copied to a temporary directory? +#' Useful for permissions issues, especially on computing clusters. +#' @param withdraw_file file of identifiers of those who have +#' withdrawn from UK Biobank to exclude from the data set. #' #' @details The \strong{index} and \strong{array} from the UKB field code are preserved in the variable name, as two numbers separated by underscores at the end of the name e.g. \emph{variable_index_array}. \strong{index} refers the assessment instance (or visit). \strong{array} captures multiple answers to the same "question". See UKB documentation for detailed descriptions of \href{http://biobank.ctsu.ox.ac.uk/crystal/instance.cgi?id=2}{index} and \href{http://biobank.ctsu.ox.ac.uk/crystal/help.cgi?cd=array}{array}. #' @@ -45,7 +50,10 @@ globalVariables( #' ukb_df_full_join(ukb1234_data, ukb2345_data, ukb3456_data) #' } #' -ukb_df <- function(fileset, path = ".", n_threads = "dt", data.pos = 2) { +ukb_df <- function(fileset, path = ".", n_threads = "dt", data.pos = 2, + temporary = FALSE, withdraw_file = NULL) { + + fileset = stringr::str_replace(fileset, "[.](r|html|tab)$", "") # Check files exist html_file <- stringr::str_interp("${fileset}.html") @@ -70,7 +78,32 @@ ukb_df <- function(fileset, path = ".", n_threads = "dt", data.pos = 2) { ) ukb_key <- ukb_df_field(fileset, path = path) %>% - mutate(fread_column_type = col_type[col.type]) + dplyr::mutate(fread_column_type = col_type[col.type]) + + withdraw_ids = NULL + if (!is.null(withdraw_file) && file.exists(withdraw_file)) { + withdraw_ids <- data.table::fread( + input = withdraw_file, + sep = "\t", + header = FALSE, + data.table = FALSE, + showProgress = FALSE, + nThread = if(n_threads == "max") { + parallel::detectCores() + } else if (n_threads == "dt") { + data.table::getDTthreads() + } else if (is.numeric(n_threads)) { + min(n_threads, parallel::detectCores()) + } + ) + if (ncol(withdraw_ids) > 1) + warning( + paste0( + "withdrawal_file has multiple columns, ", + "it should not be just one column (no header) of IDs") + ) + withdraw_ids = withdraw_ids[[1]] + } bad_col_type <- is.na(ukb_key$fread_column_type) @@ -90,10 +123,30 @@ ukb_df <- function(fileset, path = ".", n_threads = "dt", data.pos = 2) { # Comment out .r read of .tab # Read .tab file from user named path with data.table::fread # Include UKB-generated categorical variable labels - bd <- read_ukb_tab(fileset, column_type = ukb_key$fread_column_type, path, n_threads = n_threads) - source(file.path(path, r_file), local = TRUE) + bd <- read_ukb_tab(fileset, + column_type = ukb_key$fread_column_type, + path, + n_threads = n_threads, + temporary = temporary) + if (temporary) { + r_file = file.path(tempdir(), basename(r_file)) + } else { + r_file = file.path(path, r_file) + } + source(r_file, local = TRUE) names(bd) <- ukb_key$col.name[match(names(bd), ukb_key$field.tab)] + if (!is.null(withdraw_ids)) { + if ("eid" %in% colnames(bd)) { + bd = bd[ !bd$eid %in% withdraw_ids, ] + } else { + warning( + paste0( + "eid not in data set column name and withdraw IDs are given,", + " no records were dropped!") + ) + } + } return(bd) } @@ -126,6 +179,8 @@ ukb_df <- function(fileset, path = ".", n_threads = "dt", data.pos = 2) { #' } #' ukb_df_field <- function(fileset, path = ".", data.pos = 2, as.lookup = FALSE) { + fileset = stringr::str_replace(fileset, "[.](r|html|tab)$", "") + html_file <- stringr::str_interp("${fileset}.html") html_internal_doc <- xml2::read_html(file.path(path, html_file)) html_table_nodes <- xml2::xml_find_all(html_internal_doc, "//table") @@ -205,7 +260,11 @@ description_to_name <- function(data) { # @param fileset prefix for UKB fileset # @param path The path to the directory containing your UKB fileset. The default value is the current directory. # -read_ukb_tab <- function(fileset, column_type, path = ".", n_threads = "max") { +read_ukb_tab <- function(fileset, column_type, path = ".", + n_threads = "max", + temporary = FALSE) { + fileset = stringr::str_replace(fileset, "[.](r|html|tab)$", "") + r_file <- stringr::str_interp("${fileset}.r") tab_file <- stringr::str_interp("${fileset}.tab") @@ -221,7 +280,9 @@ read_ukb_tab <- function(fileset, column_type, path = ".", n_threads = "max") { replacement = stringr::str_interp( "# Read function edited by ukbtools ${edit_date}\n# bd <-") ) - + if (temporary) { + r_location = file.path(tempdir(), basename(r_location)) + } cat(f, file = r_location, sep = "\n") bd <- data.table::fread( @@ -252,7 +313,7 @@ read_ukb_tab <- function(fileset, column_type, path = ".", n_threads = "max") { #' @param ... Supply comma separated unquoted names of to-be-merged UKB datasets (created with \code{\link{ukb_df}}). Arguments are passed to \code{list}. #' @param by Variable used to merge multiple dataframes (default = "eid"). #' -#' @details The function takes a comma separated list of unquoted datasets. By explicitly setting the join key to "eid" only (Default value of the \code{by} parameter), any additional variables common to any two tables will have ".x" and ".y" appended to their names. If you are satisfied the additional variables are identical to the original, the copies can be safely deleted. For example, if \code{setequal(my_ukb_data$var, my_ukb_data$var.x)} is \code{TRUE}, then my_ukb_data$var.x can be dropped. A \code{dlyr::full_join} is like the set operation union in that all observations from all tables are included, i.e., all samples are included even if they are not included in all datasets. +#' @details The function takes a comma separated list of unquoted datasets. By explicitly setting the join key to "eid" only (Default value of the \code{by} parameter), any additional variables common to any two tables will have ".x" and ".y" appended to their names. If you are satisfied the additional variables are identical to the original, the copies can be safely deleted. For example, if \code{setequal(my_ukb_data$var, my_ukb_data$var.x)} is \code{TRUE}, then my_ukb_data$var.x can be dropped. A \code{dplyr::full_join} is like the set operation union in that all observations from all tables are included, i.e., all samples are included even if they are not included in all datasets. #' #' NB. \code{ukb_df_full_join} will fail if any variable names are repeated **within** a single UKB dataset. This is unlikely to occur, however, \code{ukb_df} creates variable names by combining a snake_case descriptor with the variable's **index** and **array**. If an index_array combination is incorrectly repeated, this will result in a duplicated variable. If the join fails, you can use \code{\link{ukb_df_duplicated_name}} to find duplicated names. See \code{vignette(topic = "explore-ukb-data", package = "ukbtools")} for further details. #' diff --git a/R/filehandlers.R b/R/filehandlers.R new file mode 100644 index 0000000..890b311 --- /dev/null +++ b/R/filehandlers.R @@ -0,0 +1,254 @@ + +os_type <- function() { + .Platform$OS.type +} + + +sys_type <- function() { + if (os_type() == "windows") { + "windows" + } else if (Sys.info()["sysname"] == "Darwin") { + "macos" + } else if (Sys.info()["sysname"] == "Linux") { + "linux" + } else if (os_type() == "unix") { + # "unix" + "linux" + } else { + stop("Unknown OS") + } +} + + +#' Downloads individual UKB utlities and file handlers. +#' +#' @param util Name of the utility. Must be one of \code{"ukbmd5"}, \code{"ukbconv"}, \code{"ukbunpack"}, \code{"ukbfetch"}, \code{"ukblink"}, \code{"ukbgene"}, \code{"encoding.ukb"}. For a description of the UKB utilies and file handlers, see \href{http://biobank.ndph.ox.ac.uk/showcase/download.cgi}{UKB Downloads}. +#' @param download Should the utility be downloaded if not found? Default is \code{TRUE}. +#' @param out_dir The output directory to download the UKB utility to. Default \code{tempdir()} - UKB utility and temporary directory will be deleted at the end of the current session. +#' @return Path to the downloaded utility. +#' @export +#' +#' @examples +#' md5 = ukb_util_get("ukbmd5") +#' file.remove(md5) +ukb_util_get <- function( + util = c("ukbmd5", "ukbconv", "ukbunpack", + "ukbfetch", "ukblink", "ukbgene", + "encoding.ukb"), + download = TRUE, + out_dir = tempdir()) { + + util = match.arg(util) + st = sys_type() + stopifnot(st %in% c("windows", "linux", "macos")) + + ext = "" + if (st == "windows") { + ext = ".exe" + } + + exec_path = Sys.which(util) + if (nzchar(exec_path)) { + return(exec_path) + } + + if (download) { + util_url = paste0("http://biobank.ndph.ox.ac.uk/showcase/util/", + util, ext) + dest_file = file.path(out_dir, basename(util_url)) + + if (!file.exists(dest_file)) { + utils::download.file(util_url, destfile = dest_file, + mode = "wb") + } + + if (st %in% "macos") { + noah = Sys.which("noah") + if (!nzchar(noah)) { + warning( + paste0( + "You may need noah to use this UKB utility ", + "(a linux executable) on Mac OSX.", + " See https://github.com/linux-noah/noah"), + call. = FALSE + ) + } + } + + Sys.chmod(dest_file) + return(dest_file) + + } else { + + stop( + paste0("Cannot find tool: ", util, + ", you may need to modify your PATH", + "so that Sys.which('", util, "')", + "returns the path to the utility.") + ) + } +} + + + + +#' Downloads encoding dictionaries for use with ukb_util_conv. +#' +#' @param out_dir The output directory to download the UKB utility to. Default \code{tempdir()}. +#' +# #' @rdname ukb_util_get +#' @export +ukb_util_encoding <- function(out_dir = tempdir()) { + res = ukb_util_get(util = "encoding.ukb", + download = TRUE, + out_dir = out_dir) +} + + + + +#' Calculates size and MD5 of a UKB utlity file. +#' +#' @param file Path to file to run MD5 utility on. +#' @param ... Additional arguments to pass to +#' \code{\link{ukb_util_get}}. +#' +#' @return A character string +#' +#' @export +ukb_util_md5 <- function(file, ...) { + path = ukb_util_get("ukbmd5", ...) + out = system2(path, args = file, stdout = TRUE) + out = out[grepl("MD5=", out)] + out = sub(".*MD5=", "", out) + return(out) +} + + + + +#' Unpacks (decrypts and decompresses) UKB data. +#' +# #' @rdname ukb_util_md5 +#' @param file Path to file to unpack/decrypt. +#' @param key file to key to unpack/decrypt file +#' @param ... Additional arguments to pass to +#' \code{\link{ukb_util_get}}. +#' @export +ukb_util_unpack <- function(file, key, ...) { + path = ukb_util_get("ukbunpack", ...) + out = system2(path, c(file, key)) + if (out != 0) { + warning("Unpacking did not seem to complete successfully") + } + out = paste0(file, "_ukb") + return(out) +} + + + + +#' Converts unpacked UKB data to other formats. +#' +# #' @rdname ukb_util_md5 +#' @param file Path to decrypted file to convert. +#' @param type Type of conversion to do. +#' @param encoding_file encoding file to map for `ukbconv`. If want no +#' encoding, set to \code{NULL} +#' @param ... Additional arguments to pass to +#' \code{\link{ukb_util_get}}. +#' @export +ukb_util_conv <- function(file, + type = c("r", "docs", + "csv", "sas", + "stata", + "lims", "bulk", + "txt"), + encoding_file = "encoding.ukb", + ...) { + type = match.arg(type) + if (!is.null(encoding_file)) { + url = paste0("http://biobank.ndph.ox.ac.uk/showcase/util/", + "encoding.ukb") + if (!file.exists(encoding_file)) { + utils::download.file(url, destfile = encoding_file, + mode = "wb") + } + } + path = ukb_util_get("ukbconv", ...) + args = c(file, type) + # if not default file + if (!is.null(encoding_file) && encoding_file != "encoding.ukb") { + args = c(args, "-E", encoding_file) + } + out = system2(path, args) + + if (out != 0) { + warning("Convert did not seem to complete successfully") + } + + return(out) +} + + + + +#' Downloads approved bulk data files. +#' +# #' @rdname ukb_util_md5 +#' @param file Path to bulk file +#' @param key Path to key file. +#' @param start start of the fetching, 1-indexed +#' @param out_dir output directory of download +#' @param ... Additional arguments to pass to +#' \code{\link{ukb_util_get}}. +#' @export +ukb_util_fetch <- function(file, key, start = NULL, out_dir = NULL, ...) { + stopifnot(file.exists(file)) + + file = normalizePath(file, mustWork = TRUE, winslash = "/") + key = normalizePath(key, mustWork = TRUE, winslash = "/") + + if (nchar(file) > 64) { + warning("File may be too long > 64 characters") + } + + if (nchar(key) > 64) { + warning("Key file may be too long > 64 characters") + } + + owd = getwd() + if (!is.null(out_dir)) { + setwd(out_dir) + on.exit({ + setwd(owd) + }, add = TRUE) + } + + n_max = 1000 + if (is.null(start)) { + x = readLines(file) + n = length(x) + if (n > n_max) { + start = (seq(0, ceiling(n / n_max) -1) * n_max) + 1 + } else { + start = 1 + } + } + + path = ukb_util_get("ukbfetch", ...) + bfile = paste0("-b", file) + akey = paste0("-a", key) + + starts = paste0("-s", start) + x = starts[1] + num = paste0("-m", n_max) + res = sapply(starts, function(x) { + out = system2(path, c(bfile, akey, x, num)) + if (out != 0) { + warning("Convert did not seem to complete successfully") + } + out + }) + return(res) +} diff --git a/man/ukb_df.Rd b/man/ukb_df.Rd index 2f1bfed..87abbf3 100644 --- a/man/ukb_df.Rd +++ b/man/ukb_df.Rd @@ -4,7 +4,14 @@ \alias{ukb_df} \title{Reads a UK Biobank phenotype fileset and returns a single dataset.} \usage{ -ukb_df(fileset, path = ".", n_threads = "dt", data.pos = 2) +ukb_df( + fileset, + path = ".", + n_threads = "dt", + data.pos = 2, + temporary = FALSE, + withdraw_file = NULL +) } \arguments{ \item{fileset}{The prefix for a UKB fileset, e.g., ukbxxxx (for ukbxxxx.tab, ukbxxxx.r, ukbxxxx.html)} @@ -14,6 +21,12 @@ ukb_df(fileset, path = ".", n_threads = "dt", data.pos = 2) \item{n_threads}{Either "max" (uses the number of cores, `parallel::detectCores()`), "dt" (default - uses the data.table default, `data.table::getDTthreads()`), or a numerical value (in which case n_threads is set to the supplied value, or `parallel::detectCores()` if it is smaller).} \item{data.pos}{Locates the data in your .html file. The .html file is read into a list; the default value data.pos = 2 indicates the second item in the list. (The first item in the list is the title of the table). You will probably not need to change this value, but if the need arises you can open the .html file in a browser and identify where in the file the data is.} + +\item{temporary}{Should the `R` file be copied to a temporary directory? +Useful for permissions issues, especially on computing clusters.} + +\item{withdraw_file}{file of identifiers of those who have +withdrawn from UK Biobank to exclude from the data set.} } \value{ A dataframe with variable names in snake_case (lowercase and separated by an underscore). diff --git a/man/ukb_df_full_join.Rd b/man/ukb_df_full_join.Rd index b463fbe..3054281 100644 --- a/man/ukb_df_full_join.Rd +++ b/man/ukb_df_full_join.Rd @@ -15,7 +15,7 @@ ukb_df_full_join(..., by = "eid") A thin wrapper around \code{purrr::reduce} and \code{dplyr::full_join} to merge multiple UKB datasets. } \details{ -The function takes a comma separated list of unquoted datasets. By explicitly setting the join key to "eid" only (Default value of the \code{by} parameter), any additional variables common to any two tables will have ".x" and ".y" appended to their names. If you are satisfied the additional variables are identical to the original, the copies can be safely deleted. For example, if \code{setequal(my_ukb_data$var, my_ukb_data$var.x)} is \code{TRUE}, then my_ukb_data$var.x can be dropped. A \code{dlyr::full_join} is like the set operation union in that all observations from all tables are included, i.e., all samples are included even if they are not included in all datasets. +The function takes a comma separated list of unquoted datasets. By explicitly setting the join key to "eid" only (Default value of the \code{by} parameter), any additional variables common to any two tables will have ".x" and ".y" appended to their names. If you are satisfied the additional variables are identical to the original, the copies can be safely deleted. For example, if \code{setequal(my_ukb_data$var, my_ukb_data$var.x)} is \code{TRUE}, then my_ukb_data$var.x can be dropped. A \code{dplyr::full_join} is like the set operation union in that all observations from all tables are included, i.e., all samples are included even if they are not included in all datasets. NB. \code{ukb_df_full_join} will fail if any variable names are repeated **within** a single UKB dataset. This is unlikely to occur, however, \code{ukb_df} creates variable names by combining a snake_case descriptor with the variable's **index** and **array**. If an index_array combination is incorrectly repeated, this will result in a duplicated variable. If the join fails, you can use \code{\link{ukb_df_duplicated_name}} to find duplicated names. See \code{vignette(topic = "explore-ukb-data", package = "ukbtools")} for further details. } diff --git a/man/ukb_util_conv.Rd b/man/ukb_util_conv.Rd new file mode 100644 index 0000000..ab4f75f --- /dev/null +++ b/man/ukb_util_conv.Rd @@ -0,0 +1,27 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/filehandlers.R +\name{ukb_util_conv} +\alias{ukb_util_conv} +\title{Converts unpacked UKB data to other formats.} +\usage{ +ukb_util_conv( + file, + type = c("r", "docs", "csv", "sas", "stata", "lims", "bulk", "txt"), + encoding_file = "encoding.ukb", + ... +) +} +\arguments{ +\item{file}{Path to decrypted file to convert.} + +\item{type}{Type of conversion to do.} + +\item{encoding_file}{encoding file to map for `ukbconv`. If want no +encoding, set to \code{NULL}} + +\item{...}{Additional arguments to pass to +\code{\link{ukb_util_get}}.} +} +\description{ +Converts unpacked UKB data to other formats. +} diff --git a/man/ukb_util_encoding.Rd b/man/ukb_util_encoding.Rd new file mode 100644 index 0000000..7ec1aee --- /dev/null +++ b/man/ukb_util_encoding.Rd @@ -0,0 +1,14 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/filehandlers.R +\name{ukb_util_encoding} +\alias{ukb_util_encoding} +\title{Downloads encoding dictionaries for use with ukb_util_conv.} +\usage{ +ukb_util_encoding(out_dir = tempdir()) +} +\arguments{ +\item{out_dir}{The output directory to download the UKB utility to. Default \code{tempdir()}.} +} +\description{ +Downloads encoding dictionaries for use with ukb_util_conv. +} diff --git a/man/ukb_util_fetch.Rd b/man/ukb_util_fetch.Rd new file mode 100644 index 0000000..8a7acbd --- /dev/null +++ b/man/ukb_util_fetch.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/filehandlers.R +\name{ukb_util_fetch} +\alias{ukb_util_fetch} +\title{Downloads approved bulk data files.} +\usage{ +ukb_util_fetch(file, key, start = NULL, out_dir = NULL, ...) +} +\arguments{ +\item{file}{Path to bulk file} + +\item{key}{Path to key file.} + +\item{start}{start of the fetching, 1-indexed} + +\item{out_dir}{output directory of download} + +\item{...}{Additional arguments to pass to +\code{\link{ukb_util_get}}.} +} +\description{ +Downloads approved bulk data files. +} diff --git a/man/ukb_util_get.Rd b/man/ukb_util_get.Rd new file mode 100644 index 0000000..ccbeaf6 --- /dev/null +++ b/man/ukb_util_get.Rd @@ -0,0 +1,30 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/filehandlers.R +\name{ukb_util_get} +\alias{ukb_util_get} +\title{Downloads individual UKB utlities and file handlers.} +\usage{ +ukb_util_get( + util = c("ukbmd5", "ukbconv", "ukbunpack", "ukbfetch", "ukblink", "ukbgene", + "encoding.ukb"), + download = TRUE, + out_dir = tempdir() +) +} +\arguments{ +\item{util}{Name of the utility. Must be one of \code{"ukbmd5"}, \code{"ukbconv"}, \code{"ukbunpack"}, \code{"ukbfetch"}, \code{"ukblink"}, \code{"ukbgene"}, \code{"encoding.ukb"}. For a description of the UKB utilies and file handlers, see \href{http://biobank.ndph.ox.ac.uk/showcase/download.cgi}{UKB Downloads}.} + +\item{download}{Should the utility be downloaded if not found? Default is \code{TRUE}.} + +\item{out_dir}{The output directory to download the UKB utility to. Default \code{tempdir()} - UKB utility and temporary directory will be deleted at the end of the current session.} +} +\value{ +Path to the downloaded utility. +} +\description{ +Downloads individual UKB utlities and file handlers. +} +\examples{ +md5 = ukb_util_get("ukbmd5") +file.remove(md5) +} diff --git a/man/ukb_util_md5.Rd b/man/ukb_util_md5.Rd new file mode 100644 index 0000000..78671fa --- /dev/null +++ b/man/ukb_util_md5.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/filehandlers.R +\name{ukb_util_md5} +\alias{ukb_util_md5} +\title{Calculates size and MD5 of a UKB utlity file.} +\usage{ +ukb_util_md5(file, ...) +} +\arguments{ +\item{file}{Path to file to run MD5 utility on.} + +\item{...}{Additional arguments to pass to +\code{\link{ukb_util_get}}.} +} +\value{ +A character string +} +\description{ +Calculates size and MD5 of a UKB utlity file. +} diff --git a/man/ukb_util_unpack.Rd b/man/ukb_util_unpack.Rd new file mode 100644 index 0000000..bebb820 --- /dev/null +++ b/man/ukb_util_unpack.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/filehandlers.R +\name{ukb_util_unpack} +\alias{ukb_util_unpack} +\title{Unpacks (decrypts and decompresses) UKB data.} +\usage{ +ukb_util_unpack(file, key, ...) +} +\arguments{ +\item{file}{Path to file to unpack/decrypt.} + +\item{key}{file to key to unpack/decrypt file} + +\item{...}{Additional arguments to pass to +\code{\link{ukb_util_get}}.} +} +\description{ +Unpacks (decrypts and decompresses) UKB data. +}