GeneSuite
Documentation / Technical reference

Separate LMT directives and data

The development standalone frontend provides two independent commands for a four-trait, wide-table ssSNPBLUP comparison with supplied covariance matrices. These commands prepare files; they do not execute LMT.

gsuite convert-data model16-ancestral.yml --to lmt --output lmt-data
gsuite translate model16-ancestral.yml --to lmt --output para.xml \
  --data-manifest lmt-data/manifest.json --lmt-conv -25

The convergence value above is an explicit LMT setting for illustration. It is not a translation of gsuite’s relative or absolute residual tolerance. Select and verify LMT convergence using its documented criterion and compare final residuals before comparing performance.

Qualification and the current simulation model

The current simulation uses scale: 0.95, polygenic_weight: 0.0 and independent_ridge: 0.05: its genomic matrix is 0.95 G + 0.05 I. The public LMT ssSNPBLUP example documents aweight, a blend with the pedigree relationship matrix. That does not express this identity ridge. An exact LMT mapping for the independent scale and ridge has not been verified.

For this model, data conversion is available, but directive translation writes an accepted: false report beside the requested XML path, returns exit status 2, and writes no XML. Do not change the blend merely to make translation pass: that would change the statistical model being compared.

The initial directive profile supports the documented positive pedigree blend with scale one, no independent ridge, optional pedigree-moment adjustment, sample-mean centering and sum-of-2p(1-p) normalization. Even for that profile, acceptance means a supported translation only. A user-run GHPC test passed for a tiny four-trait adjusted 5% pedigree blend; that is not qualification of every input model or executable. The report always records numerical_equivalence_verified: false.

Five-percent pedigree blend and adjustment

For the four-trait comparison inspired by the WCGALP example, use a separate model copy with this genomic block:

genomic:
  adjustment: pedigree_moments
  scale: 1.0
  polygenic_weight: 0.05
  independent_ridge: 0.0

The translator emits aweight: 0.05 and switch: adjustg2a. For a sample-mean centered genomic matrix, the grand mean is zero. Matching mean diagonal and grand mean therefore gives intercept mean(A_gg) and slope (mean(diag(A_gg)) - mean(A_gg)) / mean(diag(G)). Using the off-diagonal mean instead gives the same affine transformation. Both approaches are checked on a tiny example with unequal pedigree relationships and unsorted genotype IDs. The native gsuite check agrees with the independent reference at relative tolerance 1e-11. A user-run GHPC comparison on 31 October 2026 confirmed LMT coefficients of slope 0.25 and intercept 0.75 and agreement of all 24 animal genetic predictions. The largest reported absolute difference was 9.218406594e-11. This is a small-fixture result, not a large-data guarantee.

On a GHPC allocation with the updated source bundle, run the independent comparison against the installed LMT executable:

python3 validation/compare_lmt_adjustment.py \
  --output "$PWD/lmt-adjustment-check" \
  --gsuite "$PWD/install/bin/gsuite" \
  --lmt /path/to/lmt --lmt-key /opt/lmt.key

This creates fresh six-animal, three-genotyped, four-marker, four-trait inputs, runs gsuite and LMT, and compares LMT’s logged beta and alpha with an independent dense calculation. comparison.json distinguishes native gsuite verification from live LMT verification. The updated test checks the adjustment, resulting blended genomic covariance and all 24 animal genetic predictions. prediction-comparison.json records the prediction tolerances and differences. It does not establish matching convergence criteria. LMT is not bundled. Run in a fresh output directory to prevent reuse of LMT’s adjustg2a.bin cache. If LMT fails or does not expose the coefficients, the test fails and retains the inputs and logs.

The Windows development host has no usable Linux LMT runtime; live LMT evidence above was supplied by the user from GHPC. Existing frozen bundles do not acquire these translator changes automatically. The current exporter writes <models> and datafile:, as required by the tested executable.

