{"id":13592982,"url":"https://github.com/kenhanscombe/ukbtools","last_synced_at":"2025-04-10T03:51:47.229Z","repository":{"id":56936906,"uuid":"82282787","full_name":"kenhanscombe/ukbtools","owner":"kenhanscombe","description":"An R package to manipulate and explore UK Biobank data","archived":false,"fork":false,"pushed_at":"2023-02-22T09:51:20.000Z","size":11729,"stargazers_count":103,"open_issues_count":3,"forks_count":26,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-10T03:51:34.092Z","etag":null,"topics":["biobank","kcl-sgu","r","uk-biobank","ukb"],"latest_commit_sha":null,"homepage":"https://kenhanscombe.github.io/ukbtools/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kenhanscombe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-02-17T09:53:22.000Z","updated_at":"2025-03-30T19:55:50.000Z","dependencies_parsed_at":"2022-08-21T07:20:36.033Z","dependency_job_id":"35d59691-a39a-4b12-83b4-83961e70489a","html_url":"https://github.com/kenhanscombe/ukbtools","commit_stats":{"total_commits":287,"total_committers":2,"mean_commits":143.5,"dds":"0.010452961672473893","last_synced_commit":"d0e3248eae12429b4dbc2c278960367df19a3511"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenhanscombe%2Fukbtools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenhanscombe%2Fukbtools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenhanscombe%2Fukbtools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenhanscombe%2Fukbtools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kenhanscombe","download_url":"https://codeload.github.com/kenhanscombe/ukbtools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248154998,"owners_count":21056542,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["biobank","kcl-sgu","r","uk-biobank","ukb"],"created_at":"2024-08-01T16:01:15.372Z","updated_at":"2025-04-10T03:51:47.202Z","avatar_url":"https://github.com/kenhanscombe.png","language":"HTML","funding_links":[],"categories":["Data processing"],"sub_categories":["Optical coherence tomography and fundus"],"readme":"ukbtools \u003cimg src='man/figures/logo.png' align=\"right\" height=\"137.5\" /\u003e\n===\n\n\u003c!-- badges: start --\u003e\n[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/ukbtools)](https://cran.r-project.org/package=ukbtools)\n[![codecov](https://codecov.io/gh/kenhanscombe/ukbtools/branch/master/graph/badge.svg?token=4MMpYxggFt)](https://codecov.io/gh/kenhanscombe/ukbtools)\n[![R-CMD-check](https://github.com/kenhanscombe/ukbtools/workflows/R-CMD-check/badge.svg)](https://github.com/kenhanscombe/ukbtools/actions)\n\u003c!-- badges: end --\u003e\n\n\u003e **NB. With the advent of the UKB RAP, this package is no longer supported or under active development.**\n\nAfter downloading and decrypting your UK Biobank (UKB) data with the supplied [UKB programs] (http://biobank.ctsu.ox.ac.uk/crystal/docs/UsingUKBData.pdf), you have multiple files that need to be brought together to give you a dataset to explore. The data file has column names that are edited field-codes from the [UKB data showcase](http://www.ukbiobank.ac.uk/data-showcase/). ukbtools makes it easy to collapse the multiple UKB files into a single dataset for analysis, in the process giving meaningful names to the variables. The package also includes functionality to retrieve ICD diagnoses, explore a sample subset in the context of the UKB sample, and collect genetic metadata.\n\n## Installation\n\n```r\n# Install from CRAN\ninstall.packages(\"ukbtools\")\n\n# Install latest development version\ndevtools::install_github(\"kenhanscombe/ukbtools\", dependencies = TRUE)\n```\n\n## Prerequisite: Make a UKB fileset\n\nDownload\u003csup\u003e§\u003c/sup\u003e then decrypt your data and create a \"UKB fileset\" (.tab, .r, .html):\n\n```bash\nukb_unpack ukbxxxx.enc key\nukb_conv ukbxxxx.enc_ukb r\nukb_conv ukbxxxx.enc_ukb docs\n```\n\n`ukb_unpack` decrypts your downloaded `ukbxxxx.enc` file, outputting a `ukbxxxx.enc_ukb` file. `ukb_conv` with the `r` flag converts the decrypted data to a tab-delimited file `ukbxxxx.tab` and an R script `ukbxxxx.r` that reads the tab file. The `docs` flag creates an html file containing a field-code-to-description table (among others).\n\n\n\u003csup\u003e§\u003c/sup\u003e Full details of the data download and decrypt process are given in the [Using UK Biobank Data](http://biobank.ctsu.ox.ac.uk/crystal/docs/UsingUKBData.pdf) documentation.\n\n\n\n\n## Make a UKB dataset\n\nThe function `ukb_df()` takes two arguments, the stem of your fileset and the path, and returns a dataframe with usable column names. This will take a few minutes. The rate-limiting step is reading and parsing the code in the UKB-generated .r file - not `ukb_df` per se.\n\n```r\nlibrary(ukbtools)\nmy_ukb_data \u003c- ukb_df(\"ukbxxxx\")\n```\n\nYou can also specify the path to your fileset if it is not in the current directory. For example, if your fileset is in a subdirectory of the working directory called data\n\n```r\nmy_ukb_data \u003c- ukb_df(\"ukbxxxx\", path = \"/full/path/to/my/data\")\n```\n\n__Note:__ You can move the three files in your fileset after creating them with `ukb_conv`, but they should be kept together. `ukb_df()` automatically updates the read call in the R source file to point to the correct directory (the current directory by default, or a directory specified by `path`).\n\n## Other tools\n\nAll tools are described on the [ukbtools webpage](https://kenhanscombe.github.io/ukbtools/) and in the package vignette \"Explore UK Biobank Data\"\n\n```r\nvignette(\"explore-ukb-data\", package = \"ukbtools\")\n```\nFor a list of all functions\n\n```r\nhelp(package = \"ukbtools\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenhanscombe%2Fukbtools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkenhanscombe%2Fukbtools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenhanscombe%2Fukbtools/lists"}