alleleTools.format.ukb2allele module

UK Biobank to Allele Table Conversion Module.

This module converts UK Biobank HLA imputation data into standardized allele table format. It handles the specific data structure and probability thresholds used by UK Biobank, including filtering based on allele abundance and handling of homozygous/heterozygous calls.

Author: Nicolás Mendoza Mejía (2025)

alleleTools.format.ukb2allele.call_function(args)[source]

Main function to execute UK Biobank to allele table conversion.

This function orchestrates the conversion process by: 1. Loading UK Biobank HLA imputation data 2. Loading phenotype information 3. Converting to standardized allele format 4. Optionally filtering out individuals with phenotype 0 5. Saving results to output file

Parameters:

args – Parsed command line arguments containing: - input: Path to UK Biobank CSV file with HLA data - phenotype: Path to phenotype file (space-separated) - output: Path to output allele table file - remove_pheno_zero: Whether to exclude phenotype 0 individuals

alleleTools.format.ukb2allele.setup_parser(subparsers)[source]

Set up the argument parser for the ukb2allele command.

Parameters:

subparsers – The subparsers object to add this command to.

Returns:

The configured parser for ukb2allele.

Return type:

argparse.ArgumentParser