LMT’s adjusted ssSNPBLUP solution CSV includes animal predictions, marker coefficients and one augmented coefficient under the same variance/factor label. For the tiny fixture, the prediction checker validates six animal rows, four marker rows and one augmented row per trait, then compares only the animal predictions. This fixture-specific checker must not be applied directly to the million-animal solution file.

Data conversion

Real-valued data, frequencies and XML numbers use scientific notation with 17 fractional mantissa digits. This preserves binary64 round trips in the exported text while bounding the decimal mantissa length for reader compatibility. IDs and genotype encodings remain unchanged. Conversion manifests record numeric_encoding: scientific_17_fraction_digits; translation rejects older manifests without this encoding. Reconvert old snapshots into a fresh directory before binding their manifest; an earlier successful conversion does not certify its numeric text for this reader compatibility requirement. Original snapshots are never modified automatically.

For the existing GHPC million-animal dataset, after installing the new bundle inside a 16-CPU allocation, prepare a separate model without editing the identity-ridge model:

export GSUITE="$PWD/install/bin/gsuite"
export DATA="$HOME/gsuite/datasets/n1000000-ng150000-m40000-q4-s4401-new"
python3 - "$DATA" <<'PY'
import pathlib, sys, yaml
d = pathlib.Path(sys.argv[1])
m = yaml.safe_load((d/'model16-ancestral.yml').read_text())
m['name'] = 'single_step_1m_t16_blend05_adjusted'
m['relationships']['H']['genomic'].update(
    adjustment='pedigree_moments', scale=1.0,
    polygenic_weight=0.05, independent_ridge=0.0)
with (d/'model16-blend05-adjusted.yml').open('x') as f:
    yaml.safe_dump(m, f, sort_keys=False)
PY

"$GSUITE" validate "$DATA/model16-blend05-adjusted.yml"
export LMT_DATA="$DATA/lmt-data-v36"
"$GSUITE" convert-data "$DATA/model16-blend05-adjusted.yml" \
  --to lmt --output "$LMT_DATA"

If this dataset has already been converted successfully with the scientific numeric encoding above, set LMT_DATA to that existing directory and skip convert-data. Covariance, genomic blend, adjustment and solver settings do not change the data contract. This reuses a snapshot: verify that the original inputs have not changed since conversion.

Run sequentially on the same allocation and record separate output trees:

export COMPARE="$DATA/comparison-blend05-$(date +%Y%m%d-%H%M%S)"
mkdir "$COMPARE"
"$GSUITE" run "$DATA/model16-blend05-adjusted.yml" \
  --output "$COMPARE/gsuite"

"$GSUITE" translate "$DATA/model16-blend05-adjusted.yml" \
  --to lmt --data-manifest "$LMT_DATA/manifest.json" \
  --output "$COMPARE/lmt/para.xml" --lmt-conv -25 --lmt-convtype cr

(
  cd "$COMPARE/lmt" || exit 1
  cp -p /opt/lmt.key lmt.key
  ulimit -s unlimited
  export OMP_NUM_THREADS=16 MKL_NUM_THREADS=16
  export OMP_DYNAMIC=FALSE MKL_DYNAMIC=FALSE
  export OMP_STACKSIZE=2000M OMP_PLACES=cores OMP_PROC_BIND=true
  export OMP_MAX_ACTIVE_LEVELS=2147483647
  export KMP_AFFINITY=granularity=core,scatter
  "$CONDA_PREFIX/bin/time" -v -o time.txt \
    /path/to/lmt -f para.xml > console.log 2>&1
)

Keep each LMT run directory fresh to avoid priming from results.bin or reusing adjustg2a.bin. GNU time is the existing Conda time package. Data conversion is outside both fit timings. gsuite’s end-to-end timing is in execution.json; LMT’s end-to-end timing is in time.txt. Inspect both native logs for successful convergence. LMT’s explicit cr=-25 setting is the small test’s setting; it is not asserted equivalent to gsuite’s relative 1e-11 and absolute 1e-13 stopping controls. Report the criteria alongside timings, and compare final predictions before drawing performance conclusions.

