PLINK(1)

๐Ÿงฌ NAME ๐Ÿงฌ

okay so this is PLINK(1), sitting pretty in the User Commands section of the manual โ€” and bestie, it's PLINK - whole genome SNP analysis. that's the whole vibe. ๐Ÿ’…


๐Ÿ’– DESCRIPTION ๐Ÿ’–

PLINK v1.90b6.16 64-bit (19 Feb 2020) www.cog-genomics.org/plink/1.9/ (C) 2005-2020 Shaun Purcell, Christopher Chang GNU General Public License v3

periodt. now let's talk about how to read the flag definitions that follow, because they have a whole little grammar and once you get it you'll be unstoppable, fr fr:

  • <angle brackets> denote a required parameter, where the text between the angle brackets describes its nature.
  • ['square brackets + single-quotes'] denotes an optional modifier. Use the EXACT text in the quotes.
  • [{bar|separated|braced|bracketed|values}] denotes a collection of mutually exclusive optional modifiers (again, the exact text must be used). When there are no outer square brackets, one of the choices must be selected.
  • ['quoted_text='<description of value>] denotes an optional modifier that must begin with the quoted text, and be followed by a value with no whitespace in between. '|' may also be used here to indicate mutually exclusive options.
  • [square brackets without quotes or braces] denote an optional parameter, where the text between the brackets describes its nature.
  • An ellipsis (...) indicates that you may enter multiple parameters of the specified type.

here's the shape of literally every run, bestie:

plink <input flag(s)...> [command flag(s)...] [other flag(s)...]
plink --help [flag name(s)...]

๐ŸŒธ defining your input fileset ๐ŸŒธ

Most PLINK runs need exactly one main input fileset. these flags are how you tell it what that fileset is and where it lives:

  • --bfile [prefix] โ€” Specify .bed + .bim + .fam prefix (default 'plink').
  • --bed <filename> โ€” Specify full name of .bed file.
  • --bim <filename> โ€” Specify full name of .bim file.
  • --fam <filename> โ€” Specify full name of .fam file.
  • --keep-autoconv โ€” With --file/--tfile/--lfile/--vcf/--bcf/--data/--23file, don't delete the autogenerated binary fileset at end of run. (keep the little guy around ๐Ÿฅบ)
  • --file [prefix] โ€” Specify .ped + .map filename prefix (default 'plink').
  • --ped <filename> โ€” Specify full name of .ped file.
  • --map <filename> โ€” Specify full name of .map file.
  • --no-fid โ€” .fam/.ped file does not contain column 1 (family ID).
  • --no-parents โ€” .fam/.ped file does not contain columns 3-4 (parents).
  • --no-sex โ€” .fam/.ped file does not contain column 5 (sex).
  • --no-pheno โ€” .fam/.ped file does not contain column 6 (phenotype).
  • --tfile [prefix] โ€” Specify .tped + .tfam filename prefix (default 'plink').
  • --tped <fname> โ€” Specify full name of .tped file.
  • --tfam <fname> โ€” Specify full name of .tfam file.
  • --lfile [prefix] โ€” Specify .lgen + .map + .fam (long-format fileset) prefix.
  • --lgen <fname> โ€” Specify full name of .lgen file.
  • --reference <fn> โ€” Specify default allele file accompanying .lgen input.
  • --allele-count โ€” When used with --lfile/--lgen + --reference, specifies that the .lgen file contains reference allele counts.
  • --vcf <filename> โ€” Specify full name of .vcf or .vcf.gz file.
  • --bcf <filename> โ€” Specify full name of BCF2 file.
  • --data [prefix] โ€” Specify Oxford .gen + .sample prefix (default 'plink').
  • --gen <filename> โ€” Specify full name of .gen or .gen.gz file.
  • --bgen <f> ['snpid-chr'] โ€” Specify full name of .bgen file.
  • --sample <fname> โ€” Specify full name of .sample file.
  • --23file <fname> [FID] [IID] [sex] [pheno] [pat. ID] [mat. ID] โ€” Specify 23andMe input file.
  • --grm-gz [prfx] โ€” Specify .grm.gz + .grm.id (GCTA rel. matrix) prefix.
  • --grm-bin [prfx] โ€” Specify .grm.bin + .grm.N.bin + .grm.id (GCTA triangular binary relationship matrix) filename prefix.

๐ŸŽ€ fake data, for the girlies who just want to vibe ๐ŸŽ€

  • --dummy <sample ct> <SNP ct> [missing geno freq] [missing pheno freq] [{acgt | 1234 | 12}] ['scalar-pheno']

This generates a fake input dataset with the specified number of samples and SNPs. By default, the missing genotype and phenotype frequencies are zero, and genotypes are As and Bs (change the latter with 'acgt'/'1234'/'12'). The 'scalar-pheno' modifier causes a normally distributed scalar phenotype to be generated instead of a binary one. iconic behaviour tbh.

  • --simulate <simulation parameter file> [{tags | haps}] [{acgt | 1234 | 12}]
  • --simulate-qt <sim. parameter file> [{tags | haps}] [{acgt | 1234 | 12}]

--simulate generates a fake input dataset with disease-associated SNPs, while --simulate-qt generates a dataset with quantitative trait loci.


๐Ÿฆ‹ where your output goes ๐Ÿฆ‹

Output files have names of the form 'plink.<extension>' by default. you can change the 'plink' prefix with:

  • --out <prefix> โ€” Specify prefix for output files.

๐Ÿ‘‘ the main character commands ๐Ÿ‘‘

Most runs also require at least one of the following commands, bestie. pick your fighter:

  • --make-bed

Create a new binary fileset. Unlike the automatic text-to-binary converters (which only heed chromosome filters), this supports all of PLINK's filtering flags. she does it all ๐Ÿ’…

  • --make-just-bim
  • --make-just-fam

Variants of --make-bed which only write a new .bim or .fam file. Can be used with only .bim/.fam input. USE THESE CAUTIOUSLY. It is very easy to desynchronize your binary genotype data and your .bim/.fam indexes if you use these commands improperly. If you have any doubt, stick with --make-bed.

๐Ÿšจ no cap, this is the scary one. if you're unsure even a tiny bit, just use --make-bed. protect your data bestie.

โœจ --recode and its many, many little outfits โœจ

  • --recode <output format> [{01 | 12}] [{tab | tabx | spacex | bgz | gen-gz}] ['include-alt'] ['omit-nonmale-y']

Create a new text fileset with all filters applied. The following output formats are supported:

  • '23': 23andMe 4-column format. This can only be used on a single sample's data (--keep may be handy), and does not support multicharacter allele codes.
  • 'A': Sample-major additive (0/1/2) coding, suitable for loading from R. If you need uncounted alleles to be named in the header line, add the 'include-alt' modifier.
  • 'AD': Sample-major additive (0/1/2) + dominant (het=1/hom=0) coding. Also supports 'include-alt'.
  • 'A-transpose': Variant-major 0/1/2.
  • 'beagle': Unphased per-autosome .dat and .map files, readable by early BEAGLE versions.
  • 'beagle-nomap': Single .beagle.dat file.
  • 'bimbam': Regular BIMBAM format.
  • 'bimbam-1chr': BIMBAM format, with a two-column .pos.txt file. Does not support multiple chromosomes.
  • 'fastphase': Per-chromosome fastPHASE files, with .chr-<chr #>.recode.phase.inp filename extensions.
  • 'fastphase-1chr': Single .recode.phase.inp file. Does not support multiple chromosomes.
  • 'HV': Per-chromosome Haploview files, with .chr-<chr #>{.ped,.info} filename extensions.
  • 'HV-1chr': Single Haploview .ped + .info file pair. Does not support multiple chromosomes.
  • 'lgen': PLINK 1 long-format (.lgen + .fam + .map), loadable with --lfile.
  • 'lgen-ref': .lgen + .fam + .map + .ref, loadable with --lfile + --reference.
  • 'list': Single genotype-based list, up to 4 lines per variant. To omit nonmale genotypes on the Y chromosome, add the 'omit-nonmale-y' modifier.
  • 'rlist': .rlist + .fam + .map fileset, where the .rlist file is a genotype-based list which omits the most common genotype for each variant. Also supports 'omit-nonmale-y'.
  • 'oxford': Oxford-format .gen + .sample. With the 'gen-gz' modifier, the .gen file is gzipped.
  • 'ped': PLINK 1 sample-major (.ped + .map), loadable with --file.
  • 'compound-genotypes': Same as 'ped', except that the space between each pair of same-variant allele codes is removed.
  • 'structure': Structure-format.
  • 'transpose': PLINK 1 variant-major (.tped + .tfam), loadable with --tfile.
  • 'vcf', 'vcf-fid', 'vcf-iid': VCFv4.2. 'vcf-fid' and 'vcf-iid' cause family IDs or within-family IDs respectively to be used for the sample IDs in the last header row, while 'vcf' merges both IDs and puts an underscore between them. If the 'bgz' modifier is added, the VCF file is block-gzipped. The A2 allele is saved as the reference and normally flagged as not based on a real reference genome (INFO:PR). When it is important for reference alleles to be correct, you'll also want to include --a2-allele and --real-ref-alleles in your command.

In addition:

  • The '12' modifier causes A1 (usually minor) alleles to be coded as '1' and A2 alleles to be coded as '2', while '01' maps A1 -> 0 and A2 -> 1.
  • The 'tab' modifier makes the output mostly tab-delimited instead of mostly space-delimited. 'tabx' and 'spacex' force all tabs and all spaces, respectively.

๐ŸŒˆ more commands, because she never stops ๐ŸŒˆ

  • --flip-scan ['verbose'] โ€” (alias: --flipscan) LD-based scan for case/control strand inconsistency.
  • --write-covar โ€” If a --covar file is loaded, --make-bed/--make-just-fam and --recode automatically generate an updated version (with all filters applied). However, if you do not wish to simultaneously generate a new genotype file, you can use --write-covar to just produce a pruned covariate file.
  • --write-cluster ['omit-unassigned'] โ€” If clusters are specified with --within/--family, this generates a new cluster file (with all filters applied). The 'omit-unassigned' modifier causes unclustered samples to be omitted from the file; otherwise their cluster is 'NA'.
  • --write-set
  • --set-table

If sets have been defined, --write-set dumps 'END'-terminated set membership lists to <output prefix>.set, while --set-table writes a variant-by-set membership table to <output prefix>.set.table.

  • --merge <.ped filename> <.map filename>
  • --merge <text fileset prefix>
  • --bmerge <.bed filename> <.bim filename> <.fam filename>
  • --bmerge <binary fileset prefix>

Merge the given fileset with the initially loaded fileset, writing the result to <output prefix>.bed + .bim + .fam. (It is no longer necessary to simultaneously specify --make-bed.) ๐Ÿซถ

  • --merge-list <filename>

Okay bestie, picking right back up where we left off ๐Ÿ’–

