Tutorial

Individual-level and summary-level UCALM paths, outputs and practical notes.

Section 6

UCALM

UCALM: Unsupervised adaptive Clustering-based Association and Layered Meta-integration. It is designed for GWAS in heterogeneous populations where hidden population structure can dilute association signals or create residual confounding.

Overview

UCALM combines three steps in one framework: unsupervised subgroup inference, subgroup-specific GWAS and layered meta-integration. The first step infers genetically homogeneous subgroups directly from genotype data. The second step runs association testing within each inferred subgroup. The final step integrates subgroup-level association evidence so that shared, ancestry-correlated and population-specific signals can all contribute to the final result.

Problem in heterogeneous cohortsUCALM strategy
Pooled GWAS can estimate an average genetic effect across heterogeneous samples, attenuating or masking subgroup-specific association signals.Perform subgroup-specific GWAS within inferred genetically homogeneous subgroups.
Predefined population labels are sometimes unavailable, often subjectively defined, and may not accurately reflect the underlying genetic structure.Infer subgroups directly from genotype data without requiring predefined labels.
A single meta-analysis model may have limited ability to accommodate multiple complex effect architectures simultaneously, reducing sensitivity to heterogeneous association signals.Combine fixed-effect, MR-MEGA and ACAT components into a final UCALM P-value.

When UCALM Helps

Use UCALM when the study cohort is genetically heterogeneous and the subgroup structure is not fully captured by existing metadata. It is most useful when samples come from multiple ancestries, breeds, breeding lines, companies, regions or admixed backgrounds, or when conventional GWAS shows inflation, masked peaks or inconsistent signals across known groups.

  • Use the individual-level data path when MVP needs to infer latent population structure and run association testing within inferred subgroups.
  • Use the summary-level data path when subgroup GWAS has already been run and you only need the UCALM layered integration step.
  • Use conventional pooled GLM or MLM when the cohort is genetically homogeneous and subgroup-specific effects are not expected.

Path 1: Individual-level Data

Use --ucalm for the full individual-level data path. This command starts from PLINK genotype files and phenotype records, infers subgroups and then performs subgroup GWAS followed by UCALM integration.

Input: PLINK 1 binary dataset prefix with --bfile (.bed/.bim/.fam) or PLINK 2 PGEN dataset prefix with --pfile (.pgen/.pvar/.psam), a phenotype file with --pheno, the target trait column with --pheno-pos, and optional covariates, MAF, thread and clustering parameters. See Genotype Files, Phenotype File and Covariates in Phenotype File.

mvp --ucalm \
    --bfile demo \
    --pheno demo.phe \
    --pheno-pos 2 \
    --npc-cluster 10 \
    --use-umap \
    --use-kdtree \
    --threads 32 \
    --out demo
  • Analysis steps: genomic relationship matrix (GRM) construction, eigendecomposition of the GRM to derive PCs, variance-weighted PCs, UMAP, AutoHDBSCAN, subgroup GWAS and UCALM layered integration.
  • Clustering parameters: set the number of PCs used for clustering (--npc-cluster), use a KD tree for nearest neighbor search (--use-kdtree), and adjust the UMAP neighborhood size (--umap-nn) and minimum distance parameter (--umap-md) to control the local and global structure and the compactness of the embedding.
  • Output: the individual-level data path writes cluster assignments, UMAP coordinates, subgroup variance summaries and a final association table. See Outputs for the file list.

Path 2: Summary-level Data

Use the summary-level data path when subgroup GWAS summary statistics have already been generated. In this path, UCALM skips genotype clustering and directly performs layered meta-integration across population-level summary statistics.

Input: at least two harmonized summary statistics files. Each file must include a header and the columns SNP CHR POS A1 A2 MAF BETA SE PVAL N. Marker IDs, chromosome and position, effect allele coding, reference genome build and sample-size definitions must be consistent across files.

Requires: summary statistics prepared as described in Summary Statistics Input.

