grm¶
Compute genomic relationship matrix (GRM) from PLINK binary files.
Use this command before assoc when you need mixed-model GWAS.
Basic Syntax¶
gelex grm -b genotypes -o my_grm
gelex grm --bfile <genotype_prefix> [--add] [--dom] [--loco] [OPTIONS]
Required input is PLINK genotype prefix (--bfile).
Method Selection¶
Choose --geno-method based on scaling strategy.
Detailed formulas and method definitions: Genotype Processing Methods.
Method (alias) |
Use when |
Notes |
|---|---|---|
|
You want the default orthogonal HWE-standardized GRM. |
Orthogonal dominance, HWE moments. Best for most workflows. |
|
You want HWE standardization without orthogonal dominance. |
Simpler encoding, HWE moments. |
|
You prefer HWE centering without variance scaling. |
Preserves original scale, HWE moments. |
|
You need orthogonal HWE centering (no scaling). |
Matches assoc default; HWE moments. |
|
You want sample-based statistics instead of HWE-based. |
More data-dependent estimates. |
If unsure, use the default (OrthStandardizeHWE).
Options¶
Quick Start Options
-b, --bfilerequiredPLINK binary prefix (
.bed/.bim/.fam).-o, --outgrmOutput prefix for GRM files.
--geno-methodOrthStandardizeHWEGRM method. Available methods:
StandardizeHWE(SH),CenterHWE(CH),OrthStandardizeHWE(OSH),OrthCenterHWE(OCH),Standardize(S),Center(C),OrthStandardize(OS),OrthCenter(OC). Abbreviations (e.g.OSH) are also accepted. See Genotype Processing Methods.
Matrix Selection
--addfalseCompute additive GRM.
--domfalseCompute dominance GRM.
--locofalseCompute chromosome-wise LOCO GRMs.
Performance Options
-c, --chunk-size10000Number of SNPs per chunk. Lower values reduce memory usage.
-t, --threadshalf of available CPU coresNumber of CPU threads (use
-1for all cores).
Output Files¶
Output naming depends on whether you request one or multiple matrices.
Scenario |
File pattern |
Notes |
|---|---|---|
Single matrix (additive or dominance), no LOCO |
|
No |
Additive + dominance, no LOCO |
|
One file pair per matrix type. |
LOCO enabled |
|
One file pair per chromosome (and matrix type). |
File structure follows Genomic Relationship Matrix (GRM).
Warnings and Notes¶
Note
If neither --add nor --dom is set, Gelex defaults to additive GRM.
Warning
--loco can generate many files for large chromosome sets. Ensure your
downstream assoc --grm inputs use the matching LOCO prefix.
Examples¶
gelex grm \
-b genotypes \
-o my_grm
gelex grm \
-b genotypes \
--dom \
--geno-method OCH \
-o my_grm_dom
gelex grm \
-b genotypes \
--add \
--dom \
--geno-method OSH \
-o my_grm_both
gelex grm \
-b genotypes \
--add \
--loco \
--geno-method S \
-o my_grm_loco
See Also¶
assoc for GWAS using GRM inputs.
Genomic Relationship Matrix (GRM) for GRM binary format details.