Merge all the filesets named in the text file with the reference fileset, if one was specified. (But plot twist ๐Ÿซข โ€” you can also use this without a reference; in that case, the newly created fileset gets treated as the reference by most other PLINK operations. Main character energy, honestly. ๐Ÿ‘‘)

The text file gets read like this:

  • A line with only one name โ†’ that's assumed to be the prefix for a binary fileset.
  • A line with exactly two names โ†’ those are assumed to be the full filenames for a text fileset (.ped first, then .map).
  • A line with exactly three names โ†’ those are assumed to be the full filenames for a binary fileset (.bed, then .bim, then .fam).

  • --write-snplist โ€” writes a .snplist file listing the names of all variants that pass the filters and inclusion thresholds you've specified. โœจ
  • --list-23-indels โ€” writes the subset with 23andMe-style indel calls (D/I allele codes). ๐Ÿงฌ

  • --list-duplicate-vars ['require-same-ref'] ['ids-only'] ['suppress-first'] โ€” writes a .dupvar file describing all groups of variants with matching positions and allele codes. ๐Ÿ“
    • By default, A1/A2 allele assignments are ignored; pass require-same-ref to override that.
    • Normally the report contains position and allele codes. Wanna yeet those (and get a file you can feed straight into e.g. --extract/--exclude)? Use ids-only. โš ๏ธ Heads up though: this command will fail in ids-only mode if any of the reported IDs aren't unique.
    • suppress-first makes the first variant ID in each group get omitted from the report.

  • --freq [{counts | case-control}] ['gz'] โ€” generates a basic allele frequency report (or a count report, if the counts modifier is present).

You can combo this with --within/--family to get a cluster-stratified allele frequency/count report instead, or use the case-control modifier to report case and control allele frequencies separately. ๐Ÿ’ซ

  • --freqx ['gz'] โ€” generates a more detailed genotype count report, designed for use with --read-freq.

  • --missing ['gz'] โ€” generates sample- and variant-based missing data reports. ๐Ÿ•ณ๏ธ

If clusters are defined, the variant-based report is cluster-stratified. gz makes the output files get gzipped. And ngl, unlike most other commands, this one doesn't treat het. haploids as missing. (Iconic behaviour. ๐Ÿ™ˆ)


  • --test-mishap โ€” checks for association between missing calls and flanking haplotypes. ๐Ÿ”

  • --hardy ['midp'] ['gz'] โ€” generates a Hardy-Weinberg exact test p-value report. โš ๏ธ Important: this does NOT simultaneously filter on the p-value any more โ€” use --hwe for that.

With the midp modifier, the test applies the mid-p adjustment described in Graffelman J, Moreno V (2013) The mid p-value in exact tests for Hardy-Weinberg Equilibrium. ๐Ÿ“š


  • --mendel ['summaries-only'] โ€” generates a Mendel error report.

The summaries-only modifier causes the .mendel file (the one listing every single error) to be skipped. ๐Ÿšซ


  • --het ['small-sample'] ['gz'] โ€” reports method-of-moments estimates of inbreeding coefficients.
  • --ibc โ€” calculates all three values described in Yang J, Lee SH, Goddard ME and Visscher PM (2011) GCTA: A Tool for Genome-wide Complex Trait Analysis. (That paper also describes the relationship matrix computation we reimplement.) ๐Ÿ“–
    • Both of these functions require decent MAF estimates. If there are very few samples in your immediate fileset, --read-freq is practically mandatory, because imputed MAFs are wildly inaccurate in that case. ๐Ÿ˜ญ
    • They also assume the marker set is in approximate linkage equilibrium.
    • By default, --het omits the n/(n-1) multiplier in Nei's expected homozygosity formula. The small-sample modifier causes it to be included, while forcing --het to use MAFs imputed from founders in the immediate dataset.

  • --check-sex [female max F] [male min F]
  • --check-sex ycount [female max F] [male min F] [female max Y obs] [male min Y obs]
  • --check-sex y-only [female max Y obs] [male min Y obs]
  • --impute-sex [female max F] [male min F]
  • --impute-sex ycount [female max F] [male min F] [female max Y obs] [male min Y obs]
  • --impute-sex y-only [female max Y obs] [male min Y obs]

--check-sex normally compares the sex assignments in your input dataset against the ones imputed from X chromosome inbreeding coefficients. ๐Ÿงฌ

  • Make sure the X chromosome pseudo-autosomal region has been split off (with e.g. --split-x) before using this.
  • You also need decent MAF estimates (so if there are very few samples in your immediate fileset, use --read-freq), and your marker set should be in approximate linkage equilibrium.
  • By default, F estimates smaller than 0.2 yield female calls, and values larger than 0.8 yield male calls. If you pass numeric parameter(s) to --check-sex, the first two control these thresholds.

There are now two modes which consider Y chromosome data. ๐Ÿ‘€

  • In ycount mode, gender is still imputed from the X chromosome, but female calls are downgraded to ambiguous whenever more than 0 nonmissing Y genotypes are present, and male calls are downgraded when fewer than 0 are present. (Note that these are counts, not rates.) These thresholds are controllable with --check-sex ycount's optional 3rd and 4th numeric parameters.
  • In y-only mode, gender is imputed from nonmissing Y genotype counts. The male minimum threshold defaults to 1 instead of zero in this case.

--impute-sex changes sex assignments to the imputed values, and is otherwise identical to --check-sex. It must be used with --make-bed/--recode/--write-covar. ๐Ÿ“Œ


  • --fst ['case-control'] โ€” (alias: --Fst) estimates Wright's Fst for each autosomal diploid variant, using the method introduced in Weir BS, Cockerham CC (1984) Estimating F-statistics for the analysis of population structure, given a set of subpopulations defined via --within. Raw and weighted global means are also reported. ๐Ÿ”ฅ
    • If you're interested in the global means, it's usually best to perform this calculation on a marker set in approximate linkage equilibrium.
    • If you've only got two subpopulations, you can represent them with case/control status and use the case-control modifier.

  • --indep <window size>['kb'] <step size (variant ct)> <VIF threshold>
  • --indep-pairwise <window size>['kb'] <step size (variant ct)> <r^2 threshold>
  • --indep-pairphase <window size>['kb'] <step size (variant ct)> <r^2 thresh>

These generate a list of markers in approximate linkage equilibrium. ๐ŸŒธ With the kb modifier, the window size is in kilobase instead of variant count units. (The space before kb is optional, i.e. --indep-pairwise 500 kb 5 0.5 and --indep-pairwise 500kb 5 0.5 have the same effect.) โš ๏ธ Note that you need to rerun PLINK using --extract or --exclude on the .prune.in/.prune.out file to actually apply the list to another computation.


  • --r [{square | square0 | triangle | inter-chr}] [{gz | bin | bin4}] ['spaces'] ['in-phase'] [{d | dprime | dprime-signed}] ['with-freqs'] ['yes-really']
  • --r2 [{square | square0 | triangle | inter-chr}] [{gz | bin | bin4}] ['spaces'] ['in-phase'] [{d | dprime | dprime-signed}] ['with-freqs'] ['yes-really']

LD statistic reports, bestie. ๐Ÿ’… --r yields raw inter-variant correlations, while --r2 reports their squares. You can request results for all pairs in matrix format (if you specify bin or one of the shape modifiers), all pairs in table format (inter-chr), or a limited window in table format (the default).

  • The gz modifier causes the output text file to be gzipped.
  • bin causes the output matrix to be written in double-precision binary format, while bin4 specifies single-precision binary. The matrix is square if no shape is explicitly specified.
  • By default, text matrices are tab-delimited; spaces switches this. ๐Ÿ™ƒ
  • in-phase adds a column with in-phase allele pairs to table-formatted reports. (This cannot be used with very long allele codes.)
  • dprime adds the absolute value of Lewontin's D-prime statistic to table-formatted reports, and forces both r/r^2 and D-prime to be based on the maximum likelihood solution to the cubic equation discussed in Gaunt T, Rodriguez S, Day I (2007) Cubic exact solutions for the estimation of pairwise haplotype frequencies. dprime-signed keeps the sign, while d skips division by D_{max}.
  • with-freqs adds MAF columns to table-formatted reports. โœจ
  • โš ๏ธ Since the resulting file can easily be huge, you're required to add the yes-really modifier when requesting an unfiltered, non-distributed all pairs computation on more than 400k variants. Yes, it really is that serious. ๐Ÿ’€
  • These computations can be subdivided with --parallel (even when the square modifier is active). ๐Ÿ‘‘

  • --ld <variant ID> <variant ID> ['hwe-midp'] โ€” this displays haplotype frequencies, r^2, and D' for a single pair of variants. ๐ŸŽฏ When there are multiple biologically possible solutions to the haplotype frequency cubic equation, all of them are displayed (instead of just the maximum likelihood solution identified by --r/--r2), along with HWE exact test statistics.

  • --show-tags <filename>
  • --show-tags all
    • If a file is specified, list all variants which tag at least one variant named in the file. (This will normally be a superset of the original list, since a variant is considered to tag itself here.) ๐Ÿท๏ธ
    • If all mode is specified, then for each variant, each other variant which tags it is reported.

  • --blocks ['no-pheno-req'] ['no-small-max-span']

Okay so picking up right where we left off, no re-intro needed ๐Ÿ’– โ€” this one estimates haplotype blocks, using Haploview's take on the block definition that Gabriel S et al. (2002) suggested in The Structure of Haplotype Blocks in the Human Genome.

  • Normally, samples with missing phenotypes are not considered by this computation; the 'no-pheno-req' modifier lifts this restriction. ๐Ÿ™ˆ
  • Normally, size-2 blocks may not span more than 20kb, and size-3 blocks are limited to 30kb. The 'no-small-max-span' modifier removes these limits. (blowing straight past the limit, main character energy โœจ)