convert-data reads and validates the YAML inputs, then writes a fresh output directory containing:

  • Numeric data.csv with four responses, an intercept and effect group columns.
  • Complete numeric pedigree.csv, individual-major genotypes.txt, its pedigree-ID cross.csv, and frequencies.blkcsv containing mean dosages.
  • Reversible id-map.csv, record-map.csv and marker-map.csv mappings, a diagnostic missing.csv, and manifest.json with source/output hashes.

Source files remain unchanged. Partial response missingness uses an explicit LMT missing-value threshold; observed zero remains observed. Records with all responses missing follow gsuite’s omission policy. Missing genotypes and fixed markers are rejected rather than imputed or removed. Genotypes retain source sample and marker order and count the first BIM allele.

BED decoding uses bounded sample batches (--sample-batch, default 128). The 150,000 by 40,000 panel produces approximately 6 GB of genotype text, in addition to observations, pedigree and mappings. Conversion is a separate cost from fitting and can be reused when only covariance or solver settings change. An interrupted or failed conversion retains an unaccepted manifest and partial files. Neither command overwrites an existing destination.

Directive translation

translate reads the YAML and optionally the small conversion manifest. It does not read or rewrite phenotype, pedigree or genotype data, and can run before those data exist. Without a manifest, references default to lmt-data/ beside the XML file. With a manifest, it checks the input/binding contract and records its hash; it does not rehash the large converted files or check whether source contents have changed since conversion. The manifest identifies the converted snapshot, not a live data view.

The initial profile requires four traits, an intercept, one single-step genetic effect, ordinary identity random effects, and full positive-definite covariance matrices in declared trait order. It excludes weighted/structured residuals, random regressions, genetic groups, metafounders and genotype ID maps. gsuite thread/backend settings and requested output tables are not translated into an LMT execution policy. The receipt records source execution settings and the explicit LMT convergence setting. LMT runtime settings must be controlled separately for a benchmark.

The format references are the official LMT guide’s parameter elements, input files, examples and algorithms.

Restricted reverse conversion

The reverse adapter admits the explicit four-trait snpblup1 profile generated by this frontend: four intercept equations, genetic, site, family and individual environment effects, supplied positive definite covariance matrices, positive pedigree blending and optional adjustg2a. Unsupported equations, switches and data options are rejected. This is not a general LMT parameter-file importer.

gsuite convert-data para.xml --from lmt --to gsuite --output imported-data \
  --source-data-manifest lmt-data/manifest.json
gsuite translate para.xml --from lmt --to gsuite \
  --data-manifest imported-data/manifest.json --output imported.yml
gsuite validate imported.yml

For files not produced by gsuite, provide --marker-map marker-map.csv instead of --source-data-manifest. The map must contain lmt_column, source_marker, chromosome, position, dosage_allele and other_allele, in marker order. Text dosages cannot identify marker names or alleles by themselves. Conversion reconstructs SNP-major BED, BIM and FAM, checks supplied frequencies against sample mean dosages, and rejects missing/non-012 genotypes and fixed markers. Custom centering frequencies are outside this profile.

The imported model retains LMT numeric animal IDs and trait labels y1 through y4; it does not infer original source names. Directive translation reads control files and manifest metadata, without rewriting or scanning data. Without a manifest it emits a draft with data_ready: false. Source convergence controls are recorded, but their stopping criterion is not declared equivalent to gsuite’s.

Small deterministic reverse-conversion tests compare all animal genetic values with independent marginal BLUP equations at two pedigree blend weights, with partially missing responses. Genotype round trips and unsupported-input rejection are tested separately. These tests do not invoke LMT or certify arbitrary LMT models. Full cross-software prediction and residual qualification remains a separate, executable-specific step.