mvp --meta \
    --sumstat pop1.sumstat,pop2.sumstat,pop3.sumstat \
    --meta-method 1 \
    --threads 32 \
    --out demo
  • Analysis steps: MVP keeps SNPs shared across the summary statistics files, checks chromosome, position and allele coding against the first file, flips frequency and beta when A1/A2 are reversed, applies missing-value, MAF and minor allele count filters, and then performs UCALM layered integration.
  • Default: UCALM uses a 1 Mb window by default to provide local allele frequency structure for the ancestry-correlated component.
  • Output: demo.assoc.txt columns: SNP, CHR, POS, A1, A2, subgroup MAF columns, subgroup BETA, SE and PVAL columns, plus the final UCALM_PVAL column.

Computational Acceleration

To improve computational efficiency, UCALM uses several acceleration strategies during clustering. The table below lists the main strategies and the parameters that control them.

ScenarioStrategyParameter
PCs calculationCompute only the leading k PCs from the GRM with truncated eigendecomposition via Spectra rather than a full decomposition.Set k with --npc-cluster; the default is 10 in the tutorial examples.
UMAP neighbor graphBuild the UMAP graph from variance weighted PCs. Use HNSW when the retained PC feature dimension is greater than 50; otherwise use VP-tree with Euclidean distance.The neighbor search backend is selected automatically from the retained PC feature dimension.
HDBSCAN nearest neighbor searchUse a KD tree to compute core distances and support nearest neighbor queries on the UMAP embedding during density based clustering.Enable with --use-kdtree in the individual-level path.

Outputs

Several files will be generated in the work directory:

demo.cluster.txt: the cluster results for all individuals. In the ambiguity column, 0 indicates a core sample and 1 indicates an ambiguous reassigned sample.

idclusterambiguity
IND1c10
IND2c10
IND3c20
IND4c21
IND5c30

demo.cluster.umap.txt: the UMAP results for all individuals.

idu1u2
IND1-11.6093-13.7700
IND2-11.3111-13.8723
IND3-11.6836-13.7768
IND4-11.4300-14.0521
IND5-10.9065-14.1600

demo.c*.vars.txt: the estimated variance and heritability of all random effects in each subgroup.

TraitVarGVarG_SEVarEVarE_SEh2h2_SEConvergence
trait10.9821220.07010021.180560.03158490.4541230.0214886TRUE

demo.assoc.txt: the UCALM association results.

SNPCHRPOSA1A2c1_MAFc2_MAFc3_MAFc1_BETAc1_SEc1_PVALc2_BETAc2_SEc2_PVALc3_BETAc3_SEc3_PVALUCALM_PVALDOMINANT
SNP11112TC0.1195880.0268400.000362-0.0518020.0691090.4535490.2071910.3361080.537821-0.0833240.6831100.4164790.446716homogeneous
SNP21370AG0.4323430.4095090.343677-0.0508870.0518150.3261020.1525160.1183240.1978700.0051870.2006720.2444060.463292ancestry-correlated
SNP32482CT0.0178610.0015340.0057150.0403910.1364790.767278-2.0633101.3750000.133952-0.0406070.0523400.1871970.765387population-specific
SNP43827GA0.1195880.0518810.019908-0.0518020.0691090.453549-0.5550760.3361080.5378210.7799090.4720230.4122950.446716ancestry-correlated
SNP551550GC0.1233280.1092310.1066860.0403910.1364790.7672780.2071910.3361080.5378210.0599250.1634590.2650920.201753homogeneous

UCALM_PVAL is the final layered meta-integration P-value. DOMINANT reports the dominant UCALM component label for the marker: homogeneous, ancestry-correlated or population-specific.

Result Checks

Use the checks below before interpreting UCALM outputs.

CheckWhy it mattersAction
Genome build and positionPosition mismatches can refer to different loci across builds.Lift all genotype and summary files to the same reference genome build.
Allele harmonizationReversed A1/A2 labels flip beta signs and allele frequency.Harmonize A1, A2, allele frequency and BETA before summary integration.
Subgroup sample sizeVery small subgroups reduce power and can make estimates unstable.Inspect subgroup counts and interpret sparse subgroup signals cautiously.
Missing final resultsMarkers may be absent from one file or fail MAF or sample-size filters.Check marker IDs, allele coding, MAF, sample size and shared marker overlap.