The .blocks file is valid input for PLINK 1.07's --hap command. However โ€” and bestie I need you to hear me on this one โ€” the --hap... family of flags has not been reimplemented in PLINK 1.9, because the phasing accuracy is just not it compared to other software ๐Ÿ˜ญ. For now, the recommendation is to use BEAGLE instead of PLINK for case/control haplotype association analysis. (You can use --recode beagle to export data to BEAGLE 3.3.) They apologize for the inconvenience, and plan to develop variants of the --hap... flags which handle pre-phased data effectively. ๐Ÿซถ


  • --distance [{square | square0 | triangle}] [{gz | bin | bin4}] ['ibs'] ['1-ibs'] ['allele-ct'] ['flat-missing'] โ€” writes a lower-triangular tab-delimited table of (weighted) genomic distances in allele count units to <output prefix>.dist, plus a list of the corresponding sample IDs to <output prefix>.dist.id. The first row of the .dist file contains a single <genome 1-genome 2> distance, the second row has the <genome 1-genome 3> and <genome 2-genome 3> distances in that order, etc. ๐Ÿ’…
    • It is usually best to perform this calculation on a marker set in approximate linkage equilibrium.
    • If the 'square' or 'square0' modifier is present, a square matrix is written instead; 'square0' fills the upper right triangle with zeroes.
    • If the 'gz' modifier is present, a compressed .dist.gz file is written instead of a plain text file.
    • If the 'bin' modifier is present, a binary (square) matrix of double-precision floating point values, suitable for loading from R, is instead written to <output prefix>.dist.bin. ('bin4' specifies single-precision numbers instead.) This can be combined with 'square0' if you still want the upper right zeroed out, or 'triangle' if you don't want to pad the upper right at all.
    • If the 'ibs' modifier is present, an identity-by-state matrix is written to <output prefix>.mibs. '1-ibs' causes distances expressed as genomic proportions (i.e. 1 - IBS) to be written to <output prefix>.mdist. Combine with 'allele-ct' if you want to generate the usual .dist file as well.
    • By default, distance rescaling in the presence of missing genotype calls is sensitive to allele count distributions: if variant A contributes, on average, twice as much to other pairwise distances as variant B, a missing call at variant A will result in twice as large of a missingness correction. To turn this off (because e.g. your missing calls are highly nonrandom), use the 'flat-missing' modifier.
    • The computation can be subdivided with --parallel. ๐Ÿ”ฅ
  • --distance-matrix, --ibs-matrix โ€” these deprecated commands are equivalent to --distance 1-ibs flat-missing square and --distance ibs flat-missing square, respectively, except that they generate space- instead of tab-delimited text matrices. ๐Ÿ‘‘
  • --make-rel [{square | square0 | triangle}] [{gz | bin | bin4}] [{cov | ibc2 | ibc3}] โ€” writes a lower-triangular variance-standardized realized relationship matrix to <output prefix>.rel, and corresponding IDs to <output prefix>.rel.id. ๐Ÿงฌ
    • It is usually best to perform this calculation on a marker set in approximate linkage equilibrium.
    • 'square', 'square0', 'triangle', 'gz', 'bin', and 'bin4' act as they do on --distance.
    • The 'cov' modifier removes the variance standardization step, causing a covariance matrix to be calculated instead.
    • By default, the diagonal elements in the relationship matrix are based on --ibc's Fhat1; use the 'ibc2' or 'ibc3' modifiers to base them on Fhat2 or Fhat3 instead.
    • The computation can be subdivided with --parallel.
  • --make-grm-gz ['no-gz'] [{cov | ibc2 | ibc3}]
  • --make-grm-bin [{cov | ibc2 | ibc3}]

So --make-grm-gz writes the relationships in GCTA's original gzipped list format, which describes one pair per line, while --make-grm-bin writes them in GCTA 1.1+'s single-precision triangular binary format. Note that these formats explicitly report the number of valid observations (where neither sample has a missing call) for each pair, which is useful input for some scripts. These computations can be subdivided with --parallel. โœจ

  • --rel-cutoff [val] โ€” (alias: --grm-cutoff) excludes one member of each pair of samples with relatedness greater than the given cutoff value (default 0.025). If no later operation will cause the list of remaining samples to be written to disk, this will save it to <output prefix>.rel.id. Note that maximizing the remaining sample size is equivalent to the NP-hard maximum independent set problem, so we use a greedy algorithm instead of guaranteeing optimality. (Use the --make-rel and --keep/--remove flags if you want to try to do better.) ๐Ÿ˜ญ
  • --ibs-test [permutation count]
  • --groupdist [iters] [d]

Given case/control phenotype data, these commands consider three subsets of the distance matrix: pairs of affected samples, affected-unaffected pairs, and pairs of unaffected samples. Each of these subsets has a distribution of pairwise genomic distances; --ibs-test uses permutation to estimate p-values re: which types of pairs are most similar, while --groupdist focuses on the differences between the centers of these distributions and estimates standard errors via delete-d jackknife. ๐Ÿฆ‹

  • --regress-distance [iters] [d] โ€” linear regression of pairwise genomic distances on pairwise average phenotypes and vice versa, using delete-d jackknife for standard errors. A scalar phenotype is required. ๐ŸŒธ
    • With less than two parameters, d is set to <number of people>^0.6 rounded down. With no parameters, 100k iterations are run.
  • --regress-rel [iters] [d] โ€” linear regression of pairwise genomic relationships on pairwise average phenotypes, and vice versa. Defaults for iters and d are the same as for --regress-distance.
  • --genome ['gz'] ['rel-check'] ['full'] ['unbounded'] ['nudge'] โ€” generates an identity-by-descent report. ๐Ÿ‘‘
    • It is usually best to perform this calculation on a marker set in approximate linkage equilibrium.
    • The 'rel-check' modifier excludes pairs of samples with different FIDs from the final report.
    • 'full' adds raw pairwise comparison data to the report.
    • The P(IBD=0/1/2) estimator employed by this command sometimes yields numbers outside the range [0,1]; by default, these are clipped. The 'unbounded' modifier turns off this clipping.
    • Then, when PI_HAT^2 < P(IBD=2), 'nudge' adjusts the final P(IBD=0/1/2) estimates to a theoretically possible configuration.
    • The computation can be subdivided with --parallel.

  • --homozyg [{group | group-verbose}] ['consensus-match'] ['extend'] ['subtract-1-from-lengths']
  • --homozyg-snp <min var count>
  • --homozyg-kb <min length>
  • --homozyg-density <max inverse density (kb/var)>
  • --homozyg-gap <max internal gap kb length>
  • --homozyg-het <max hets>
  • --homozyg-window-snp <scanning window size>
  • --homozyg-window-het <max hets in scanning window hit>
  • --homozyg-window-missing <max missing calls in scanning window hit>
  • --homozyg-window-threshold <min scanning window hit rate>

These commands request a set of run-of-homozygosity reports, and allow you to customize how they are generated. ๐Ÿงš

  • If you're satisfied with all the default settings described below, just use --homozyg with no modifiers. Otherwise, --homozyg lets you change a few binary settings:
  • 'group[-verbose]' adds a report on pools of overlapping runs of homozygosity. (Automatically set when --homozyg-match is present.)
  • With 'group[-verbose]', 'consensus-match' causes pairwise segmental matches to be called based on the variants in the pool's consensus segment, rather than the variants in the pairwise intersection.
  • Due to how the scanning window algorithm works, it is possible for a reported ROH to be adjacent to a few homozygous variants. The 'extend' modifier causes them to be included in the reported ROH if that wouldn't cause a violation of the --homozyg-density bound.
  • By default, segment bp lengths are calculated as <end bp position> - <start bp position> + 1. Therefore, reports normally differ slightly from PLINK 1.07, which does not add 1 at the end. For testing purposes, you can use the 'subtract-1-from-lengths' modifier to apply the old formula.
  • By default, only runs of homozygosity containing at least 100 variants, and of total length >= 1000 kilobases, are noted. You can change these minimums with --homozyg-snp and --homozyg-kb, respectively.
  • By default, a ROH must have at least one variant per 50 kb on average; change this bound with --homozyg-density.
  • By default, if two consecutive variants are more than 1000 kb apart, they cannot be in the same ROH; change this bound with --homozyg-gap.
  • By default, a ROH can contain an unlimited number of heterozygous calls; you can impose a limit with --homozyg-het.
  • By default, the scanning window contains 50 variants; change this with --homozyg-window-snp.
  • By default, a scanning window hit can contain at most 1 heterozygous call and 5 missing calls; change these limits with --homozyg-window-het and --homozyg-window-missing, respectively.
  • By default, for a variant to even be eligible for inclusion in a ROH, the hit rate of all scanning windows containing that variant has to be at least 0.05. Wanna move that goalpost? That's literally what --homozyg-window-threshold is for, bestie. ๐ŸŽ€

  • --cluster ['cc'] [{group-avg | old-tiebreaks}] ['missing'] ['only2'] โ€” okay so this clusters your samples using a pairwise similarity statistic (normally IBS). Let's unpack the modifiers, one by one, no skipping ๐Ÿ’…
    • The 'cc' modifier forces every cluster to contain at least one case and one control. No lonely lil clusters allowed. ๐Ÿฅบ
    • The 'group-avg' modifier makes clusters get joined based on average pairwise similarity instead of minimum pairwise similarity.
    • The 'missing' modifier makes clustering run on identity-by-missingness instead of identity-by-state, and it writes a space-delimited identity-by-missingness matrix to disk.
    • The 'only2' modifier means only a .cluster2 file gets written (and that file is valid input for --within); otherwise you get 2 other files too.
    • By default, IBS ties are not broken the same way PLINK 1.07 broke them, so final cluster solutions tend to differ. This is generally harmless โ€” fr, don't spiral about it ๐Ÿ™ˆ. But if you wanna make testing easier, use the 'old-tiebreaks' modifier to force emulation of the old algorithm. ๐Ÿ•ฐ๏ธ

  • --pca [count] ['header'] ['tabs'] ['var-wts'] โ€” calculates a variance-standardized relationship matrix (use --make-rel/--make-grm-gz/--make-grm-bin if you wanna dump it) and extracts the top 20 principal components. iconic behavior โœจ
    • It's usually best to do this calculation on a marker set that's in approximate linkage equilibrium. iykyk.
    • You can change the number of PCs by passing a numeric parameter.
    • The 'header' modifier adds a header line to the .eigenvec output file. (For compatibility with the GCTA flag of the same name, the default is no header line.)
    • The 'tabs' modifier makes the .eigenvec file(s) tab-delimited.
    • The 'var-wts' modifier requests an additional .eigenvec.var file with PCs expressed as variant weights instead of sample weights.

  • --neighbour <n1> <n2> โ€” (alias: --neighbor) reports IBS distances from each sample to their *n1*th- to *n2*th-nearest neighbors, plus the associated Z-scores and the identities of those neighbors. Genuinely so useful for outlier detection ๐Ÿ‘€

  • --assoc ['perm' | 'mperm='<value>] ['perm-count'] [{fisher | fisher-midp}] ['counts'] ['set-test']
  • --assoc ['perm' | 'mperm='<value>] ['perm-count'] ['qt-means'] ['lin'] ['set-test']
  • --model ['perm' | 'mperm='<value>] ['perm-count'] [{fisher | fisher-midp | trend-only}] ['set-test'] [{dom | rec | gen | trend}] โ€” basic association analysis report ๐Ÿซถ Given a case/control phenotype, --assoc runs a 1df chi-square allelic test, while --model runs 4 other tests as well (1df dominant gene action, 1df recessive gene action, 2df genotypic, Cochran-Armitage trend).
    • With 'fisher'/'fisher-midp', Fisher's exact test is used to generate p-values. 'fisher-midp' also applies Lancaster's mid-p adjustment.
    • 'perm' causes an adaptive permutation test to be performed.
    • 'mperm='<value> causes a max(T) permutation test to be performed with the specified number of replications.
    • 'perm-count' makes the permutation test report include counts instead of frequencies.
    • 'counts' makes --assoc report allele counts instead of frequencies.
    • 'set-test' tests the significance of variant sets. Requires permutation; can be customized with --set-p/--set-r2/--set-max.
    • 'dom', 'rec', 'gen', and 'trend' force the corresponding test to be used as the basis for --model permutation. (By default, the most significant result among the allelic, dominant, and recessive tests is used.)
    • 'trend-only' causes only the trend test to be performed.
    • Given a quantitative phenotype, --assoc normally performs a Wald test.
      • In this case, the 'qt-means' modifier causes trait means and standard deviations stratified by genotype to be reported as well.
      • 'lin' causes the Lin statistic to be computed, and makes it the basis for multiple-testing corrections and permutation tests.

