D: 3 Dec 2024 Main functions (--make-grm-bin...) Quick index search |
Linkage disequilibriumAll of the following calculations only consider founders. If your dataset has a shortage of them, PLINK 1.9 --make-founders may come in handy. Since two-variant r2 only makes sense for biallelic variants, these collapse multiallelic variants down to most common allele vs. the rest (unless REF-based statistics are explicitly requested, in which case it's REF vs. all ALTs combined). Variant pruning--indep-pairwise <window size>['kb'] [step size (variant ct)] --indep <window size>['kb'] [step size (variant ct)] <VIF threshold> --indep-order <mode> These commands produce a pruned subset of variants that are in approximate linkage equilibrium with each other, writing the IDs to plink2.prune.in (and the IDs of all excluded variants to plink2.prune.out). These files are valid input for --extract/--exclude in a future PLINK run; and, for backward compatibility, they do not affect the set of variants in the current run. Since the only output of these commands is a pair of variant-ID lists, they now error out when variant IDs are not unique. --indep-pairwise is the simplest approach, which only considers correlations between unphased-hardcall allele counts. It takes three parameters: a required window size in variant count or kilobase (if the 'kb' modifier is present) units, an optional variant count to shift the window at the end of each step (default 1, and now required to be 1 when a kilobase window is used), and a required r2 threshold. At each step, pairs of variants in the current window with squared correlation greater than the threshold are noted, and variants are greedily pruned from the window until no such pairs remain. --indep-pairphase is similar, except that it requires all genotypes to be phased (this is a change from PLINK 1.9), and looks at haplotype correlations. Additional notes:
--indep-preferred <filename> By default, when given a choice, the variant-pruning commands preferentially keep variants with higher nonmajor allele frequencies. However, if you provide a list of variant IDs to --indep-preferred, all variants in that list are prioritized over all variants outside it. (Allele frequencies will still be used for tiebreaking.) LD statistic reports--r[2]-[un]phased [{square | square0 | triangle | inter-chr}] ['yes-really'] --ld-window-kb <#kb> --ld-snp <variant ID> --r2-phased computes the textbook haplotype-frequency-based r2, and corresponds to PLINK 1.9 --r2's behavior when the 'd', 'dprime', or 'dprime-signed' modifier was present. --r2-unphased computes the simpler r2 squared-correlation between (unphased) dosage vectors, and corresponds to how PLINK 1.x --r2 behaved without a D'-related modifier. You are now required to explicitly specify which of these r2 statistics you want. --r-phased and --r-unphased report signed (and of course unsquared) values, with positive sign when the two major (or, when 'ref-based' is specified, REF) alleles are positively correlated with each other. Dosages are now used when present. (In the diploid case, an unphased dosage of x is interpreted as P(0/0) = 1 - x, P(0/1) = x when x is in 0..1.) Note that you can generate a dosage-free copy of your data with "--make-pgen erase-dosage" when this behavior is unwanted. Phase information is used when both variants are on the same chromosome. By default, tabular output is written to plink2.vcor[.zst]. The following filters apply to tabular output:
Refer to the file format entry for output details and optional columns (e.g. allele frequency, D'). By default, when multiallelic variants are present, --r2-[un]phased will error out when the 'maj' and 'nonmaj' (or, if 'ref-based' is specified, 'ref' and 'alt') column-sets are absent. Similarly, --r-[un]phased will error out in this sort of case regardless of whether multiallelic variants are present. The 'allow-ambiguous-allele' modifier overrides this behavior. To request all-pairs matrix output instead, specify a matrix shape ('square', 'square0', 'triangle') and/or encoding ('bin', 'bin4') modifier; these have the same behavior as with --make-rel.
With either output type, the computation can be subdivided with --parallel. --ld <variant ID> <variant ID> ['hwe-midp'] To inspect the relation between a single pair of variants in more detail, you can use the --ld flag, which displays observed and expected (based on MAFs) frequencies of each haplotype, as well as haplotype-based r2 and D'. (The latter two values are calculated in the same manner as they are for --r2-phased.) When unphased calls are present, and there are multiple biologically possible solutions to the haplotype frequency cubic equation, all are displayed (instead of just the maximum likelihood solution identified by --r[2]-phased), along with HWE exact test statistics. PLINK 2 cannot estimate LD effectively when very few founders are present, so it normally errors out when there are less than 50. If you can't solve the problem with PLINK 1.9 --make-founders, you can use --bad-ld as a last resort to force PLINK 2 to proceed. |