flashfmZero
Summary¶
flashfmZero is an R package that converts GWAS summary statistics for correlated observed traits into summary statistics for zero-correlation latent factors and jointly fine-maps associated factors. It implements the multivariate latent-factor genetic analysis workflow and returns credible sets, variant-level marginal posterior probabilities and high-LD SNP-group probabilities [1].
Core Functions¶
| Function | Purpose |
|---|---|
harmoniseGWAS() |
Filters and aligns observed-trait GWAS variants, alleles and standard column names |
factor_contributions() |
Converts factor loadings into interpretable observed-trait contribution matrices |
latentGWAS() |
Calculates GWAS summary statistics for latent factors |
JAMdwithGroups() |
Fine-maps a single associated latent factor and constructs SNP groups |
FLASHFMZEROwithJAMd() |
Jointly fine-maps multiple associated latent factors while also returning single-factor results |
allcredsetsPP() |
Builds credible sets from posterior probabilities |
FMsummary_table() |
Summarizes credible sets, top variants, MPPs and group probabilities |
Installation and Runtime¶
The protocol reports compatibility with Linux, Windows and macOS using R versions above 4.2.1. Java JDK is required; Windows also requires Rtools, while macOS requires Xcode and a compatible Fortran compiler. The fine-mapping functions rely on Java components being available after the R package is loaded.[1]
Input Contract¶
Observed-trait GWAS frames passed through harmoniseGWAS() must expose effect estimate, standard error, variant ID, effect and non-effect alleles, effect-allele frequency, base-pair position, p-value and imputation-quality columns. Harmonized outputs use the required names beta, SE, rsID and EAF.[1]
Variant IDs must be non-missing and identical across trait GWASs. Regional fine-mapping additionally requires the same IDs and order in the LD matrix, with identifiers beginning in a letter and excluding colons and angle brackets.[1]
Key Parameters¶
| Parameter | Documented value or role |
|---|---|
minMAF |
Default 0.005 during harmonization |
minINFO |
Default 0.4 during harmonization |
cred |
Default 0.99; protocol example uses 0.95 |
r2.minmerge |
0.8 in the worked fine-mapping example |
N |
Actual GWAS sample size for fine-mapping |
NCORES |
Example assigns one core per associated latent factor |
Outputs¶
The package reports both single-factor JAM-latent-factor results and joint flashfm-latent-factor results when several factors are associated. FMsummary_table() includes credible-set size, top variant and MPP, SNP-group membership, group size and MPPg, plus variants or groups whose posterior probability exceeds 0.90.[1]
In the primary blood-cell study, joint flashfmZero credible sets were equal to or smaller than single-factor latent sets in 97% of 211 matched comparisons and strictly smaller in 45%. Relative to observed-trait fine-mapping, joint latent-factor sets were equal or smaller in 86% of 725 comparisons.[3]
The example data and analysis script are available from the companion repository and Zenodo record. The software itself is archived on Zenodo in addition to GitHub.[1]
Troubleshooting¶
- Installation failure: verify the Java JDK and platform-specific build toolchain.
- Harmonization failure: ensure every GWAS file contains the column names supplied to
harmoniseGWAS(). - Fine-mapping failure: normalize variant identifiers and verify exact agreement between GWAS and LD matrices.
Citations¶
[1] Astle, Butterworth and Asimit (2025), flashfmZero protocol [2] Asimit (2024), flashfmZero software archive [3] Zhou et al. (2025), primary flashfmZero study