Several other flags (most notably, --aperm) can be used to customize the permutation test. ๐Ÿ’ซ


  • --mh ['perm' | 'mperm='<value>] ['perm-count'] ['set-test'] โ€” (alias: --cmh)
  • --bd ['perm' | 'perm-bd' | 'mperm='<value>] ['perm-count'] ['set-test']
  • --mh2
  • --homog โ€” given a case/control phenotype and a set of clusters, --mh computes 2x2xK Cochran-Mantel-Haenszel statistics for each variant, while --bd also performs the Breslow-Day test for odds ratio homogeneity. Permutation and variant set testing based on the CMH (default) or Breslow-Day (when 'perm-bd' is present) statistic are supported. The following similar analyses are also available:
    • --mh2 swaps the roles of case/control status and cluster membership, performing a phenotype-stratified IxJxK Cochran-Mantel-Haenszel test on association between cluster assignments and genotypes.
    • --homog executes an alternative to the Breslow-Day test, based on partitioning of the chi-square statistic.

  • --gxe [covariate index] โ€” given both a quantitative phenotype and a case/control covariate loaded with --covar that defines two groups, --gxe compares the regression coefficient derived from considering only members of one group to the regression coefficient derived from considering only members of the other. ๐Ÿฆ‹ By default, the first covariate in the --covar file defines the groups; use e.g. "--gxe 3" to base them on the third covariate instead.

  • --linear ['perm' | 'mperm='<value>] ['perm-count'] ['set-test'] [{genotypic | hethom | dominant | recessive | no-snp}] ['hide-covar'] [{sex | no-x-sex}] ['interaction'] ['beta'] ['standard-beta'] ['intercept']
  • --logistic ['perm' | 'mperm='<value>] ['perm-count'] ['set-test'] [{genotypic | hethom | dominant | recessive | no-snp}] ['hide-covar'] [{sex | no-x-sex}] ['interaction'] ['beta'] ['intercept'] โ€” multi-covariate association analysis on a quantitative (--linear) or case/control (--logistic) phenotype. Normally you'd use these with --covar. ๐Ÿ”ฅ
    • 'perm' normally causes an adaptive permutation test to be performed on the main effect, while 'mperm='<value> starts a max(T) permutation test.
    • 'perm-count' makes the permutation test report include counts instead of frequencies.
    • 'set-test' tests the significance of variant sets. Requires permutation; can be customized with --set-p/--set-r2/--set-max.
    • The 'genotypic' modifier adds an additive effect/dominance deviation 2df joint test (0/1/2 and 0/1/0 coding), while 'hethom' uses 0/0/1 and 0/1/0 coding instead. If permutation is also requested, these modifiers cause permutation to be based on the joint test.
    • 'dominant' and 'recessive' specify a model assuming full dominance or recessiveness, respectively, for the A1 allele.
    • 'no-snp' causes regression to be performed only on the phenotype and the covariates, with no reference to genomic data. If permutation is also requested, results are reported for all covariates.
    • 'hide-covar' removes covariate-specific lines from the report.
    • By default, sex (male = 1, female = 0) is automatically added as a covariate on X chromosome variants, and nowhere else. The 'sex' modifier causes it to be added everywhere, while 'no-x-sex' excludes it.
    • 'interaction' adds genotype x covariate interactions to the model. This cannot be used with the usual permutation tests; use --tests to define the permutation test statistic instead. ๐Ÿšจ
    • 'intercept' causes intercepts to be included in the main report.
    • For logistic regressions, the 'beta' modifier causes regression coefficients instead of odds ratios to be reported.
    • With --linear, the 'standard-beta' modifier standardizes the phenotype and all predictors to zero mean and unit variance before regression.

  • --dosage <allele dosage file> ['noheader'] ['skip0='<i>] ['skip1='<j>] ['skip2='<k>] ['dose1'] ['format='<m>] ['Zout'] [{occur | standard-beta}] ['sex'] ['case-control-freqs']
  • --dosage <list file> list [{sepheader | noheader}] ['skip0='<i>] ['skip1='<j>] ['skip2='<k>] ['dose1'] ['format='<m>] ['Zout'] [{occur | standard-beta}] ['sex'] ['case-control-freqs']
  • --write-dosage โ€” processes (possibly gzipped) text files with variant-major allelic dosage data. ๐Ÿ“ This cannot be used with a regular input fileset; instead, you must only specify a .fam and possibly a .map file, and you can't specify any other commands.
Heads up bestie: PLINK 2.0 will have first-class support for genotype probabilities. An equivalent data import flag will be provided then, and --dosage will be retired. ๐Ÿ’€
  • By default, --dosage assumes that only one allelic dosage file should be loaded. To specify multiple files:
    1. create a master list with one entry per line. There are normally two supported formats for this list: just a filename per line, or variant batch numbers in the first column and filenames in the second.
    2. Provide the name of that list as the first --dosage parameter.
    3. Add the 'list' modifier.
  • By default, --dosage assumes the allelic dosage file(s) contain a header line, which has 'SNP' in column i+1, 'A1' in column i+j+2, 'A2' in column i+j+3, and sample FID/IIDs starting from column i+j+k+4. (i/j/k are normally zero, but can be changed with 'skip0', 'skip1', and 'skip2' respectively.) If such a header line is not present:
    • when all samples appear in the same order as they do in the .fam file, you can use the 'noheader' modifier.
    • Otherwise, use the 'sepheader' modifier, and append sample ID filenames to your 'list' file entries.

  • The 'format=' modifier lets you say how many values are used to represent each dosage. 'format=1' normally means a single 0..2 A1 expected count; 'dose1' switches that up into a 0..1 frequency. 'format=2' โ€” the default, bestie ๐Ÿ’… โ€” means a 0..1 homozygous A1 likelihood followed by a 0..1 het likelihood, and 'format=3' means 0..1 hom A1, 0..1 het, 0..1 hom A2. โœจ
  • 'Zout' makes the output file get gzipped. ๐ŸŽ€
  • Normally an association analysis runs. 'standard-beta' and 'sex' act how they're supposed to with --linear/--logistic, no notes. And 'case-control-freqs' makes case and control allele frequencies get reported separately. ๐Ÿฆ‹
  • There are three alternate modes that make the association analysis get skipped entirely:
    • 'occur' asks for a simple variant occurrence report. ๐ŸŒธ
    • --write-dosage makes a simple merged file get generated that matches the 'format' spec (not counting 'dose1', okurrr).
    • --score applies a linear scoring system to the dosages. ๐Ÿ”ฅ

  • --lasso <h2 estimate> [min lambda] ['report-zeroes'] โ€” estimates variant effect sizes via LASSO regression. You have to hand it an additive heritability estimate to calibrate the regression, that part isn't optional. Heads up though: this method may need a genuinely huge sample size (like, hundreds of thousands) before it's effective on complex polygenic traits. ๐Ÿ’€
  • --test-missing ['perm' | 'mperm='<value>] ['perm-count'] ['midp'] โ€” checks for association between missingness and case/control status using Fisher's exact test. (Het. haploids get treated as missing, fyi.) The 'midp' modifier makes Lancaster's mid-p adjustment get applied. โœจ
  • --make-perm-pheno <ct> โ€” generates phenotype permutations and writes them to disk, without invoking an association test. Just the permutations, nothing more. ๐ŸŽ€
  • --tdt [{exact | exact-midp | poo}] ['perm' | 'mperm='<value>] ['perm-count'] [{parentdt1 | parentdt2 | pat | mat}] ['set-test'] โ€” reports transmission disequilibrium test statistics, given case/control phenotypes and pedigree information.
    • A Mendel error check runs before the main tests; offending genotypes get treated as missing by this analysis. ๐Ÿ™ˆ
    • By default the basic TDT p-value is based on a chi-square test, unless you request the exact binomial test with 'exact' or 'exact-midp'.
    • 'perm'/'mperm=' requests a family-based adaptive or max(T) permutation test. By default the permutation test statistic is the basic TDT p-value; 'parentdt1'/'parentdt2' make parenTDT or combined test p-values get considered instead.
    • 'set-test' tests the significance of variant sets. This cannot be used with exact tests for now, sorry bestie. ๐Ÿ˜ญ
    • The 'poo' modifier makes a parent-of-origin analysis get performed instead, with transmissions from heterozygous fathers and heterozygous mothers considered separately.
      • The parent-of-origin analysis does not currently support exact tests. ๐Ÿšซ
      • By default the permutation test statistic is the absolute parent-of-origin test Z score; 'pat'/'mat' make paternal or maternal TDT chi-square statistics, respectively, get considered instead.
  • --qfam ['perm' | 'mperm='<value>] ['perm-count'] ['emp-se']
  • --qfam-parents ['perm' | 'mperm='<value>] ['perm-count'] ['emp-se']
  • --qfam-between ['perm' | 'mperm='<value>] ['perm-count'] ['emp-se']
  • --qfam-total ['perm' | 'mperm='<value>] ['perm-count'] ['emp-se'] โ€” QFAM family-based association test for quantitative traits. ๐Ÿ’œ
    • A Mendel error check runs before the main tests; offending genotypes get treated as missing by this analysis. ๐Ÿ™ˆ
    • This procedure requires permutation. 'perm' and 'perm-count' have the usual meanings. However, 'mperm='<value> just specifies a fixed number of permutations; the method does not support a proper max(T) test. ๐Ÿซถ
    • The 'emp-se' modifier adds BETA and EMP_SE (empirical standard error for beta) fields to the .perm output file. โœจ
  • --annotate <PLINK report> ['attrib='<file>] ['ranges='<file>] ['filter='<file>] ['snps='<file>] [{NA | prune}] ['block'] ['subset='<file>] ['minimal'] ['distance'] โ€” adds annotations to a variant-based PLINK report. This needs an annotation source, no cap:
    • 'attrib='<file> specifies a (possibly gzipped) attribute file. ๐ŸŽ€
    • 'ranges='<file> specifies a gene/range list file. (Both source types can be specified at the same time, iconic.) ๐Ÿ‘‘
    • The following options are also supported:
      • 'filter='<file> makes only variants within one of the ranges in the file get included in the new report.
      • 'snps='<file> makes only variants named in the file get included in the new report.
      • The 'NA' modifier makes unannotated variants have 'NA' instead of . in the new report's ANNOT column, while the 'prune' modifier excludes them entirely. ๐Ÿšซ
      • The 'block' modifier replaces the single ANNOT column with a 0/1-coded column for each possible annotation.
      • With 'ranges':
        • 'subset='<file> makes only intervals named in the subset file get loaded from the ranges file. ๐ŸŒธ
        • interval annotations normally come with a parenthesized signed distance to the interval boundary (0 if the variant is located inside the interval; this is always true without --border). They can be excluded with the 'minimal' modifier.
        • the 'distance' modifier adds 'DIST' and 'SGN' columns describing signed distance to the nearest interval. ๐Ÿฆ‹
    • When --pfilter is present, high p-values get filtered out. โœจ
  • --clump <PLINK report filename(s)...> โ€” processes association analysis report(s) with 'SNP' and p-value columns, organizing results by LD-based clumps. Multiple filenames can be separated by spaces or commas, whichever vibe you're on. ๐Ÿ’…
  • --gene-report <PLINK report> <gene range file> โ€” generates a gene-based report from a variant-based report. ๐Ÿ”ฅ
    • When --pfilter is present, high p-values get filtered out.
    • When --extract (without 'range') is present, only variants named in the --extract file get considered.
  • --meta-analysis <PLINK report filenames...>
  • --meta-analysis <PLINK report filenames...> + [{logscale | qt}] [{no-map | no-allele}] ['study'] ['report-all'] ['weighted-z'] โ€” performs a meta-analysis on several variant-based reports with 'SNP' and 'SE' fields. ๐Ÿงš
    • Normally an 'OR' odds ratio field must also be present in each input file. With 'logscale', 'BETA' log-odds values/regression coefficients get expected instead, but the generated report will still contain odds ratio estimates. With 'qt', both input and output values are regression betas. ๐Ÿ“Š
    • 'CHR', 'BP', and 'A1' fields are also normally required. 'no-map' makes them all get ignored, while 'no-allele' makes just 'A1' get ignored.
    • If 'A2' fields are present, and neither 'no-map' nor 'no-allele' was specified, A1/A2 allele flips get handled properly. Otherwise, A1 mismatches get thrown out. ๐Ÿ—‘๏ธ
    • 'study' makes study-specific effect estimates get collated in the meta-analysis report.
    • 'report-all' makes variants present in only a single input file get included in the meta-analysis report. ๐Ÿ’–
    • 'weighted-z' requests weighted Z-score-based p-values (as computed by the Abecasis Lab's METAL software) in addition to the usual inverse variance-based analysis. This requires P and effective sample size fields. โญ
    • When --extract (without 'range') is present, only variants named in the --extract file get considered.
    • Unless 'no-map' is specified, chromosome filters also get respected. ๐Ÿ‘‘
  • --fast-epistasis [{boost | joint-effects | no-ueki}] ['case-only'] [{set-by-set | set-by-all}] ['nop']
  • --epistasis [{set-by-set | set-by-all}] โ€” scan for epistatic interactions, the two of them together. ๐Ÿ” --fast-epistasis inspects 3x3 joint genotype count tables and only applies to case/control phenotypes, while --epistasis performs linear or logistic regression.
    • By default, --fast-epistasis uses the PLINK 1.07 allele-based test. Two newer tests are now supported: 'boost' invokes the likelihood ratio test introduced by Wan X et al. (2010) BOOST: A Fast Approach to Detecting Gene-Gene Interactions in Genome-wide Case-Control Studies, while 'joint-effects' applies the joint effects test introduced in Ueki M, Cordell HJ (2012) Improved statistics for genome-wide interaction analysis. ๐Ÿ“š
    • The original --fast-epistasis test normally applies the variance and empty cell corrections suggested by Ueki and Cordell's paper. To disable them, use the 'no-ueki' modifier. ๐Ÿ™ˆ
    • 'case-only' requests a case-only instead of a case/control test.
    • By default, all pairs of variants across the entire genome get tested. To just test pairs of variants within a single set, add the 'set-by-set' modifier and load exactly one set with --set/--make-set; with exactly two sets loaded, all variants in one set get tested against all variants in the other. 'set-by-all' tests all variants in one set against the entire genome instead. ๐ŸŒˆ
    • 'nop' strips p-values from the main report.
    • These computations can be subdivided with --parallel; however...
  • --epistasis-summary-merge <common file prefix> <ct> โ€” when a --[fast-]epistasis job gets subdivided with --parallel, the main report can be assembled at the end by applying Unix 'cat' in the usual manner, but the .summary.1, .summary.2, ... files may require a specialized merge. --epistasis-summary-merge takes care of the latter. ๐Ÿซถ
  • --twolocus <variant ID> <variant ID> โ€” two-locus joint genotype count report. ๐ŸŽ€
  • --score <filename> [i] [j] [k] ['header'] [{sum | no-sum}] [{no-mean-imputation | center}] ['include-cnt'] ['double-dosage']

okay so real talk about scoring ๐Ÿ’– โ€” you're applying a linear scoring system to every single sample. The input file needs one line per scored variant. Variant IDs get read from column #i, allele codes from column #j, and the actual scores from column #k โ€” where i defaults to 1, j defaults to i+1, and k defaults to j+1. Slay, the defaults just keep stacking ๐Ÿซถ

  • the header modifier means the first nonempty line of the input file gets ignored. Without it? --score straight up assumes there's no header line at all.
  • by default, the final scores are averages of the valid per-variant scores. very demure, very mindful.

The sum modifier makes it report sums instead. no cap:

you cannot use sum together with no-mean-imputation. Also, for backward compatibility, sum is automatically on with dosage data unless you specify no-sum.
  • by default, copies of the unnamed allele contribute zero to the score, while missing genotypes contribute an amount proportional to the loaded (via --read-freq) or imputed allele frequency. If you wanna throw out missing observations instead โ€” which decreases the denominator in the final average when that happens โ€” use the no-mean-imputation modifier.
  • alternatively, you can use the center modifier to shift all scores to mean zero. iconic behaviour honestly โœจ
  • this command can be used with dosage data. By default, the CNT column is omitted from the output file in that case โ€” use include-cnt to keep it. Also note: scores get multiplied by 0..1 dosages, not 0..2 diploid allele counts, unless the double-dosage modifier is present. iykyk ๐Ÿ’…

โœจ the R girlies โœจ

  • --R <R script file> ['debug'] โ€” connect to a Rserve background process (preferably version 1.7 or later) and execute the Rplink function defined in the input file. Unless the 'debug' modifier is present โ€” in which case, the R commands that PLINK would have tried to execute get logged to a file. bestie just wants to watch ๐Ÿ‘€

๐ŸŒธ --write-var-ranges <block ct> ๐ŸŒธ

divide the set of variants into equal-size blocks. (Can be used with --snps to split a job across multiple machines โ€” group project but make it efficient ๐Ÿฆ‹)


the following other flags are supported. (Order of operations is described at https://www.cog-genomics.org/plink/1.9/order.) ๐Ÿ“‹

  • --script <fname> โ€” include command-line options from file.
  • --rerun [log] โ€” rerun commands in log (default 'plink.log').
  • --version โ€” display only the version number before exiting.
  • --silent โ€” suppress output to console. shhh ๐Ÿคซ
  • --gplink โ€” reserved for interoperation with gPLINK.
  • --missing-genotype <char> โ€” set the missing genotype code (normally '0').
  • --double-id โ€” set both FIDs and IIDs to the VCF/BCF sample ID.
  • --const-fid [ID] โ€” set all FIDs to the given constant (default '0').
  • --id-delim [d] โ€” parse sample IDs as <FID><d><IID> (default delim '_').
  • --vcf-idspace-to <c> โ€” convert spaces in sample IDs to the given character.
  • --biallelic-only ['strict'] ['list'] โ€” skip VCF variants with 2+ ALT alleles.
  • --vcf-min-qual <val> โ€” skip VCF variants with low/missing QUAL.
  • --vcf-filter [exception(s)...] โ€” skip variants which have FILTER failures.
  • --vcf-require-gt โ€” skip variants with no GT field.
  • --vcf-min-gq <val> โ€” no-call a genotype when GQ is below the given threshold.
  • --vcf-min-gp <val> โ€” no-call a genotype when 0-1 scaled GP is below the given threshold.
  • --vcf-half-call <m> โ€” specify how '0/.' and similar VCF GT values should be handled. four modes, bestie:
    • 'error'/'e' (default) โ€” errors out and reports the line #. dramatic but valid ๐Ÿ’€
    • 'haploid'/'h' โ€” treats them as haploid calls.
    • 'missing'/'m' โ€” treats them as missing.
    • 'reference'/'r' โ€” treats the missing value as 0.
  • --oxford-single-chr <chr nm> โ€” specify single-chromosome .gen file with ignorable first column.
  • --oxford-pheno-name <col nm> โ€” import named phenotype from the .sample file.
  • --hard-call-threshold <val> / --hard-call-threshold random โ€” when an Oxford-format fileset is loaded, calls with uncertainty level greater than 0.1 are normally treated as missing. You can adjust this threshold by providing a numeric parameter, or randomize all calls with 'random'.
  • --missing-code [string list] (alias: --missing_code) โ€” comma-delimited list of missing phenotype values for Oxford-format filesets (def. 'NA').
  • --simulate-ncases <num> โ€” set --simulate case count (default 1000).
  • --simulate-ncontrols <n> โ€” set --simulate control count (default 1000).
  • --simulate-prevalence <p> โ€” set --simulate disease prevalence (default 0.01).
  • --simulate-n <num> โ€” set --simulate-qt sample count (default 1000).
  • --simulate-label <prefix> โ€” set --simulate[-qt] FID/IID name prefix.
  • --simulate-missing <freq> โ€” set --simulate[-qt] missing genotype frequency.
  • --allow-extra-chr ['0'] (alias: --aec) โ€” permit unrecognized chromosome codes. The '0' modifier causes them to be treated as if they had been set to zero.
  • --chr-set <autosome ct> ['no-x'] ['no-y'] ['no-xy'] ['no-mt'] โ€” specify a nonhuman chromosome set. The first parameter sets the number of diploid autosome pairs if positive, or haploid chromosomes if negative. Given diploid autosomes, the remaining modifiers indicate the absence of the named non-autosomal chromosomes.
  • --cow/--dog/--horse/--mouse/--rice/--sheep โ€” shortcuts for those species ๐Ÿ„๐Ÿถ๐Ÿด๐Ÿญ๐ŸŒพ๐Ÿ‘
  • --autosome-num <value> โ€” alias for "--chr-set <value> no-y no-xy no-mt".
  • --cm-map <fname pattern> [chr] โ€” use SHAPEIT-format recombination maps to set centimorgan positions. To process more than one chromosome, include a '@' in the first parameter where the chrom. number belongs, e.g. 'genetic_map_chr@_combined_b37.txt'.
  • --zero-cms โ€” zero out centimorgan positions.
  • --allow-no-samples โ€” allow the input fileset to contain no samples.
  • --allow-no-vars โ€” allow the input fileset to contain no variants.
  • --pheno <fname> โ€” load phenotype data from the specified file, instead of using the values in the main input fileset.
  • --all-pheno โ€” for basic association tests, loop through all phenotypes in the --pheno file.
  • --mpheno <n> โ€” load phenotype from column (n+2) in the --pheno file.
  • --pheno-name <c> โ€” if the --pheno file has a header row, use the column with the given name.
  • --pheno-merge โ€” when the main input fileset contains a phenotype value for a sample, but the --pheno file doesn't, use the original value instead of treating the phenotype as missing.
  • --missing-phenotype <v> โ€” set missing phenotype value (normally -9).
  • --1 โ€” expect case/control phenotypes to be coded as 0 = control, 1 = case, instead of the usual 0 = missing, 1 = control, 2 = case. This also forces phenotypes to be interpreted as case/ctrl.
  • --make-pheno <fn> <val> โ€” define a new case/control phenotype. If the val parameter is '*', all samples listed in the given file are cases, and everyone else is a control. (Note that, in some shells, it's necessary to surround the * with quotes.) Otherwise, all samples with third column entry equal to the val parameter are cases, and all other samples mentioned in the file are controls.
  • --tail-pheno <Lt> [Hbt] โ€” downcode a scalar phenotype to a case/control phenotype. All samples with phenotype values greater than Hbt are cases, and all with values less than or equal to Lt are controls. If Hbt is unspecified, it's equal to Lt; otherwise, in-between phenotype values are set to missing.
  • --covar <filename> ['keep-pheno-on-missing-cov'] โ€” specify covariate file.
  • --covar-name <...> โ€” specify covariate(s) in the --covar file by name. Separate multiple names with spaces or commas, and use dashes to designate ranges.
  • --covar-number <...> โ€” specify covariate(s) in the --covar file by index.
  • --no-const-covar โ€” exclude constant covariates.
  • --allow-no-covars โ€” allow no covariates to be loaded from the --covar file.
  • --within <f> ['keep-NA'] โ€” specify initial cluster assignments.
  • --mwithin <n> โ€” load cluster assignments from column n+2.
  • --family โ€” create a cluster for each family ID.
  • --loop-assoc <f> ['keep-NA'] โ€” run specified case/control association commands once for each cluster in the file, using cluster membership as the phenotype.
  • --set <filename> โ€” load sets from a .set file.
  • --set-names <name(s)...> โ€” load only sets named on the command line. Use spaces to separate multiple names.
  • --subset <filename> โ€” load only sets named in the given text file.
  • --set-collapse-all <set name> โ€” merge all sets.
  • --complement-sets โ€” invert all sets. (Names gain 'C_' prefixes.)
  • --make-set-complement-all <s> โ€” --set-collapse-all + inversion.
  • --make-set <filename> โ€” define sets from a list of named bp ranges.
  • --make-set-border <kbs> โ€” stretch regions in the --make-set file.
  • --make-set-collapse-group โ€” define sets from groups instead of sets in the --make-set file.
  • --keep <filename> โ€” exclude all samples not named in the file.
  • --remove <filename> โ€” exclude all samples named in the file.
  • --keep-fam <filename> โ€” exclude all families not named in the file.
  • --remove-fam <filename> โ€” exclude all families named in the file.
  • --extract ['range'] <f> โ€” exclude all variants not named in the file.
  • --exclude ['range'] <f> โ€” exclude all variants named in the file.
  • --keep-clusters <filename> โ€” these can be used individually or in combination (with the next one ๐Ÿ‘‡) to define a list of clusters to keep; all samples not in a cluster in that list are then excluded.
  • --keep-cluster-names <name(s)...> โ€” the other half of that combo ๐Ÿ’… use spaces to separate cluster names.
  • --remove-clusters <filename> โ€” exclude all clusters named in the file.
  • --remove-cluster-names <name(s)...> โ€” exclude the named clusters.
  • --gene <sets...> โ€” exclude variants not in a set named on the command line. (Separate multiple set names with spaces.)
  • --gene-all โ€” exclude variants which aren't a member of any set. (PLINK 1.07 automatically did this under some circumstances.)
  • --attrib <f> [att lst] โ€” given a file assigning attributes to variants, and aโ€ฆ to be continued, bestie ๐ŸŽ€
  • --attrib-indiv <f> [a] โ€” bestie, this is a comma-delimited list (and no whitespace, we don't do that here) of attribute names. It yeets the variants/samples that are either missing from the file or don't have any of the listed attributes. โœจ Now here's the cute twist: if some attribute names in the list start with a '-', those become "negative match conditions" instead โ€” so any variant with at least one negative-match attribute gets removed. โš ๏ธ Heads up though: the first character in the list cannot be a '-', because that's just how command-line parsing works. Add a comma in front to get around it. iykyk.
  • --chr <chrs...> โ€” exclude all variants that aren't on the given chromosome(s). For humans the valid choices are 0 (unplaced), 1-22, X, Y, XY, and MT. Separate multiple chromosomes with spaces and/or commas, and use a dash (with no adjacent spaces, ok?) to denote a range, like "--chr 1-4, 22, xy". ๐Ÿ’…
  • --not-chr <...> โ€” the reverse of --chr, it excludes variants on the listed chromosomes. simple as that ๐Ÿฆ‹
  • --autosome โ€” exclude all non-autosomal variants. bye bye sex chromosomes โœŒ๏ธ
  • --autosome-xy โ€” same energy, but it excludes all non-autosomal variants except those with chromosome code XY (the pseudo-autosomal region of X). ๐Ÿงฌ
  • --snps-only ['just-acgt'] โ€” exclude non-SNP variants. By default, "SNP" means both allele codes are single-character; 'just-acgt' restricts the codes to {A,C,G,T,a,c,g,t,<missing>}. so picky, love that ๐ŸŒธ
  • --from <var ID> and --to <var ID> โ€” use ID(s) to specify a variant range to load. When used together, both variants must be on the same chromosome. no cross-chromosome shenanigans ๐Ÿ”ฅ
  • --snp <var ID> โ€” specify a single variant to load.
  • --exclude-snp <> โ€” specify a single variant to exclude.
  • --window <kbs> โ€” with --snp or --exclude-snp, this loads/excludes all variants within half the specified kb distance of the named one. half. not the whole thing. ๐Ÿ’€
  • --from-bp <pos>, --to-bp <pos>, --from-kb <pos>, --to-kb <pos>, --from-mb <pos>, --to-mb <pos> โ€” use physical position(s) to define a variant range to load. --from-kb/--to-kb/--from-mb/--to-mb allow decimal values. ๐Ÿซถ And listen โ€” you must also specify a single chromosome (with e.g. --chr) when using these flags, no exceptions bestie.
  • --snps <var IDs...> and --exclude-snps <...> โ€” use IDs to specify variant range(s) to load or exclude. E.g. "--snps rs1111-rs2222, rs3333, rs4444". chef's kiss ๐Ÿ’–
  • --thin <p> โ€” randomly remove variants, retaining each with probability p. ๐ŸŽฒ
  • --thin-count <n> โ€” randomly remove variants until n of them remain.
  • --bp-space <bps> โ€” remove variants so that each pair is no closer than the given bp distance. (Equivalent to VCFtools --thin.) ๐Ÿ‘‘
  • --thin-indiv <p> โ€” randomly remove samples, retaining with probability p.
  • --thin-indiv-count <n> โ€” randomly remove samples until n of them remain.
  • --filter <f> <val(s)...> โ€” exclude all samples without a 3rd column entry in the given file matching one of the given space-separated value(s).
  • --mfilter <n> โ€” match against the (n+2)th column instead. fancy ๐ŸŽ€
  • --geno [val] โ€” exclude variants with missing call frequencies greater than a threshold (default 0.1). โš ๏ธ Important lore: the default threshold is only applied if --geno is invoked without a parameter; when --geno is not invoked, no per-variant missing call frequency ceiling is enforced at all. And the other inclusion/exclusion default thresholds work exactly the same way. not me being consistent โœจ
  • --mind [val] โ€” exclude samples with missing call frequencies greater than a threshold (default 0.1).
  • --oblig-missing <f1> <f2> โ€” specify blocks of missing genotype calls for --geno/--mind to ignore. The first file should have variant IDs in the first column and block IDs in the second, while the second file should have FIDs in the first column, IIDs in the second, and block IDs in the third. structure queen ๐Ÿ’…
  • --prune โ€” remove samples with missing phenotypes.
  • --maf [freq] โ€” exclude variants with minor allele frequency lower than a threshold (default 0.01).
  • --max-maf <freq> โ€” exclude variants with MAF greater than the threshold.
  • --mac <ct> (alias: --min-ac) โ€” exclude variants with minor allele count lower than the given threshold.
  • --max-mac <ct> (alias: --max-ac) โ€” exclude variants with minor allele count greater than the given threshold.
  • --maf-succ โ€” Rule of succession MAF estimation (the one used in EIGENSOFT ๐Ÿงฎ). Given j observations of one allele and k >= j observations of the other, it infers a MAF of (j+1) / (j+k+2), rather than the default j / (j+k). math girlies rise ๐Ÿฆ‹
  • --read-freq <fn> โ€” estimate MAFs and heterozygote frequencies from the given --freq[x] report, instead of the input fileset.
  • --hwe <p> ['midp'] ['include-nonctrl'] โ€” exclude variants with Hardy-Weinberg equilibrium exact test p-values below a threshold.
  • --me <t> <v> ['var-first'] โ€” filter out trios and variants with Mendel error rates exceeding the given thresholds.
  • --me-exclude-one [ratio] โ€” make --me exclude only one sample per trio. one. just one. ๐Ÿ™ˆ
  • --qual-scores <f> [qcol] [IDcol] [skip] โ€” filter out variants with out-of-range quality scores. The default range is now [0, \infty ). โœจ
  • --qual-threshold <min qual score> โ€” set the --qual-scores range floor.
  • --qual-max-threshold <max qual score> โ€” set the --qual-scores range ceiling.
  • --allow-no-sex โ€” do not treat ambiguous-sex samples as having missing phenotypes in analysis commands. (Automatic with --no-sex.)
  • --must-have-sex โ€” force ambiguous-sex phenotypes to missing on --make-bed/--make-just-fam/--recode/--write-covar.
  • --filter-cases โ€” include only cases in the current analysis.
  • --filter-controls โ€” include only controls.
  • --filter-males โ€” include only males.
  • --filter-females โ€” include only females.
  • --filter-founders โ€” include only founders.
  • --filter-nonfounders โ€” include only nonfounders.
  • --nonfounders โ€” include nonfounders in allele freq/HWE calculations.
  • --make-founders ['require-2-missing'] ['first'] โ€” clear parental IDs for those with 1+ missing parent(s). ๐Ÿซถ
  • --recode-allele <fn> โ€” with --recode A/A-transpose/AD, count alleles named in the file (otherwise A1 alleles are always counted).
  • --output-chr <MT code> โ€” set the chromosome coding scheme in output files by providing the desired human mitochondrial code. (Options are '26', 'M', 'MT', '0M', 'chr26', 'chrM', and 'chrMT'.) ๐Ÿงฌ
  • --output-missing-genotype <ch> โ€” set the code used to represent missing genotypes in output files (normally the --missing-genotype value).
  • --output-missing-phenotype <s> โ€” set the string used to represent missing phenotypes in output files (normally the --missing-phenotype value).
  • --zero-cluster <f> โ€” in combination with --within/--family, set blocks of genotype calls to missing. The input file should have variant IDs in the first column and cluster IDs in the second. โš ๏ธ This must now be used with --make-bed and no other output commands. periodt.
  • --set-hh-missing โ€” cause --make-bed and --recode to set heterozygous haploid genotypes to missing.
  • --set-mixed-mt-missing โ€” cause --make-bed and --recode to set mixed MT genotypes to missing.
  • --split-x <bp1> <bp2> ['no-fail'] / --split-x <build> ['no-fail'] โ€” changes the chromosome code of all chrX variants with bp position <= bp1 or >= bp2 to XY. These build codes are supported as shorthand: ๐ŸŒˆ
    • 'b36'/'hg18' = NCBI 36, 2709521/154584237
    • 'b37'/'hg19' = GRCh37, 2699520/154931044
    • 'b38'/'hg38' = GRCh38, 2781479/155701383

By default, PLINK errors out when no variants would be affected by --split-x; the 'no-fail' modifier (useful in scripts) overrides this. ๐Ÿ’…

  • --merge-x ['no-fail'] โ€” merge the XY chromosome back with X.
  • --set-me-missing โ€” cause --make-bed to set Mendel errors to missing.
  • --fill-missing-a2 โ€” cause --make-bed to replace all missing calls with homozygous A2 calls.
  • --set-missing-var-ids <t> โ€” given a template string with a '@' where the chromosome code should go and a '#' where the bp coordinate belongs, --set-missing-var-ids assigns chromosome-and-bp-based IDs to unnamed variants. You may also use '$1' and '$2' to refer to allele names in the template string โ€” and honestly this becomes essential when multiple variants share the same coordinate. no cap. ๐Ÿ”ฅ
  • --new-id-max-allele-len <n> โ€” specify the maximum number of leading characters from allele names to include in new variant IDs (default 23).
  • --missing-var-code <string> โ€” change the unnamed variant code (default '.').
  • --update-chr <f> [chrcol] [IDcol] [skip] โ€” update variant chromosome codes.
  • --update-cm <f> [cmcol] [IDcol] [skip] โ€” update centimorgan positions.
  • --update-map <f> [bpcol] [IDcol] [skip] โ€” update variant bp positions.
  • --update-name <f> [newcol] [oldcol] [skip] โ€” update variant IDs.
  • --update-alleles <fname> โ€” update variant allele codes.
  • --allele1234 ['multichar'] โ€” interpret/recode A/C/G/T alleles as 1/2/3/4. With 'multichar', it converts all A/C/G/Ts in allele names to 1/2/3/4s. ๐ŸŒธ
  • --alleleACGT ['multichar'] โ€” the reverse of --allele1234. ๐Ÿ’ซ
  • --update-ids <f> โ€” update sample IDs.
  • --update-parents <f> โ€” update parental IDs.
  • --update-sex <f> [n] โ€” update sexes. Sex (1 or M = male, 2 or F = female, 0 = missing) is loaded from column n+2 (default n is 1).
  • --flip <filename> โ€” flip alleles (A<->T, C<->G) for the SNP IDs in the file. ๐Ÿ”„
  • --flip-subset <fn> โ€” only apply --flip to samples in the --flip-subset file.
  • --flip-scan-window <ct+1> โ€” set the --flip-scan max variant ct dist. (def. 10).
  • --flip-scan-window-kb <x> โ€” set the --flip-scan max kb distance (default 1000).
  • --flip-scan-threshold <x> โ€” set the --flip-scan min correlation (default 0.5).
  • --keep-allele-order and --real-ref-alleles โ€” keep the allele order defined in the .bim file, instead of forcing A2 to be the major allele. --real-ref-alleles also removes 'PR' from the INFO values emitted by --recode vcf{,-fid,-iid}. ๐Ÿ‘‘
  • --a1-allele <f> [a1col] [IDcol] [skip] โ€” force alleles in the file to A1.
  • --a2-allele <filename> [a2col] [IDcol] [skip] โ€” force alleles in the file to A2. e.g. "--a2-allele <VCF filename> 4 3 '#'" ๐Ÿ’–

which scrapes reference allele assignments from a VCF file, is especially useful.) like ok bestie that one's the goat fr ๐Ÿ


  • --indiv-sort <m> [f] โ€” sets the FID/IID sort order. Four modes, pick ur fighter:
    • 'none'/'0' keeps samples in the order they were loaded. This is the default for non-merge operations.
    • 'natural'/'n' invokes 'natural sort', e.g. 'id2' < 'ID3' < 'id10'. This is the default when merging.
    • 'ascii'/'a' sorts in ASCII order, e.g. 'ID3' < 'id10' < 'id2'. chaotic but valid ๐Ÿ’…
    • 'file'/'f' uses the order in the given file (named in the second parameter).
    • For now, only --merge/--bmerge/--merge-list and --make-bed/--make-just-fam respect this flag. everyone else is just standing there ๐Ÿง
  • --with-phenotype ['no-parents'] [{no-sex | female-2}] โ€” include more sample info in the new .cov file. more lore in the file, we love to see it โœจ
  • --dummy-coding [N] ['no-round'] โ€” split categorical variables (n categories, 2 < n <= N, default N is 49) into n-1 binary dummy variables when writing the covariate file. turning one big vibe into a bunch of little binary vibes ๐Ÿฆ‹
  • --merge-mode <n> โ€” tweak --[b]merge/--merge-list behavior with a numeric code. here's the menu, bestie:
    1. 1 (default) = ignore missing calls, otherwise difference -> missing
    2. 2 = only overwrite originally missing calls
    3. 3 = only overwrite when nonmissing in new file
    4. 4/5 = never overwrite and always overwrite, respectively
    5. 6 = report all mismatching calls without merging
    6. 7 = report mismatching nonmissing calls without merging
  • --merge-equal-pos โ€” with --merge/--bmerge/--merge-list, merge variants with different names but identical positions. (Exception: same-position chromosome code 0 variants aren't merged.) same spot, different name, they're getting married anyway ๐Ÿ’
  • --mendel-duos โ€” make Mendel error checks consider samples with only one parent in the dataset. single-parent representation!! ๐Ÿซถ
  • --mendel-multigen โ€” make Mendel error checks consider (great-)grandparental genotypes when parental genotype data is missing. the ancestors are being consulted ๐Ÿ‘‘
  • --ld-window <ct+1> โ€” set the --r/--r2 max variant ct pairwise distance (usu. 10).
  • --ld-window-kb <x> โ€” set the --r/--r2 max kb pairwise distance (usually 1000).
  • --ld-window-cm <x> โ€” set the --r/--r2 max centimorgan pairwise distance.
  • --ld-window-r2 <x> โ€” set the threshold for --r2 report inclusion (usually 0.2).
  • --ld-snp <var ID> โ€” set the first variant in all --r/--r2 pairs. main character of every pair, periodt โญ
  • --ld-snps <vID...> โ€” restrict the first --r/--r2 variant to the given ranges.
  • --ld-snp-list <f> โ€” restrict the first --r/--r2 var. to those named in the file.
  • --list-all โ€” generate the 'all' mode report when using --show-tags in file mode.
  • --tag-kb <kbs> โ€” set the --show-tags max tag kb distance (default 250).
  • --tag-r2 <val> โ€” set the --show-tags min tag r-squared (default 0.8).
  • --tag-mode2 โ€” use two-column --show-tags (file mode) I/O format. two columns, two vibes, we move โœจ
  • --ld-xchr <code> โ€” set the chrX model for --indep[-pairwise], --r/--r2, --flip-scan, and --show-tags.
    1. 1 (default) = males coded 0/1, females 0/1/2 (A1 dosage)
    2. 2 = males coded 0/2
    3. 3 = males coded 0/2, but females given double weighting girls getting extra credit ๐Ÿ’…
  • --blocks-max-kb <kbs> โ€” set the --blocks maximum haploblock span (def. 200).
  • --blocks-min-maf <cutoff> โ€” adjust the --blocks MAF minimum (default 0.05).
  • --blocks-strong-lowci <x> and --blocks-strong-highci <x> โ€” set the --blocks "strong LD" CI thresholds (defaults 0.70 and 0.98). a matched set, they come as a pair, no cap ๐ŸŽ€
  • --blocks-recomb-highci <x> โ€” set the 'recombination' CI threshold (default 0.90).
  • --blocks-inform-frac <x> โ€” force haploblock <strong LD pairs>:<total informative pairs> ratios to be larger than this value (default 0.95).
  • --distance-wts exp=<x> โ€” when computing genomic distances, assign each variant a weight of (2q(1-q))^{-x}, where q is the loaded or inferred MAF.
  • --read-dists <dist file> [id file] โ€” load a triangular binary distance matrix instead of recalculating from scratch. skip the math, we're reading it off the shelf ๐Ÿ“
  • --ppc-gap <val> โ€” minimum number of base pairs, in thousands, between informative pairs of markers used in the --genome PPC test. 500 if unspecified.
  • --min <cutoff> โ€” specify minimum PI_HAT for inclusion in the --genome report.
  • --max <cutoff> โ€” specify maximum PI_HAT for inclusion in the --genome report.
  • --homozyg-match <> โ€” set minimum concordance across jointly homozygous variants for a pairwise allelic match to be declared.
  • --pool-size <ct> โ€” set minimum size of pools in the "--homozyg group" report. gotta hit the minimum to get in the pool party ๐ŸŠ
  • --read-genome <fn> โ€” load the --genome report for --cluster/--neighbour, instead of recalculating IBS and PPC test p-values from scratch.
  • --ppc <p-val> โ€” specify minimum PPC test p-value within a cluster.
  • --mc <max size> โ€” specify maximum cluster size.
  • --mcc <c1> <c2> โ€” specify maximum case and control counts per cluster.
  • --K <min count> โ€” specify minimum cluster count.
  • --ibm <val> โ€” specify minimum identity-by-missingness.
  • --match <f> [mv] โ€” use covariate values to restrict clustering. Without --match-type, two samples can only be in the same cluster if all covariates match. The optional second parameter specifies a covariate value to treat as missing. no matching vibes, no shared cluster, sorry bestie ๐Ÿšซ
  • --match-type <f> โ€” refine interpretation of the --match file. The --match-type file is expected to be a single line with as many entries as the --match file has covariates; '0' entries specify "negative matches" (i.e. samples with equal covariate values cannot be in the same cluster), '1' entries specify "positive matches" (default), and '-1' causes the corresponding covariate to be ignored. 0 = no, 1 = yes, -1 = we don't see it ๐Ÿ’€
  • --qmatch <f> [m] and --qt <fname> โ€” force all members of a cluster to have similar quantitative covariate values. The --qmatch file contains the covariate values, while the --qt file is a list of nonnegative tolerances (and '-1's marking covariates to skip). tolerance list said: either chill or be skipped ๐ŸŒธ
  • --pca-cluster-names <...> and --pca-clusters <fname> โ€” these can be used individually or in combination to define a list of clusters to use in the basic --pca computation. (--pca-cluster-names expects a space-delimited sequence of cluster names, while --pca-clusters expects a file with one cluster name per line.) All samples outside those clusters will then be projected on to the calculated PCs. the outsiders get projected, lowkey iconic ๐Ÿฆ‹
  • --mds-plot <dims> ['by-cluster'] ['eigendecomp'] ['eigvals'] โ€” multidimensional scaling analysis. Requires --cluster. ๐Ÿ“Š
  • --cell <thresh> โ€” skip some --model tests when a contingency table entry is smaller than the given threshold.
  • --condition <var ID> [{dominant | recessive}] โ€” add one variant as a --linear or --logistic covariate.
  • --condition-list <f> [{dominant | recessive}] โ€” add variants named in the file as --linear/--logistic covariates.
  • --parameters <...> โ€” include only the given covariates/interactions in the --linear/--logistic models, identified by a list of 1-based indices and/or ranges of them.
  • --tests <all> [...] โ€” perform a (joint) test on the specified term(s) in the --linear/--logistic model, identified by 1-based indices and/or ranges of them. If permutation was requested, it is based on this test.
    • Note that, when --parameters is also present, the indices refer to the terms remaining AFTER pruning by --parameters.
    • You can use "--tests all" to include all terms. all means ALL, bestie ๐Ÿ’…
  • --vif <max VIF> โ€” set VIF threshold for the --linear multicollinearity check (default 50).
  • --xchr-model <code> โ€” set the X chromosome --linear/--logistic model.
    • 0 = skip sex and haploid chromosomes
    • 1 (default) = add sex as a covariate on X chromosome
    • 2 = code male genotypes 0/2 instead of 0/1
    • 3 = test for interaction between genotype and sex it's giving chemistry ๐Ÿ’œ
  • --lasso-select-covars [cov(s)...] โ€” subject some or all covariates to LASSO model selection.
  • --adjust ['gc'] ['log10'] ['qq-plot'] โ€” report some multiple-testing corrections.
  • --lambda <val> โ€” set genomic control lambda for --adjust.
  • --ci <size> โ€” report confidence intervals for odds ratios.
  • --pfilter <val> โ€” filter out association test results with higher p-values.
  • --aperm <min perms - 1> [max perms] [alpha] [beta] [init interval] [slope] โ€” set up to six parameters controlling adaptive permutation tests. six knobs, one beautiful machine โœจ
    • The first two control the minimum and maximum number of permutations that may be run for each variant; default values are 5 and 1000000.
    • The next two control the early termination condition. A 100% * (1 - beta/2T) confidence interval is calculated for each empirical p-value, where T is the total number of variants; whenever this confidence interval doesn't contain alpha, the variant is exempted from further permutation testing. Default values are 0 and 1e-4.
    • The last two control when the early termination condition is checked. If a check occurs at permutation #p, the next check occurs after <slope>p + <init interval> more permutations (rounded down). Default initial interval is 1, and default slope is 0.001.
  • --mperm-save โ€” save best max(T) permutation test statistics.
  • --mperm-save-all โ€” save all max(T) permutation test statistics. no crumbs left behind ๐Ÿ“
  • --set-p <p-val> โ€” adjust set test significant variant p-value ceiling (default 0.05).
  • --set-r2 [v] ['write'] โ€” adjust set test significant variant pairwise r^2 ceiling (default 0.5). 'write' causes violating pairs to be dumped to <output prefix>.ldset. snitches get written to a file ๐Ÿ“
  • --set-max <ct> โ€” adjust set test maximum # of significant variants considered per set (default 5).
  • --set-test-lambda <v> โ€” specify genomic control correction for set test.
  • --border <kbs> โ€” extend --annotate range intervals by given # kbs.
  • --annotate-snp-field <nm> โ€” set --annotate variant ID field name.
  • --clump-p1 <pval> โ€” set --clump index var. p-value ceiling (default 1e-4).
  • --clump-p2 <pval> โ€” set --clump secondary p-value threshold (default 0.01).
  • --clump-r2 <r^2> โ€” set --clump r^2 threshold (default 0.5).
  • --clump-kb <kbs> โ€” set --clump kb radius (default 250).
  • --clump-snp-field <n...> โ€” set --clump variant ID field name (default 'SNP'). With multiple field names, earlier names take precedence over later ones. first come, first served, sorry to the latecomers ๐Ÿ‘‘
  • --clump-field <name...> โ€” set --clump p-value field name (default 'P').
  • --clump-allow-overlap โ€” let --clump non-index vars. join multiple clumps. yes literally that. ๐Ÿ’–
  • --clump-verbose โ€” request extended --clump report. โœจ
  • --clump-annotate <hdr...> โ€” include named extra fields in --clump-verbose and --clump-best reports. (field names can be separated with spaces or commas.) ๐ŸŽ€
  • --clump-range <filename> โ€” report overlaps between clumps and regions. ๐Ÿฆ‹
  • --clump-range-border <kb> โ€” stretch regions in --clump-range file. ๐ŸŒธ
  • --clump-index-first โ€” extract --clump index vars. from only first file. ๐Ÿ’…
  • --clump-replicate โ€” exclude clumps which contain secondary results from only one file. ๐Ÿ’œ
  • --clump-best โ€” report best proxy for each --clump index var. ๐Ÿ‘‘

okay so these next flags are one big meta-analysis field-name squad โ€” the original description is literally sliced across the lines, so I'm serving each piece exactly as written, fr fr:

  • --meta-analysis-chr-field <n...> โ€” Set --meta-analysis chromosome, variant
  • --meta-analysis-snp-field <n...> โ€” ID, position, A1/A2 allele, p-value,
  • --meta-analysis-bp-field <n...> โ€” standard error, and/or effective sample
  • --meta-analysis-a1-field <n...> โ€” size field names.
  • --meta-analysis-a2-field <n...> โ€” Defaults are 'CHR', 'SNP', 'BP', 'A1',
  • --meta-analysis-p-field <n...> โ€” 'A2', 'P', 'SE', and 'NMISS',
  • --meta-analysis-se-field <n...> โ€” respectively. When multiple parameters
  • --meta-analysis-ess-field <n...> โ€” are given to these flags, earlier names take precedence over later ones. Note that, if the numbers of cases and controls are unequal, effective sample size should be

4 / (1/<# cases> + 1/<# controls>).

  • --meta-analysis-report-dups โ€” When a variant appears multiple times in in the same file, report that. (yes "in in" is in the original, keep it ๐Ÿ’€)
  • --gene-list-border <kbs> โ€” Extend --gene-report regions by given # of kbs. ๐ŸŒธ
  • --gene-subset <filename> โ€” Specify gene name subset for --gene-report. ๐Ÿ’œ
  • --gene-report-snp-field <> โ€” Set --gene-report variant ID field name (default 'SNP'). Only relevant with --extract. ๐Ÿฆ‹
  • --gap <kbs> โ€” Set "--fast-epistasis case-only" min. gap (default 1000). โœจ
  • --epi1 <p-value> โ€” Set --[fast-]epistasis reporting threshold (default 5e-6 for 'boost', 1e-4 otherwise). ๐Ÿ’…
  • --epi2 <p-value> โ€” Set threshold for contributing to SIG_E count (def. 0.01). ๐Ÿ‘‘
  • --je-cellmin <n> โ€” Set required number of observations per 3x3x2 contingency table cell for joint-effects test (default 5). ๐ŸŽ€
  • --q-score-range <range file> <data file> [i] [j] ['header'] โ€” Apply --score to subset(s) of variants in the primary score list based on e.g. p-value ranges. ๐ŸŒˆ
    • * The first file should have range labels in the first column, p-value lower bounds in the second column, and upper bounds in the third column. Lines with too few entries, or nonnumeric values in the second or third column, are ignored.
    • * The second file should contain a variant ID and a p-value on each nonempty line (except possibly the first). Variant IDs are read from column #i and p-values are read from column #j, where i defaults to 1 and j defaults to i+1. The 'header' modifier causes the first nonempty line of this file to be skipped.
  • --R-port <port #> โ€” Connect to Rserve on a port other than 6311. ๐ŸŒธ
  • --R-host <host> โ€” Connect to Rserve host. ๐Ÿ’œ
  • --R-socket <sock> โ€” Connect to Rserve socket. ๐Ÿฆ‹
  • --parallel <k> <n> โ€” Divide the output matrix into n pieces, and only compute the kth piece. The primary output file will have the piece number included in its name, e.g. plink.rel.13 or plink.rel.13.gz if k is 13. Concatenating these files in order will yield the full matrix of interest. (Yes, this can be done before unzipping.) N.B. This generally cannot be used to directly write a symmetric square matrix. Choose square0 or triangle shape instead, and postprocess as necessary. ๐Ÿ”ฅ
  • --memory <val> โ€” Set size, in MB, of initial workspace malloc attempt. (Practically mandatory when using GNU parallel.) ๐Ÿ’…
  • --threads <val> โ€” Set maximum number of concurrent threads. This has one known limitation: some BLAS/LAPACK linear algebra operations are multithreaded in a way that PLINK cannot control. If this is problematic, you should recompile against single-threaded BLAS/LAPACK. ๐ŸŽ€
  • --d <char> โ€” Change variant/covariate range delimiter (normally '-'). โœจ
  • --seed <val...> โ€” Set random number seed(s). Each value must be an integer between 0 and 4294967295 inclusive. ๐ŸŒธ
  • --perm-batch-size <val> โ€” Set number of permutations per batch for some permutation tests. ๐Ÿ’œ
  • --output-min-p <p> โ€” Specify minimum p-value to write to reports. ๐Ÿฆ‹
  • --debug โ€” Use slower, more crash-resistant logging method. ๐Ÿ’…

๐Ÿ“š Primary methods paper: Chang CC, Chow CC, Tellier LCAM, Vattikuti S, Purcell SM, Lee JJ (2015) Second-generation PLINK: rising to the challenge of larger and richer datasets. GigaScience, 4.

For further documentation and support, consult the main webpage (https://www.cog-genomics.org/plink/1.9 ) and/or the mailing list (https://groups.google.com/d/forum/plink2-users ).


SEE ALSO ๐Ÿ’–

The full documentation for PLINK v1.90b6.16 64-bit (19 Feb is maintained as a Texinfo manual. If the info and PLINK v1.90b6.16 64-bit (19 Feb programs are properly installed at your site, the command

info PLINK v1.90b6.16 64-bit (19 Feb

should give you access to the complete manual.

and that's the whole manual, bestie โ€” PLINK v1.90b6.16 64-bit (19 Feb...), March 2020, PLINK(1). you're welcome, periodt ๐Ÿ’…โœจ