MyNixOS website logo
Description

KIR Genotype Imputation and Model Training from SNP Array Data.

A scalable and accurate tool for Killer-cell Immunoglobulin-like Receptor (KIR) genotype imputation directly from SNP array data using supervised machine learning models trained across five continental ancestry groups. Uses attribute bagging and an ensemble classifier method with haplotype inference for SNPs and KIR types. Models are built from global populations in the 1000 Genomes Project and validated across diverse biobank cohorts. Methods are based on Zheng et al. (2014) <doi:10.1016/j.ajhg.2013.12.015> and Sadeeq et al. (2026) <https://github.com/NormanLabUCD/PONG2>.

PONG2 – KIR Genotype Imputation & Model Training

R License: GPL v3 GitHub release

PONG2 is an R package with C++ acceleration (via Rcpp) for high-accuracy imputation and training of Killer-cell Immunoglobulin-like Receptor (KIR) genotypes from SNP array data in the KIR locus (chromosome 19q13.4).

It is optimized for population genetics, immunogenetics, and large-scale biobank studies requiring reliable KIR allele calls across diverse ancestries.

Main CLI commands:

  • impute – predict KIR alleles from target PLINK files
  • train – build a new prediction model from reference genotypes + known KIR calls

Table of Contents


Overview

PONG2 enables scalable and accurate KIR genotyping by combining:

  • Region-specific PLINK2 preprocessing
  • Optional local minimac4 pre-imputation for missing variants
  • Supervised allele prediction models tailored to the highly polymorphic KIR region

It supports both hg19 and hg38 assemblies and is particularly useful for studying immune response variation, HLA–KIR interactions, and disease associations in diverse populations.


Features

  • Multi-ancestry pre-trained models (EUR, AMR, AFR, EAS, SAS)
  • Automatic handling of hg19 / hg38 coordinate differences
  • Configurable SNP missingness threshold
  • Built-in local imputation fallback (--fill-missing) using minimac4
  • Support for external pre-imputation (e.g. Michigan Imputation Server)
  • Multi-threading via --threads
  • Automatic chunked prediction for large biobank datasets (>2,000 samples)
  • Force-run mode for low SNP match scenarios
  • Clean separation of preprocessing and prediction steps

Requirements

R version: ≥ 4.0

Required R packages (loaded at runtime):

  • readr
  • tidyverse
  • parallel

System tools (must be in PATH):

ToolVersionRequired
PLINK2≥ 2.0Always
minimac4≥ 4.1.6Only with --fill-missing
bgzip & tabixHTSlibOnly with --fill-missing
Eagle2≥ 2.4Only for pre-phasing before --fill-missing

Installation

From GitHub (recommended)

# Install remotes if needed
if (!require("remotes", quietly = TRUE)) install.packages("remotes")

# Install PONG2 from GitHub
remotes::install_github("NormanLabUCD/PONG2")

From CRAN

install.packages("PONG2")

From source tarball

Download PONG2_1.0.0.tar.gz then:

# Standard install
R CMD INSTALL PONG2_1.0.0.tar.gz

# Custom library path
R CMD INSTALL --library=/your/custom/path PONG2_1.0.0.tar.gz

CLI Setup

After installation, add the pong2 command-line tool to your terminal PATH. Run the following once in your terminal:

# Run once after installation
PONG2_PATH=$(Rscript -e "cat(dirname(system.file('scripts', 'pong2', package='PONG2')))")
echo "export PATH=\"$PONG2_PATH:\$PATH\"" >> ~/.bashrc && source ~/.bashrc
pong2 --help

HPC users: Add the export PATH line to your job submission script or ~/.bashrc on the cluster to ensure pong2 is available in all sessions.

Note: You only need to do this once. After adding to ~/.bashrc, pong2 will be available in all future terminal sessions automatically.


Usage

pong2 <command> [options]

Help

pong2 --help              # General overview + list of commands
pong2 --help impute       # Detailed help for imputation
pong2 --help train        # Detailed help for training
pong2 version             # Show version number

impute command

Predict KIR alleles from a target PLINK dataset.

pong2 impute [options]

Required flags

FlagDescriptionExample
-i, --bfilePLINK bed/bim/fam prefix (chr19)data/chr19
-o, --outputOutput directoryresults/imputation
-l, --locusKIR locus to imputeKIR3DL1
-a, --assemblyGenome buildhg19 or hg38

Optional flags

FlagDefaultDescription
--filter0.005Allele frequency filter threshold (0.005 or 0.01)
-t, --threads4Number of CPU threads
-f, --forcefalseProceed even if SNP matching rate is low (<50%)
--fill-missingfalseImpute missing SNPs locally with minimac4 (requires --vcf)
--vcfPre-phased VCF file required when using --fill-missing

Examples

# Basic imputation
pong2 impute -i example/chr19 -o output -l KIR3DL1 -a hg19

train command

Build a new KIR prediction model from reference genotypes and known KIR calls.

