Software report · preprint, not peer reviewedOpen access

lpa-wgs: LPA KIV-2 copy number and Lp(a) variants from whole-genome sequencing

Peter Jungwirth, MSc1✉

Affiliations and notes
  1. 1 PJ Labs, Austria
  2. Correspondence: info@pjlabs.dev
  3. Lead contact: Peter Jungwirth, MSc
Article information
Publication history
Published 3 December 2026
Peer review
not peer reviewed
Version
0.1.0
Licence
MIT
Version
0.1.0
Published
3 December 2026

Highlights

  • One program without external tools at run time: FASTQ, BAM or CRAM on GRCh38 or GRCh37 in; KIV-2 copies with an interval and three Lp(a) variants out
  • KIV-2 copy number within one copy for 104 of 145 check genomes; mean error 0.75 copies against 3.44 for KILDA
  • On 57 unseen genomes, measured once: mean error 0.75 copies against 3.75 for KILDA, 0 wrong genotypes
  • Accuracy holds at lower depth: 1.15 copies at 5×
  • No wrong genotype at any depth; uncertain genotypes are marked, not guessed
  • Research use only

In brief lpa-wgs estimates the number of KIV-2 repeats in LPA from short-read whole-genome sequencing with a 95 % interval, splits the copies between the two alleles where the reads allow it and genotypes three Lp(a) variants. It is a research tool and does not measure the Lp(a) level.

Summary

The plasma level of lipoprotein(a) is largely set by the gene LPA: by the number of kringle IV type 2 (KIV-2) repeats, which sets the size of apolipoprotein(a), and by a few variants. The KIV-2 repeats are 5.5 kb long and nearly identical, so short reads cannot be placed among them. lpa-wgs is a single Rust program that reads paired FASTQ, BAM or CRAM and estimates the KIV-2 copy number from the depth of 2,737 31-mers that occur in every KIV-2 copy, against the depth of single-copy 31-mers of LPA; it adds a 95 % interval, a split between the two alleles where the reads allow it, and the genotypes of rs10455872, rs3798220 and rs41272114. It was measured against haplotype-resolved assemblies of the Human Pangenome Reference Consortium [5]. On 145 check samples the mean absolute error was 0.75 copies, against 3.44 for KILDA [4]; the interval covered the truth in 143 of 145, and none of 434 genotypes was wrong. On 57 unseen samples, measured once with the frozen version, it was 0.75 copies (KILDA 3.75).

Graphical abstract

01Panel, at every startGRCh38 window of LPA, 580 allele markers, genome filter02InputFASTQ (pair, single, stream) or BAM/CRAM with index03Countcanonical 31-mers per read against the panel04KIV-2 copies2 × mean KIV-2 / mean single-copy; 95 %: 10-kb blocks05Allelesmarker / KIV-2 depth; peaks p and 1 − p; ≥ 40 markers06Genotypesone vote per read, binomial; GQ < 20: uncertain07Outputcopies, interval, alleles, genotypes, run log

Keywords

  • LPA
  • lipoprotein(a)
  • Lp(a)
  • KIV-2
  • copy number
  • whole-genome sequencing
  • k-mer
  • HPRC
  • HGSVC
  • KILDA
  • Rust

Introduction

Lipoprotein(a) is a causal risk factor for atherosclerotic cardiovascular disease and aortic stenosis, and its plasma level is mostly genetic [1]. The size of apolipoprotein(a) is set by the number of kringle IV type 2 (KIV-2) repeats in LPA; small isoforms go with high levels [1]. Two variants, rs10455872 and rs3798220, raise the level [2], and the splice-site variant rs41272114 is a null allele that lowers it [3].

The KIV-2 repeats are 5.5 kb each and nearly identical, so short reads give no position within the block, but their number shows in the depth. KILDA estimates the KIV-2 copy number from 31-mers of whole-genome reads [4]. The haplotype-resolved assemblies of the Human Pangenome Reference Consortium (HPRC) [5] contain the whole KIV-2 block of both haplotypes for samples that also have 30× short reads of the 1000 Genomes Project [6]. This gives a truth that is independent of any program: the number of KIV-2 copies of each haplotype and the alleles of the three variants.

lpa-wgs follows the design of hla-wgs [7] and kir-wgs [8]: one Rust program, a truth from assemblies, a check set that decides every change, and an unseen set measured once.

Results

Design

lpa-wgs is one Rust program without run-time dependencies (Figure 1). It reads paired FASTQ files, one FASTQ or a coordinate-sorted BAM or CRAM on GRCh38 or GRCh37; from alignments it takes the LPA window and the unmapped reads. It reports the KIV-2 copy number of both chromosomes together with a 95 % interval, where the reads allow it the copies of each allele, and the genotypes of the three variants with a quality. It writes TSV, JSON, a report part for a combined genome report, a result page in German and English, and a run log of every step and decision.

01Panel, at every startGRCh38 window of LPA, 580 allele markers, genome filter02InputFASTQ (pair, single, stream) or BAM/CRAM with index03Countcanonical 31-mers per read against the panel04KIV-2 copies2 × mean KIV-2 / mean single-copy; 95 %: 10-kb blocks05Allelesmarker / KIV-2 depth; peaks p and 1 − p; ≥ 40 markers06Genotypesone vote per read, binomial; GQ < 20: uncertain07Outputcopies, interval, alleles, genotypes, run log
Figure 1. How lpa-wgs works. At every start, the panel of 31-mers is derived from the built-in GRCh38 window of LPA. For every sample, the reads are scanned once; KIV-2 copies, the allele split and the genotypes are computed from the counts. Every step and every decision is written to the run log. The full picture as an interactive page: docs/ablauf.html in the repository.

Copy number

The estimate was compared with the sum of KIV-2 copies of both assembled haplotypes (Figures 2 and 3, Table 1). On 78 development samples the mean absolute error was 0.76 copies (KILDA 3.59). On 145 check samples it was 0.75 copies with a median error of −0.05; 104 were within one copy and 139 within two, and the largest error was 3.1. KILDA had a mean absolute error of 3.44 with a median of −3.25: it undercounts, and 5 of 145 were within one copy. The 95 % interval of lpa-wgs covered the truth in 143 of 145 check samples.

On the 57 unseen HGSVC samples, measured once with the frozen version, the mean absolute error was 0.75 copies (KILDA 3.75), 42 of 57 were within one copy and the 95 % interval covered the truth in 56 of 57. 170 of 170 genotypes were right, 0 uncertain and 0 wrong.

lpa-wgs101020203030404050506060KIV-2 copies, truth (both haplotypes)KILDA101020203030404050506060KIV-2 copies, truth (both haplotypes)estimate
Figure 2. Estimate against truth. KIV-2 copies of both haplotypes in the assemblies (x) and the estimate from 30× short reads (y), for lpa-wgs and KILDA on the same reads, 145 check samples. Dashed: estimate equals truth.
−10−8−6−4−20+2+4Development (78)Check (145)Unseen (57)estimate minus truth, KIV-2 copieslpa-wgsKILDA
Figure 3. Error per sample. Estimate minus truth in KIV-2 copies for every sample of the development (78), check (145) and unseen (57) sets, lpa-wgs and KILDA on the same reads. Box: lower to upper quartile, line: median, whiskers: last value within 1.5 × the interquartile range, circles: values beyond. Drawn from validation/results/dev_points.tsv, check_points.tsv and unseen_points.tsv.
Table 1. KIV-2 copy number against both assembled haplotypes.
SetToolSamplesMean abs. errorMedian errorWithin 1Within 2Interval covers
Developmentlpa-wgs780.76+0.05587478 / 78
KILDA783.59−3.59010–
Checklpa-wgs1450.75−0.05104139143 / 145
KILDA1453.44−3.25519–
Unseenlpa-wgs570.75−0.21425556 / 57
KILDA573.75−3.8306–

Errors in copies. Within 1 and 2: samples with an absolute error of at most one or two copies. Interval covers: samples whose truth lies in the 95 % interval of lpa-wgs; KILDA gives no interval.

Alleles

The two alleles of LPA can carry very different numbers of KIV-2 copies. lpa-wgs uses 580 31-mers that cover nearly all KIV-2 copies of some haplotypes and are missing in others; when their counts form two groups with enough support, it reports the copies of each allele. This was the case for 63 of 145 check samples, with a mean absolute error of the smaller allele of 1.07 copies (56 within two copies). For the other samples it reports no split.

Genotypes

Each read votes for the reference or the alternative allele of a variant by the 31-mers it shares with either; a binomial model on the votes gives the genotype and a quality, and genotypes below quality 20 are reported as uncertain. On the check samples, 434 of 434 genotypes were right and 0 wrong. KILDA calls a carrier when one alternative 31-mer is seen; that rule was wrong in 1 of 434 calls.

Lower sequencing depth

A fixed pseudo-random part of the read pairs was kept for about 15×, 10× and 5× (Figure 4). The mean absolute error of lpa-wgs on the check samples rose to 0.87, 0.95 and 1.15 copies (KILDA 3.42, 3.50 and 3.57); the interval covered the truth in 144, 145 and 145 of 145. No genotype was wrong at any depth; at 5×, 250 of 434 were uncertain.

0123430×0.753.4415×0.873.4210×0.953.505×1.153.57mean absolute error, KIV-2 copieslpa-wgsKILDA
Figure 4. Lower depth. Mean absolute error of the KIV-2 copy number on the 145 check samples at 30× and after keeping a fixed half, third and sixth of the read pairs; both programs on the same reads. Lines: 95 % interval of the mean (1.96 standard errors over the samples), from validation/results/depth/*_check_points.tsv.

Other inputs

On three 1000 Genomes phase 3 alignments on GRCh37 [9] (4 to 7×, 100-bp reads, window only), the mean absolute error was 0.89 copies, the interval covered the truth in 3 of 3, and 0 genotypes were wrong. On all reads of 2 whole-genome CRAM files the mean absolute error was 0.14 copies (KILDA 1.95). A CRAM and a BAM of the same reads give the same result.

Run time

On a MacBook Air (Apple M5, 16 GB) with HG002 at 30× (truth 38 KIV-2 copies), lpa-wgs needed 0.43 s for the BAM file (median of three runs, 58 MB of memory) and 263 s for the FASTQ pair with 4 threads (median of three runs, 57 MB; 655 s on one thread, identical output). KILDA, run with the commands of its pipeline and the same 4 threads, needed 5,683 s for the BAM file, of which 2,686 s for the conversion of the whole file to FASTQ (7.3 GB of memory), and 2,873 s for the FASTQ pair (824 MB). lpa-wgs reported 38.2 (BAM) and 37.9 (FASTQ) copies, KILDA 33.9 and 33.9.

Discussion

The KIV-2 block is a tandem of nearly identical repeats, so the number of copies can only be read from the depth. lpa-wgs counts all 31-mers that occur in every KIV-2 copy of GRCh38, including those with no read, and divides by the depth of single-copy 31-mers of the same gene; 31-mers that also occur elsewhere in GRCh38 are left out, so that whole-genome reads from other places do not add to the count. With these choices the estimate has no bias against the truth, and the remaining error comes mostly from the uneven depth along the gene, which is also what the interval is built from.

KILDA counts fewer copies than the truth on the same reads. The difference is systematic, which points to its normalisation rather than to the data. The genotypes of lpa-wgs were right for all known alleles at every depth; the carrier rule of KILDA, one alternative 31-mer, turns single sequencing errors into carriers.

Limitations of the study

  • The truth comes from assemblies of the HPRC and HGSVC samples, mostly from the 1000 Genomes populations; other populations and other sequencing platforms were not measured.
  • The allele split works only for haplotypes whose KIV-2 copies differ at the marker 31-mers, which leaves more than half of the samples without a split.
  • lpa-wgs reports copies and variants, not the Lp(a) level, which also depends on other variants and on non-genetic factors and needs a blood test.
  • The samples are not independent draws of the population, so the numbers describe these samples.

Resource availability

Lead contact

Requests for further information and resources should be directed to the lead contact, Peter Jungwirth (info@pjlabs.dev).

Materials availability

This study did not generate new materials.

Data and code availability

The source code of lpa-wgs and lpa-wgs-validate, the sample lists, the truth and all result tables are available at github.com/pjlabsdev/lpa-wgs under the MIT licence, release v0.1.0. Archived on Zenodo: doi:10.5281/zenodo.24794404 (all versions).

The HPRC and HGSVC assemblies and the 1000 Genomes alignments are public. The panel of 31-mers is derived from the GRCh38 window of LPA built into the program; no reference data has to be downloaded.

Acknowledgments

The author thanks the Human Pangenome Reference Consortium, the Human Genome Structural Variation Consortium and the 1000 Genomes Project for making their data available, and the authors of KILDA for their program.

Author contributions

P.J. conceived the project, developed the software, carried out the validation and wrote the report.

Declaration of interests

The author declares no competing interests.

Methods

Key resources table

ResourceVersionSource
Deposited data
1000 Genomes, high-coverage genomesNYGC 30×internationalgenome.org
1000 Genomes phase 3 alignmentsGRCh37internationalgenome.org
HPRC assemblies223 sampleshumanpangenome.org
HGSVC assembliesHGSVC3, 57 sampleshgsvc.org
Reference genomeGRCh38LPA window built into the program
Software and algorithms
lpa-wgs0.1.0github.com/pjlabsdev/lpa-wgs
KILDAcommit 74075935github.com/HCL-HUBL/KILDA
jellyfish2.3.1github.com/gmarcais/Jellyfish

Data and study participant details

No new human samples were collected and no patient data were used. Public data: 1000 Genomes high-coverage genomes [6], HPRC assemblies [5], HGSVC3 assemblies [10] and three 1000 Genomes phase 3 alignments on GRCh37 [9]. 223 HPRC samples were split into 78 development and 145 check samples; 57 HGSVC3 samples that are not among the HPRC samples form the unseen set.

Method details

Panel

The program carries the GRCh38 window chr6:160,450,000-160,700,000. At every start it derives the canonical 31-mers that occur exactly six times in the window with a spacing of 5.0 to 6.0 kb (one in each KIV-2 copy of GRCh38; 2,737 after the genome filter), the 31-mers that occur once in LPA outside the KIV-2 block (normalisation), and for each variant the reference and alternative 31-mers that cover it. 31-mers that also occur elsewhere in GRCh38 with its ALT, decoy and HLA contigs are left out.

Copy number and interval

Each KIV-2 31-mer occurs once in every KIV-2 copy, so its count is the number of copies of both chromosomes times the depth of one chromosome. The KIV-2 copy number is 2 × the mean count of the KIV-2 31-mers, zeros included, divided by the mean count of the normalisation 31-mers. The interval is 1.96 × the copy number × the coefficient of variation of the normalisation depth between 10-kb blocks of LPA with at least 2,000 31-mers.

Allele split

For each of the 580 marker 31-mers, the fraction of the KIV-2 copies it covers is its count over the KIV-2 depth. Fractions between 0.08 and 0.92 are grouped around a split p and 1 − p, p from 0.08 to 0.50, within ±0.03; the best split needs at least 40 markers in its weaker group, and the smaller allele is p × the copy number.

Quick start

# build from source (or download the package of your system from the release)
git clone https://github.com/pjlabsdev/lpa-wgs && cd lpa-wgs
cargo build --release

# one sample: indexed BAM or CRAM, or paired FASTQ
lpa-wgs SAMPLE.cram out/SAMPLE 8 GRCh38.fa
lpa-wgs R1.fq.gz R2.fq.gz out/SAMPLE

Truth and evaluation

For each haplotype the contig spanning chr6:160,525,000-160,685,000 was cut from the assembly; the KIV-2 copies are the most frequent count of the six-copy 31-mers in it, and the variant alleles are the bases between exact 20-mer flanks. The 223 HPRC samples with a 30× genome of the 1000 Genomes Project were split into 78 development and 145 check samples as for kir-wgs; every change was decided on both. The unseen set are 57 samples of the Human Genome Structural Variation Consortium (HGSVC3) [10] that are not among the HPRC samples. lpa-wgs and KILDA (commit 74075935, jellyfish 2.3.1, with its own k-mer files) ran on the same reads: the LPA window and the unmapped reads of the 1000 Genomes CRAM. All numbers in the report are produced by lpa-wgs-validate from the files under validation/results.

Supplemental information

Software report (PDF, 4 pages) with all figures and tables; validation program and result tables in the repository under validation/.

References

  1. Kronenberg F, Mora S, Stroes ESG, et al. Lipoprotein(a) in atherosclerotic cardiovascular disease and aortic stenosis: a European Atherosclerosis Society consensus statement. Eur Heart J. 2022;43(39):3925-3946.
  2. Clarke R, Peden JF, Hopewell JC, et al. Genetic variants associated with Lp(a) lipoprotein level and coronary disease. N Engl J Med. 2009;361(26):2518-2528.
  3. Kyriakou T, Seedorf U, Goel A, et al. A common LPA null allele associates with lower lipoprotein(a) levels and coronary artery disease risk. Arterioscler Thromb Vasc Biol. 2014;34(9):2095-2099.
  4. Molitor C, Labidi T, Rimbert A, Cariou B, Di Filippo M, Bardel C. KILDA: identifying KIV-2 repeats from kmers. NAR Genom Bioinform. 2025;7(2):lqaf070.
  5. Liao WW, Asri M, Ebler J, et al. A draft human pangenome reference. Nature. 2023;617:312-324.
  6. Byrska-Bishop M, Evani US, Zhao X, et al. High-coverage whole-genome sequencing of the expanded 1000 Genomes Project cohort including 602 trios. Cell. 2022;185(18):3426-3440.
  7. Jungwirth P. hla-wgs: HLA typing from whole-genome sequencing that states how many fields of each allele are certain. PJ Labs software report. 2026. doi:10.5281/zenodo.24367469.
  8. Jungwirth P. kir-wgs: copy number and alleles of every KIR gene from whole-genome sequencing, with a statement of what is certain. PJ Labs software report. 2026. doi:10.5281/zenodo.24661388.
  9. The 1000 Genomes Project Consortium. A global reference for human genetic variation. Nature. 2015;526:68-74.
  10. Logsdon GA, Ebert P, Audano PA, et al. Complex genetic variation in nearly complete human genomes. Nature. 2025;644:430-441.