pong2 train [options]

Required flags

FlagDescriptionExample
-i, --bfileReference PLINK bed/bim/fam prefixdata/chr19
-k, --kfileCSV with sample IDs and KIR allele callsdata/kir_calls.csv
-o, --outputDirectory to save trained modelmodels/KIR3DL1
-l, --locusKIR locus to trainKIR3DL1
-a, --assemblyGenome buildhg19 or hg38

Optional flags

FlagDefaultDescription
-t, --threads4Number of CPU threads
--nclassifier100Number of ensemble classifiers
--split0.7Train/validation split proportion
--kirmaf0.00Minimum KIR allele frequency filter
--mac3Minimum allele count for SNPs
-r, --regionOptimized defaultCustom KIR region (e.g. 55281035-55295784)

KIR file format

The KIR file (--kfile) must be a CSV with the following structure:

SampleKIR3DL1_h1KIR3DL1_h2KIR2DL1_h1KIR2DL1_h2
HG00096KIR3DL1*001KIR3DL1*002KIR2DL1*00302KIR2DL1*00201
HG00097KIR3DL1*005KIR3DL1*015KIR2DL1*00302KIR2DL1*05101

Example

pong2 train --bfile example/chr19 --kfile example/kir_call.csv --output test --locus KIR3DL1 --assembly hg19 --nclassifier 50

Improving Imputation Accuracy

NOTE:

KIR Region SNP Overlap between input data and 1KGP

Overlap rate is computed between your input data and the 1000 Genomes Project (1KGP) reference panel in the KIR region (chr19).

Overlap RateStatusAction
≥ 50%PassProceed with PONG2 directly
< 50%FailRun Eagle2 + minimac4 pre-imputation first

If your SNP matching rate is below 50%, PONG2 provides two strategies:

Option A: Local pre-imputation with minimac4 (built-in)

Pre-phase your data with Eagle2, then run PONG2 with --fill-missing:

# Step 1: Pre-phase with Eagle2
eagle \
  --bfile=chr19 \
  --geneticMapFile=genetic_map_hg19.txt.gz \
  --outPrefix=chr19.phased \
  --chrom=19 \
  --numThreads=20 \
  --bpStart=55000000 \
  --bpEnd=55400000

# Step 2: Run PONG2 with fill-missing
pong2 impute \
  --vcf chr19.phased.vcf.gz \
  -o output \
  -l KIR3DL1 \
  -a hg19 \
  --fill-missing \
  -t 20

Note: A pre-phased VCF (--vcf) is required with --fill-missing.

Option B: External pre-imputation (recommended for highest accuracy)

Pre-impute your chr19 data using a public imputation server before running PONG2:


Input & Output Formats

Input

FileFormatDescription
PLINK bfile.bed/.bim/.famGenotype data for chr19
KIR file.csvSample IDs + phased KIR allele calls (train only)
VCF.vcf.gz (bgzipped + tabixed)Pre-phased VCF (required with --fill-missing)

Output

FileDescription
KIR/<locus>.csvPredicted KIR alleles per sample
KIR/<locus>.RDataFull prediction object (alleles + probabilities)
<locus>_model.RDataTrained model object (train only)
<locus>_test.RDataTest genotypes (train only, when --split < 1)

Dependencies & External Tools

ToolPurposeInstall
PLINK2Genotype preprocessingplink2
Eagle2Pre-phasing for imputationEagle
minimac4Local SNP imputationminimac4
bgzip/tabixVCF compression & indexingHTSlib

Troubleshooting

ErrorLikely CauseFix
--vcf is required with --fill-missingNo VCF providedSupply pre-phased VCF with --vcf
High missing rateSNP overlap < 50%Run Eagle2 + minimac4, or use --force
No model found for locusUnsupported locus or wrong filterCheck locus name and --filter value
incorrect number of dimensionsToo few training samplesVerify sample overlap between KIR and PLINK files
plink2 not foundNot in PATHAdd plink2 to PATH
pong2: command not foundCLI not in PATHRe-run CLI Setup steps above

License

PONG2 is licensed under the GNU General Public License v3.0 (GPL-3.0).

You are free to use, modify, and distribute PONG2, provided that derivative works are distributed under the same license. See LICENSE for details.


Citation

If you use PONG2 in your research, please cite:

Sadeeq SA, Leaton LA, Kichula KM, Farias TDJ, Font-Porterias N, Pollock NR, the Colorado Center for Personalized Medicine, Collora CE, Castelli EC, Gignoux CR, Norman PJ. PONG 2.0: Allele Imputation for the Killer Cell Immunoglobulin-Like Receptors.Manuscript in preparation, 2026.


Contact & Support

We aim to respond to issues and emails within 1–3 business days. Thank you for using PONG2 — happy KIR analysis! 🧬

Metadata

Version

1.0.1

License

Unknown

Platforms (79)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    wasip1
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasip1
  • wasm64-wasip1
  • x86_64-cygwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows