PLINK(1)
๐ NAME ๐
PLINK โ whole genome SNP analysis. That's her, that's the girl, manual page PLINK(1) from the User Commands section, and she is everything ๐
โจ DESCRIPTION โจ
okay so first, the credentials, because she's got receipts:
PLINK v2.00a3 64-bit (9 Apr 2020)
www.cog-genomics.org/plink/2.0/ (C) 2005-2020 Shaun Purcell, Christopher Chang GNU General Public License v3
iconic, licensed, legally protected โจ now let's talk about how you read the flag definitions, because this is the part where everyone gets lost and I refuse to let that be you ๐ซถ
๐ the flag-notation rules ๐
<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 arguments of the specified type. - A "column set descriptor" is either:
- a comma-separated sequence of column set names; this is interpreted as the full list of column sets to include.
- a comma-separated sequence of column set names, all preceded by
'+'or'-'; this is interpreted as a list of changes to the default.
and here's how you actually invoke her, no cap:
plink2 <input flag(s)...> [command flag(s)...] [other flag(s)...]
plink2 --help [flag name(s)...]
๐ฆ input fileset flags (the "who am I even reading" era) ๐ฆ
Most PLINK runs require exactly one main input fileset. The following flags are available for defining its form and location:
--pfile <prefix> ['vzs']โ Specify.pgen+.pvar[.zst]+.psamprefix.--pgen <filename>โ Specify full name of.pgen/.bedfile.--pvar <filename>โ Specify full name of.pvar/.bimfile.--psam <filename>โ Specify full name of.psam/.famfile.--bfile <prefix> ['vzs']โ Specify.bed+.bim[.zst]+.famprefix.--bpfile <prefix> ['vzs']โ Specify.pgen+.bim[.zst]+.famprefix.--keep-autoconv ['vzs']โ When importing non-PLINK-binary data, don't delete the autogenerated fileset at end of run.--no-fidโ.famfile does not contain column 1 (family ID).--no-parentsโ.famfile does not contain columns 3-4 (parents).--no-sexโ.famfile does not contain column 5 (sex).--vcf <filename> ['dosage='<field>]--bcf <filename> ['dosage='<field>]โ Specify full name of.vcf{|.gz|.zst}or BCF2 file to import.- These can be used with
--psam/--fam. - By default, dosage information is not imported. To import the
GPfield (must be VCFv4.3-style 0..1, one probability per possible genotype), add'dosage=GP'(or'dosage=GP-force', see below). To import Minimac3-style DS+HDS phased dosage, add'dosage=HDS'.'dosage=DS'(or anything else for now) causes the named field to be interpreted as a Minimac3-style dosage. - Note that, in the
dosage=GPcase, PLINK 2 collapses the probabilities down to dosages; you cannot use PLINK 2 to losslessly convert VCFFORMAT:GPdata to e.g. BGEN format. To make this more obvious, PLINK 2 now errors out whendosage=GPis used on a file with aFORMAT:DSheader line and--import-dosage-certaintywasn't specified, sincedosage=DSextracts the same information more quickly in this situation. You can suppress this error with'dosage=GP-force'. - In all of these cases, hardcalls are regenerated from scratch from the dosages. As a consequence, variants with no
GTfield can now be imported; they will be assumed to contain only diploid calls when HDS is also absent.
- These can be used with
--data <filename prefix> <REF/ALT mode> ['gzs']--bgen <filename> <REF/ALT mode> ['snpid-chr']--gen <filename> <REF/ALT mode>--sample <filename>โ Specify an Oxford-format dataset to import.--dataspecifies a.gen[.zst]+.samplepair, while--bgenspecifies a BGEN v1.1+ file.- If a BGEN v1.2+ file contains sample IDs, it may be imported without a companion
.samplefile. - With
'snpid-chr', chromosome codes are read from the'SNP ID'field instead of the usual chromosome field. - The following REF/ALT modes are supported:
'ref-first': The first allele for each variant is REF.'ref-last': The last allele for each variant is REF.'ref-unknown': The last allele for each variant is treated as provisional-REF.
- If a BGEN v1.2+ file contains sample IDs, it may be imported without a companion
--haps <filename> [{ref-first | ref-last}]--legend <filename> <chr code>โ Specify.haps[+.legend] file(s) to import.- When
--legendis specified, it's assumed that the--hapsfile doesn't contain header columns. - On chrX, the second male column may contain dummy
'-'entries. (However, PLINK 2 currently cannot handle omitted male columns.) - If not used with
--sample, new sample IDs are of the form'per#/per#'.
- When
--map <filename>โ Specify full name of.mapfile.--import-dosage <allele dosage file> ['noheader'] ['id-delim='<char>] ['skip0='<i>] ['skip1='<j>] ['skip2='<k>] ['dose1'] ['format='<m>] [{ref-first | ref-last}] ['single-chr='<code>] ['chr-col-num='<#>] ['pos-col-num='<#>]โ Specify PLINK 1.x-style dosage file to import.- You must also specify a companion
.psam/.famfile. - By default, PLINK assumes that the file contains a header line, which has
'SNP'in (1-based) columni+1,'A1'in columni+j+2,'A2'in columni+j+3, and sample FID/IIDs starting from columni+j+k+4. (i/j/kare normally zero, but can be changed with'skip0','skip1', and'skip2'respectively. FID/IID are normally assumed to be separate tokens, but if they're merged into a single token you can specify the delimiter with'id-delim='.) If such a header line is not present, use the'noheader'modifier; samples will then be assumed to appear in the same order as they do in the.psam/.famfile. - You may specify a companion
.mapfile. If you do not:'single-chr='can be used to specify that all variants are on the named chromosome. Otherwise, you can use'chr-col-num='to read chromosome codes from the given (1-based) column number.'pos-col-num='causes bp coordinates to be read from the given column number.
- The
'format='modifier lets you specify the number of values used to represent each dosage.'format=1'normally indicates a single 0..2 A1 expected count;'dose1'modifies this to a 0..1 frequency.'format=2'indicates a 0..1 homozygous A1 likelihood followed by a 0..1 het likelihood.'format=3'indicates 0..1 hom A1, 0..1 het, 0..1 hom A2.'format=infer'(the default) infers the format from the number of columns in the first nonheader line.
- You must also specify a companion
--dummy <sample ct> <SNP ct> [missing dosage freq] [missing pheno freq] [{acgt | 1234 | 12}] ['pheno-ct='<count>] ['scalar-pheno'] ['dosage-freq='<rate>]โ This generates a fake input dataset with the specified number of samples and SNPs.- By default, the missing dosage and phenotype frequencies are zero. These can be changed by providing 3rd and 4th numeric arguments.
- By default, allele codes are As and Bs; this can be changed with the
'acgt','1234', or'12'modifier. - By default, one binary phenotype is generated.
'pheno-ct='can be used to change the number of phenotypes, and'scalar-pheno'causes these phenotypes to be normally distributed scalars. - By default, all (nonmissing) dosages are in
{0,1,2}. To make some of them take on decimal values, use'dosage-freq='. (These dosages are affected by--hard-call-thresholdand--dosage-erase-threshold.)
--fa <filename>โ Specify full name of reference FASTA file.
๐ output flags ๐
Output files have names of the form 'plink2.<extension>' by default. You can change the 'plink2' prefix with:
--out <prefix>โ Specify prefix for output files.
๐ฅ commands (aka "you gotta pick at least one") ๐ฅ
Most runs also require at least one of the following commands:
--rm-dup [mode] ['list']โ Remove all but one instance of each duplicate-ID variant (ignoring the missing ID), and (with the'list'modifier) write a list of duplicated IDs to<output prefix>.rmdup.list. The following modes of operation are supported:'error'(default) causes this to error out when there's a genotype data or other mismatch between the records. A list of affected IDs is written to<output prefix>.rmdup.mismatch.'retain-mismatch'causes all instances of a duplicate-ID variant to be retained when there's a genotype data or variant info mismatch; otherwise one instance is kept. The.rmdup.mismatchfile is also written.'exclude-mismatch'removes all instances of duplicate-ID mismatched variants instead.'exclude-all'causes all instances of duplicate-ID variants to be removed, even when the actual records are identical.'force-first'causes only the first instance of duplicate-ID variants to be kept, under all circumstances.
--make-pgen ['vzs'] ['format='<code>] ['trim-alts'] ['erase-phase'] ['erase-dosage'] ['pvar-cols='<col set descriptor>] ['psam-cols='<col set descriptor>]--make-bpgen ['vzs'] ['format='<code>] ['trim-alts'] ['erase-phase'] ['erase-dosage']--make-bed ['vzs'] ['trim-alts']โ Create a new PLINK 2 binary fileset (--make-pgen=.pgen+.pvar[.zst]+.psam,--make-bpgen=.pgen+.bim[.zst]+.fam).- Unlike the automatic text-to-binary converters (which only heed chromosome filters), this supports all of PLINK's filtering flags.
- The
'vzs'modifier causes the variant file (.pvar/.bim) to be Zstd-compressed.
Okay so about that 'format' modifier, bestie โ it requests an uncompressed fixed-variant-width .pgen file. (These do not directly support multiallelic variants, fyi.) And the format codes currently supported are literally just this one:
2: exactly like.bed, except the header is extended (12-byte instead of 3-byte) and carries the variant/sample counts, and the genotype codes are rotated (00= hom ref,01= het,10= hom alt,11= missing).- The
'erase-phase'and'erase-dosage'modifiers stop phase and dosage info from ever being written into the new.pgen. ๐ซ๐
Also, important: the first five columns of a .pvar file are always #CHROM/POS/ID/REF/ALT.
And the supported optional .pvar column sets are, in order:
xheader: all the##header lines (yeah, technically not a column, we're aware ๐), except for possibly theFILTER/INFOdefinitions when those column(s) have been removed. Without this, only the#CHROMheader line is kept.vcfheader:xheader, with additions to make it a valid VCF header.maybequal:QUAL. Omitted if all remaining values are missing.qual: force theQUALcolumn to be written even when it's empty.maybefilter:FILTER. Omitted if all remaining values are missing.filter: force theFILTERcolumn to be written even when it's empty.maybeinfo:INFO. Omitted if all remaining values are missing, or ifINFO:PRis the only subfield.info: force theINFOcolumn to be written.maybecm: centimorgan coordinate. Omitted if all remaining values =0.cm: force theCMcolumn to be written even when it's empty.
The default is xheader,maybequal,maybefilter,maybeinfo,maybecm. Slay.
Now the supported column sets for the .psam file:
maybefid: Family ID,'0'= missing. Omitted if all values missing.fid: force theFIDcolumn to be written even when it's empty.maybesid: Source ID,'0'= missing. Omitted if all values missing.sid: force theSIDcolumn to be written even when it's empty.maybeparents: father and mother IIDs. Omitted if all values missing.parents: force thePATandMATcolumns to be written even when they're empty.sex:'1'= male,'2'= female,'NA'= missing.pheno1: first active phenotype. If there isn't one, every column entry gets set to the--output-missing-phenotypestring.phenos: all active phenotypes, if any. (Can be combined withpheno1to force at least one phenotype column to be written.)
The default is maybefid,maybesid,maybeparents,sex,phenos. ๐
--make-just-pvar ['zs'] ['cols='<column set descriptor>]
--make-just-psam ['cols='<column set descriptor>]
--make-just-bim ['zs']
--make-just-fam
These are variants of --make-pgen/--make-bed that only write a new variant or sample file. They don't always require an input genotype file.
USE THESE CAUTIOUSLY. It is very easy to desynchronize your binary genotype data and your sample/variant indexes if you use these commands improperly. If you have any doubt, stick with--make-[b]pgen/--make-bed. Seriously. This is the "texting your ex at 3am" of plink commands. ๐ซฃ
--export <output format(s)...> [{01 | 12}] ['bgz'] ['id-delim='<char>]
['id-paste='<column set descriptor>] ['include-alt']
['omit-nonmale-y'] ['spaces'] ['vcf-dosage='<field>]
['ref-first'] ['bits='<#>]
Create a new fileset with all filters applied. The following output formats are supported: (actually, only A, AD, A-transpose, bcf, bgen-1.x, haps, hapslegend, ind-major-bed, oxford, and vcf are implemented for now, the rest are living their best vaporware life โจ)
'23': 23andMe 4-column format. This can only be used on a single sample's data (--keepmay 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-major0/1/2.'beagle': unphased per-autosome.datand.mapfiles, readable by early BEAGLE versions.'beagle-nomap': single.beagle.datfile.'bgen-1.x': Oxford-format.bgen+.sample. For v1.2/v1.3, sample identifiers are stored in the.bgen(withid-delimandid-pastesettings applied), and default precision is 16-bit (use the'bits'modifier to reduce this).'bimbam': regular BIMBAM format.'bimbam-1chr': BIMBAM format, with a two-column.pos.txtfile. Does not support multiple chromosomes.'fastphase': per-chromosome fastPHASE files, with.chr-<chr #>.phase.inpfilename extensions.'fastphase-1chr': single.phase.inpfile. Does not support multiple chromosomes.'haps','hapslegend': Oxford-format.haps+.sample[ +.legend]. All data must be biallelic and phased. When the'bgz'modifier is present, the.hapsfile is block-gzipped.'HV': per-chromosome Haploview files, with.chr-<chr #>{.ped,.info}filename extensions.'HV-1chr': single Haploview.ped+.infofile pair. Does not support multiple chromosomes.'ind-major-bed': PLINK 1 sample-major.bed(+.bim+.fam).'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+.mapfileset, where the.rlistfile is a genotype-based list which omits the most common genotype for each variant. Also supports'omit-nonmale-y'.'oxford': Oxford-format.gen+.sample. When the'bgz'modifier is present, the.genfile is block-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-4.2','bcf','bcf-4.2': VCF (default version 4.3). If PAR1 and PAR2 are present, they are automatically merged with chrX, with proper handling of chromosome codes and male ploidy. When the'bgz'modifier is present, the VCF file is block-gzipped. (This always happens with BCF output.) The'id-paste'modifier controls which.psamcolumns are used to construct sample IDs (choices aremaybefid,fid,iid,maybesid, andsid; default ismaybefid,iid,maybesid), while the'id-delim'modifier sets the character between the ID pieces (default'_'). Genotypes are always exported. If you want to export a sites-only VCF instead, see--make-pgen/--make-just-pvar's'vcfheader'column set. Dosages are not exported unless the'vcf-dosage='modifier is present. The following five dosage export modes are supported:'GP': genotype posterior probabilities (v4.3 only).'DS': Minimac3-style dosages, omitted for hardcalls.'DS-force': Minimac3-style dosages, never omit.'HDS': Minimac3-style phased dosages, omitted for hardcalls and unphased calls. Also includes'DS'output.'HDS-force': always report DS and HDS.
In addition:
- The
'12'modifier causes alt1 alleles to be coded as'1'and ref alleles to be coded as'2', while'01'maps alt1 ->0and ref ->1. - The
'spaces'modifier makes the output space-delimited instead of tab-delimited, whenever both are permitted. - For biallelic formats where it's unspecified whether the reference/major allele should appear first or second,
--exportdefaults to second for compatibility with PLINK 1.9. Use'ref-first'to change this. (Note that this doesn't apply to the'A','AD', and'A-transpose'formats; use--export-alleleto control which alleles are counted there.)
--freq ['zs'] ['counts'] ['cols='<column set descriptor>] ['bins-only']
['refbins='<comma-separated bin boundaries> | 'refbins-file='<file>]
['alt1bins='<comma-separated bin boundaries> | 'alt1bins-file='<file>]
Empirical allele frequency report. By default, only founders are considered. Dosages are taken into account (e.g. heterozygous haploid calls count as 0.5). The supported column sets are:
chrom: chromosome ID.pos: base-pair coordinate. (ID is always present, and positioned here.)ref: reference allele.alt1: alternate allele 1.alt: all alternate alleles, comma-separated.reffreq: reference allele frequency/dosage.alt1freq: alt1 frequency/dosage.altfreq: comma-separated frequencies/dosages for all alternate alleles.freq: similar toaltfreq, except ref is also included at the start.eq: comma-separated<allele>=<freq>for all present alleles. (If no alleles are present, the column contains a single'.'.)eqz: same aseq, except zero-counts are included.alteq/alteqz: same aseq/eqz, except reference allele is omitted.numeq:0=<freq>,1=<freq>, etc. Zero-counts are omitted.altnumeq: same asnumeq, except reference allele is omitted.machr2: unphased MaCH imputation quality metric.minimac3r2: phased Minimac3 imputation quality.nobs: number of allele observations.
The default is chrom,ref,alt,altfreq,nobs. Additional .afreq.{ref,alt1}.bins (or .acount.{ref,alt1}.bins with 'counts') file(s) are generated when 'refbins='/'refbins-file=' or 'alt1bins='/'alt1bins-file=' is present; these report the total number of frequencies or counts in each left-closed, right-open interval. (If you only want these histogram(s), and not the main report, add 'bins-only'.) ๐ง
--geno-counts ['zs'] ['cols='<column set descriptor>]
okay so we're picking right back up with the variant-based hardcall genotype count report โ the one that thinks about both alleles at once when you're in the diploid case. Heads up bestie: nonfounders are included now, so if that's a problem for you, hit it with --keep-founders. Also, heterozygous haploid calls? Treated as missing. Gone. Not the vibe. ๐
The supported column sets are:
chromโ Chromosome ID.posโ Base-pair coordinate. (IDis always present, and it lives right here.)refโ Reference allele.alt1โ Alternate allele 1.altโ All alternate alleles, comma-separated.homrefโ Homozygous-ref count.refalt1โ Heterozygous ref-alt1 count.refaltโ Comma-separated het ref-altx counts.homalt1โ Homozygous-alt1 count.altxyโ Comma-separated altx-alty counts, in(1/1)-(1/2)-(2/2)-(1/3)-...order.xyโ Same energy asaltxy, except the reference allele is treated as alt0, and the sequence starts(0/0)-(0/1)-(1/1)-(0/2)-...haprefโ Haploid-ref count.hapalt1โ Haploid-alt1 count.hapaltโ Comma-separated haploid-altx counts.hapโ Likehapalts, except ref is also included at the start.numeqโ0/0=<hom ref ct>,0/1=<het ref-alt1>,1/1=<hom alt1>,...,0=<hap ref>etc. Zero-counts are omitted. (And if every single genotype is missing, the column is literally just a single..)missingโ Number of missing genotypes.nobsโ Number of (nonmissing) genotype observations.
The default is chrom,ref,alt,homref,refalt,altxy,hapref,hapalt,missing. ๐
--sample-counts ['zs'] ['cols='<column set descriptor>]
Sample-based hardcall genotype count report. The tea โ:
- Unknown-sex samples are treated as female.
- Heterozygous haploid calls (MT included) are treated as missing.
- As with other PLINK 2 commands, SNPs that have not been left-normalized are counted as non-SNP non-symbolic. (Use e.g.
--normalizewhen that's a problem.) - Supported column sets are:
maybefidโ FID, if that column was present in the input.fidโ Force the FID column to be written even when it's absent in the input. (IID is always present, and it's positioned right here.)maybesidโ SID, if that column was present in the input.sidโ Force the SID column to be written even when it's absent in the input.sexโ'1'= male,'2'= female,'NA'= missing.homโ Homozygous genotype count.homrefโ Homozygous-ref genotype count.homaltโ Homozygous-alt genotype count.homaltsnpโ Homozygous-alt SNP count.hetโ Heterozygous genotype count.refaltโ Heterozygous ref-altx genotype count.het2altโ Heterozygous altx-alty genotype count.hetsnpโ Heterozygous SNP count.diptsโ Diploid SNP transition count.tsโ SNP transition count (excluding chrY for females).diptvโ Diploid SNP transversion count.tvโ SNP transversion count.dipnonsnpsymbโ Diploid non-SNP, non-symbolic count.nonsnpsymbโ Non-SNP, non-symbolic count.symbolicโ Symbolic variant count.nonsnpโ Non-SNP count.dipsingleโ Number of singletons relative to this dataset, across just diploid calls. (Sneaky detail: if the ALT allele in a chrX biallelic variant shows up in exactly one female and one male, that counts as a singleton for just the female.)singleโ Number of singletons relative to this dataset.haprefwfemaleyโ Haploid-ref count, counting chrY for everyone.haprefโ Haploid-ref count, excluding chrY for females.hapaltwfemaleyโ Haploid-alt count, counting chrY for everyone.hapaltโ Haploid-alt count, excluding chrY for females.missingwfemaleyโ Missing call count, counting chrY for everyone.missingโ Missing call count, excluding chrY for females.
The default is maybefid,maybesid,homref,homaltsnp,hetsnp,dipts,diptv,dipnonsnpsymb,dipsingle,haprefwfemaley,hapaltwfemaley,missingwfemaley.
- The
hetsnp,dipts/ts/diptv/tv,dipnonsnpsymb/nonsnpsymb,symbolic, andnonsnpcolumns count each ALT allele in a heterozygous altx-alty call separately, since they can be of different subtypes. (I.e. if they're the same subtype, the corresponding count gets incremented by 2.) And the consequence of that? These columns are unaffected by variant split/join. Slay. ๐
--missing ['zs'] [{sample-only | variant-only}] ['scols='<column set descriptor>] ['vcols='<column set descriptor>]
Generates sample- and variant-based missing data reports โ or just one report if you specify 'sample-only'/'variant-only'. As of alpha 2, mixed MT hardcalls appear in the heterozygous haploid stats. ๐
Supported column sets in the sample-based report are:
maybefidโ FID, if that column was present in the input.fidโ Force the FID column to be written even when it's absent in the input. (IID is always present, and it's positioned here.)maybesidโ SID, if that column was present in the input.sidโ Force the SID column to be written even when it's absent in the input.misspheno1โ First active phenotype missing (Y/N)? Always'Y'if no phenotypes are loaded.missphenosโ A Y/N column for each loaded phenotype. (Can be combined withmisspheno1to force at least one such column.)nmissdosageโ Number of missing dosages.nmissโ Number of missing hardcalls, not counting het haploids.nmisshhโ Number of missing hardcalls, counting het haploids.hethapโ Number of heterozygous haploid hardcalls.nobsโ Denominator (male count on chrY, otherwise total sample count).fmissdosageโ Missing dosage rate.fmissโ Missing hardcall rate, not counting het haploids.fmisshhโ Missing hardcall rate, counting het haploids.
The default is maybefid,maybesid,missphenos,nmiss,nobs,fmiss.
Supported column sets in the variant-based report are:
chromโ Chromosome ID.posโ Base-pair coordinate. (ID is always present, and positioned here.)refโ Reference allele.alt1โ Alternate allele 1.altโ All alternate alleles, comma-separated.nmissdosageโ Number of missing dosages.nmissโ Number of missing hardcalls, not counting het haploids.nmisshhโ Number of missing hardcalls, counting het haploids.hethapโ Number of heterozygous haploid calls.nobsโ Number of potentially valid calls.fmissdosageโ Missing dosage rate.fmissโ Missing hardcall rate, not counting het haploids.fmisshhโ Missing hardcall rate, counting het haploids.fhethapโ Heterozygous haploid rate.
The default is chrom,nmiss,nobs,fmiss.
--hardy ['zs'] ['midp'] ['redundant'] ['cols='<column set descriptor>]
Hardy-Weinberg exact test p-value report(s). Okay bestie, several things:
- By default, only founders are considered; change this with
--nonfounders. - chrX is now omitted from the main
<output prefix>.hardyreport. Instead, (if present) it gets its own<output prefix>.hardy.xreport, based on the method described in Graffelman J, Weir BS (2016) Hardy-Weinberg equilibrium and the X chromosome. - For variants with k alleles where k>2, k separate 'biallelic' tests are performed, each reported on its own line. But biallelic variants are normally reported on a single line, since the counts/frequencies would be mirror-images and the p-values would be the same. You can add the
'redundant'modifier to force biallelic variant results onto two lines for parsing convenience. - There is currently no special handling of case/control phenotypes.
Supported column sets are:
chromโ Chromosome ID.posโ Base-pair coordinate. (ID is always present, and positioned here.)refโ Reference allele.alt1โ Alternate allele 1.altโ All alternate alleles, comma-separated.axโ Non-A1 allele(s), comma-separated. (A1 is always present, and positioned here.)gcountsโ Hom-A1 count, total number of het-A1 calls, and total number of nonmissing calls with no copies of A1. On chrX, these are followed by male A1 and male non-A1 counts.gcount1colโgcountsvalues in a single comma-separated column.hetfreqโ Observed and expected het-A1 frequencies.sexafโ Female and male A1 observed allele frequencies (chrX only).femalepโ Female-only p/midp-value (chrX only).pโ Hardy-Weinberg equilibrium exact test p/midp-value.
The default is chrom,ax,gcounts,hetfreq,sexaf,p.
--indep-pairwise <window size>['kb'] [step size (variant ct)] <unphased-hardcall-r^2 threshold>
Generates a list of variants in approximate linkage equilibrium. Details, bestie:
- For multiallelic variants, major allele counts are used in the r^2 computation.
- With the
'kb'modifier, the window size is in kilobase instead of variant count units. (Pre-'kb'space is optional, i.e."--indep-pairwise 500 kb 0.5"and"--indep-pairwise 500kb 0.5"have the same effect.) - The step size now defaults to 1 if it's unspecified, and it must be 1 if the window is in kilobase units.
- Note that you need to rerun PLINK using
--extractor--excludeon the.prune.in/.prune.outfile to apply the list to another computation... and as with other applications of--extract/--exclude, duplicate variant IDs are a problem.--indep-pairwisestill runs to completion for now when duplicate variant IDs are present, but that will become an error in alpha 3. ๐ญ
--ld <variant ID> <variant ID> ['dosage'] ['hwe-midp']
This one displays diplotype frequencies, r^2, and D' for a single pair of variants. ๐
- For multiallelic variants, major allele counts/dosages are used.
- Phase information is used when both variants are on the same chromosome.
- When there's at least one sample with unphased het calls for both variants, diplotype frequencies are estimated using the Hill equation. If there are multiple biologically possible local maxima, all of them are displayed, along with HWE exact test statistics.
- By default, only hardcalls are considered. Add the
'dosage'modifier if you want dosages to be taken into account. (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.)
--sample-diff ['id-delim='<char>] ['dosage' | 'dosage='<tolerance>]
['include-missing'] [{pairwise | counts-only}]
['fname-id-delim='<c>] ['zs'] ['cols='<column set descriptor>]
['counts-cols='<column set descriptor>] {base= | ids=}<sample ID>
[other sample ID(s)...]
and the other flavor:
--sample-diff ['id-delim='<char>] ['dosage' | 'dosage='<tolerance>]
['include-missing'] [{pairwise | counts-only}]
['fname-id-delim='<c>] ['zs'] ['cols='<column set descriptor>]
['counts-cols='<column set descriptor>] file=<ID-pair file>
okay bestie, --sample-diff (aka --sdiff) is here to spill the discordance tea โ๐
. It reports discordances and discordance-counts between pairs of samples. If chrX or chrY is present, sex must be defined and consistent. no cap, that's a hard requirement.
- There are three ways to specify which sample pairs to compare:
- To compare a single baseline sample against some others, start the (space-delimited) sample ID list with
base=. - To perform an all-vs.-all comparison, start it with
ids=instead. - To compare sample pairs listed in a file, use
file=.
- To compare a single baseline sample against some others, start the (space-delimited) sample ID list with
- Note that
base=/ids=/file=must be positioned after all modifiers.
Sample IDs are interpreted as if they were in a VCF header line, with id-delim= having the usual effect.
- By default, comparisons are based on hardcalls. Use
dosageto compare dosages instead; you can combine this with a tolerance in [0, 0.5). - By default, if one genotype is missing and the other isn't, that doesn't count as a difference; this can be changed with
include-missing. - By default, a single main report is written to
<output prefix>[.<base ID>].sdiff. To write separate pairwise<output prefix>.<ID1>.<ID2>.sdiffreports for each compared ID pair, add thepairwisemodifier. To omit the main report, add thecounts-onlymodifier. (Note that, if you're only interested in nonmissing autosomal biallelic hardcalls,--make-king-tableprovides a more efficient way to compute just counts.) - By default, if an output filename has a multipart sample ID, the parts will be delimited by
_; usefname-id-delim=to change this.
Supported main-report column sets are:
chromโ Chromosome ID.posโ Base-pair coordinate. (Variant ID is always present, and positioned here.)refโ Reference allele.altโ All alternate alleles, comma-separated.maybefidโ FID1/FID2, if that column was in the input. Requiresid.fidโ Force FID1/FID2 even when FID was absent in the input.idโ IID1/IID2.maybesidโ SID1/SID2, if that column was in the input. Requiresid.sidโ Force SID1/SID2 even when SID was absent in the input.genoโ Unphased GT or DS for the two samples.
The default is usually chrom,pos,ref,alt,maybefid,id,maybesid,geno; the sample IDs are removed from the default in pairwise mode. Supported discordance-count-summary column sets are:
maybefidโ FID1/FID2, if that column was in the input.fidโ Force FID1/FID2 even when FID was absent in the input. (IID1/IID2 are always present.)maybesidโ SID1/SID2, if that column was in the input.sidโ Force SID1/SID2 even when SID was absent in the input.nobsโ Number of variants considered. This includes variants where one or both variants are missing iffinclude-missingwas specified.nobsibsโ ibs0+ibs1+ibs2.ibs0โ Number of diploid variants with no common hardcall alleles.ibs1โ Number of diploid variants with exactly 1 common hardcall allele.ibs2โ Number of diploid variants with both hardcall alleles matching.halfmissโ Number of variants with exactly 1 missing genotype/dosage. Ignored withoutinclude-missing.diffโ Total number of differences.
The default is maybefid,maybesid,nobs,halfmiss,diff.
๐ --make-king โ KING-robust kinship, slay ๐
--make-king [{square | square0 | triangle}] [{zs | bin | bin4}]
KING-robust kinship estimator, described by Manichaikul A, Mychaleckyj JC, Rich SS, Daly K, Sale M, Chen WM (2010) Robust relationship inference in genome-wide association studies. By default, this writes a lower-triangular tab-delimited table of kinship coefficients to <output prefix>.king, and a list of the corresponding sample IDs to <output prefix>.king.id. The first row of the .king file contains a single <genome 1-genome 2> kinship coefficient, the second row has the <genome 1-genome 3> and <genome 2-genome 3> kinship values in that order, etc.
- Only autosomes are currently considered.
- Pedigree information is currently ignored; the between-family estimator is used for all pairs.
- For multiallelic variants, REF allele counts are used.
- If the
squareorsquare0modifier is present, a square matrix is written instead;square0fills the upper right triangle with zeroes. - If the
zsmodifier is present, the.kingfile is Zstd-compressed. - If the
binmodifier is present, a binary (square) matrix of double-precision floating point values, suitable for loading from R, is instead written to<output prefix>.king.bin. (bin4specifies single-precision numbers instead.) This can be combined withsquare0if you still want the upper right zeroed out, ortriangleif you don't want to pad the upper right at all. - The computation can be subdivided with
--parallel.
โจ --make-king-table โ the .kin0 glow-up ๐
--make-king-table ['zs'] ['counts'] ['rel-check'] ['cols='<col set descrip.>]
Similar to --make-king, except results are reported in KING's original .kin0 text table format (with minor changes, e.g. row order is more friendly to incremental addition of samples), --king-table-filter can be used to restrict the report to high kinship values, and the rel-check modifier can be used to restrict to same-FID pairs. Supported column sets are:
maybefidโ FID1/FID2, if that column was in the input. Requiresid.fidโ Force FID1/FID2 even when FID was absent in the input.idโ IID1/IID2.maybesidโ SID1/SID2, if that column was in the input. Requiresid.sidโ Force SID1/SID2 even when SID was absent in the input.nsnpโ Number of variants considered (autosomal, neither call missing).hethetโ Proportion/count of considered call pairs which are het-het.ibs0โ Proportion/count of considered call pairs which are opposite homs.ibs1โ HET1_HOM2 and HET2_HOM1 proportions/counts.kinshipโ KING-robust between-family kinship estimator.
The default is maybefid,id,maybesid,nsnp,hethet,ibs0,kinship. hethet/ibs0/ibs1 values are proportions unless the counts modifier is present. If id is omitted, a .kin0.id file is also written.
๐ธ --make-rel โ relationship matrix but make it cute ๐ซถ
--make-rel ['cov'] ['meanimpute'] [{square | square0 | triangle}]
[{zs | bin | bin4}]
Write a lower-triangular variance-standardized relationship matrix to <output prefix>.rel, and corresponding IDs to <output prefix>.rel.id.
- This computation assumes that variants do not have very low MAF, or deviate greatly from Hardy-Weinberg equilibrium.
- Also, it's usually best to perform this calculation on a variant set in approximate linkage equilibrium.
- The
covmodifier replaces the variance-standardization step with basic mean-centering, causing a covariance matrix to be calculated instead. - The computation can be subdivided with
--parallel.
๐ --make-grm-list and --make-grm-bin โ GCTA relationship formats ๐
--make-grm-list ['cov'] ['meanimpute'] ['zs'] [{id-header | iid-only}]
--make-grm-bin ['cov'] ['meanimpute'] [{id-header | iid-only}]
--make-grm-list causes the relationships to be written to GCTA's original 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.
๐ --pca โ principal components, main character energy โจ
--pca [count] [{approx | meanimpute}] ['scols='<col set descriptor>]
--pca [{allele-wts | biallelic-var-wts}] [count] [{approx | meanimpute}]
['vzs'] ['scols='<col set descriptor>] ['vcols='<col set descriptor>]
Extracts top principal components from the variance-standardized relationship matrix.
- It is usually best to perform this calculation on a variant set in approximate linkage equilibrium, with no very-low-MAF variants.
- By default, 10 PCs are extracted; you can adjust this by passing a numeric argument. (Note that 10 is lower than the PLINK 1.9 default of 20; this is due to the randomized algorithm's memory footprint growing quadratically w.r.t. the PC count.)
- The
approxmodifier causes the standard deterministic computation to be replaced with the randomized algorithm originally implemented for Galinsky KJ, Bhatia G, Loh PR, Georgiev S, Mukherjee S, Patterson NJ, Price AL (2016) Fast Principal-Component Analysis Reveals Convergent Evolution of ADH1B in Europe and East Asia. This can be a good idea when you have >5k samples, and is almost required with >50k. - The randomized algorithm always uses mean imputation for missing genotype calls. For comparison purposes, you can use the
meanimputemodifier to request this behavior for the standard computation. scols=can be used to customize how sample IDs appear in the.eigenvecfile. (maybefid,fid,maybesid, andsidsupported; default ismaybefid,maybesid.)- The
allele-wtsmodifier requests an additional one-line-per-allele.eigenvec.allelefile with PCs expressed as allele weights instead of sample weights. When it's present,vzscauses the.eigenvec.allelefile to be Zstd-compressed.vcols=can be used to customize the report columns; supported column sets are: chromโ Chromosome ID.posโ Base-pair coordinate. (ID is always present, and positioned here.)refโ Reference allele.alt1โ Alternate allele 1.altโ All alternate alleles, comma-separated. (A1 is always present, and positioned here.)axโ Non-A1 alleles, comma-separated. (PCs are always present, and positioned here.)
Default is chrom,ref,alt.
- For datasets with no multiallelic variants, the
'biallelic-var-wts'modifier requests the old.eigenvec.varformat, which only reports weights for major alleles. (These weights are 2x the corresponding.eigenvec.alleleweights.) Supported column sets are:chrom: Chromosome ID.pos: Base-pair coordinate. (IDis always present, and positioned here.)ref: Reference allele.alt1: Alternate allele 1.alt: All alternate alleles, comma-separated.maj: Major allele.nonmaj: Minor allele. (PCs are always present, and positioned here. Signs are w.r.t. the major, not necessarily reference, allele.)
Default is chrom,maj,nonmaj.
--king-cutoff[.king.bin + .king.id fileset prefix] <threshold> โ bestie this one is giving bouncer energy ๐ it excludes one member of each pair of samples whose KING-robust kinship is greater than the threshold you hand it. The IDs of the samples that stayed and the ones that got yeeted go to<output prefix>.king.cutoff.in.id+.king.cutoff.out.id. If a.king.binfile is present, it must be triangular (either precision is ok).--write-covar['cols='<column set descriptor>] โ okay so if covariates are defined, an updated version (with all filters applied) is automatically written to<output prefix>.covwhenever--make-pgen,--make-just-psam,--export, or a similar command is present. But if you don't want to simultaneously generate a new sample file, you can use--write-covarto just produce a pruned covariate file. Supported column sets are:maybefid: FID, if that column was in the input.fid: Force FID column to be written even when absent in the input.maybesid: SID, if that column was in the input.sid: Force SID column to be written even when absent in the input.maybeparents: Father/mother IIDs ('0'= missing), if columns in input.parents: Force PAT/MAT columns to be written even when absent in input.sex:'1'= male,'2'= female,'NA'= missing.pheno1: First active phenotype. If none, all column entries are set to the--output-missing-phenotypestring.phenos: All active phenotypes, if any. (Can be combined withpheno1to force at least one phenotype column to be written.)
(Covariates are always present, and positioned here.)
The default is maybefid,maybesid.
--write-samplesโ reports the IDs of all samples which pass your filters/inclusion thresholds. slay โจ--write-snplist['zs'] ['allow-dups'] โ lists all variants which pass your filters/inclusion thresholds. Unless the'allow-dups'modifier is provided, this now errors out when duplicate variant ID(s) remain. ๐--glm['zs'] ['omit-ref'] [{sex | no-x-sex}] ['log10'] ['pheno-ids'] [{genotypic | hethom | dominant | recessive}] ['interaction'] ['skip'] ['hide-covar'] [{no-firth | firth-fallback | firth}] ['intercept'] ['cols='<col set desc>] ['local-covar='<file>] ['local-psam='<file>] ['local-pos-cols='<key col #s> | 'local-pvar='<file>] ['local-haps'] ['local-omit-last' | 'local-cats[0]='<category ct>] ['allow-no-covars'] โ basic association analysis on quantitative and/or case/control phenotypes. For each variant, a linear (for quantitative traits) or logistic (for case/control) regression is run with the phenotype as the dependent variable, and nonmajor allele dosage(s) and a constant-1 column as predictors. ๐- There is usually an additive effect line for every nonmajor allele, and no such line for the major allele. To omit REF alleles instead of major alleles, add the
'omit-ref'modifier. (When performing interaction testing, this tends to cause the multicollinearity check to fail for low-ref-frequency variants.) - By default, sex (male = 1, female = 2; note that this is a change from PLINK 1.x) is automatically added as a predictor for X chromosome variants, and no others. The
'sex'modifier causes it to be added everywhere (except chrY), while'no-x-sex'excludes it entirely. - The
'log10'modifier causes p-values to be reported in-log10(p)form. 'pheno-ids'causes the samples used in each set of regressions to be written to an.idfile. (When the samples differ on chrX or chrY,.x.idand/or.y.idfiles are also written.)- The
'genotypic'modifier adds an additive effect/dominance deviation 2df joint test (0-2 and 0..1..0 coding), while'hethom'uses 0..0..1 and 0..1..0 coding instead. 'dominant'and'recessive'specify a model assuming full dominance or recessiveness, respectively, for the ref allele. I.e. the genotype column is recoded as 0..1..1 or 0..0..1, respectively.'interaction'adds genotype x covariate interactions to the model. Note that this tends to produce'NA'results (due to the multicollinearity check) when the reference allele is'wrong';--maj-refcan be used to enable analysis of those variants.- Additional predictors can be added with
--covar. By default, association statistics are reported for all nonconstant predictors;'hide-covar'suppresses covariate-only results, while'intercept'causes intercepts to be reported. Since running--glmwithout at least e.g. principal component covariates is usually an analytical mistake, the'allow-no-covars'modifier is now required when you're intentionally running--glmwithout a covariate file. ๐ญ - By default, if the current phenotype and covariates are such that every regression on a chromosome will fail, PLINK 2 errors out. To just skip the phenotype or chromosome instead, add the
'skip'modifier. - There are now three regression modes for case/control phenotypes:
'no-firth'requests PLINK 1.x's behavior, where a NA result is reported when basic logistic regression fails to converge.'firth-fallback'requests logistic regression, followed by Firth regression whenever the logistic regression fails to converge. This is now the default.'firth'requests Firth regression all the time.
- To add covariates which are not constant across all variants, add the
'local-covar='and'local-psam='modifiers, use full filenames for each, and use either'local-pvar='or'local-pos-cols='to provide variant ID or position information. Normally, the local-covar file should have c * n real-valued columns, where the first c columns correspond to the first sample in the local-psam file, columns (c+1) to 2*c* correspond to the second sample, etc.; and the mth line corresponds to the mth nonheader line of the local-pvar file when there is one. (Variants outside of the local-pvar file are excluded from the regression.) The local covariates are assigned the namesLOCAL1,LOCAL2, etc.; to exclude the last local covariate from the regression (necessary if they are e.g. local ancestry coefficients which sum to 1), add'local-omit-last'. Alternatively, with'local-cats='<k>, the local-covar file is expected to have n columns with integer-valued entries in [1, k]. (This range is [0, k-1] with'local-cats0='.) These category assignments are expanded into (k-1) local covariates in the usual manner. When position information is in the local-covar file, this should be indicated by'local-pos-cols='<number of header rows>,<chrom col #>,<pos start col #>,<first covariate col #>.'local-haps'indicates that there's one column or column-group per haplotype instead of per sample; they are averaged by--glm.
- There is usually an additive effect line for every nonmajor allele, and no such line for the major allele. To omit REF alleles instead of major alleles, add the
The main report supports the following column sets:
chrom: Chromosome ID.pos: Base-pair coordinate. (IDis always present, and positioned here.)ref: Reference allele.alt1: Alternate allele 1.alt: All alternate alleles, comma-separated.- (
A1is always present, and positioned here. For multiallelic variants, this column may contain multiple comma-separated alleles when the result doesn't depend on which allele is A1.) ax: Non-A1 alleles, comma-separated.a1count: A1 allele count (can be decimal with dosage data).totallele: Allele observation count (can be higher than--freqvalue, due to inclusion of het haploids and chrX model).a1countcc: A1 count in cases, then controls (case/control only).totallelecc: Case and control allele observation counts.gcountcc: Genotype hardcall counts (neither-A1, het-A1, A1-A1) in cases, then controls (case/control only).a1freq: A1 allele frequency.a1freqcc: A1 frequency in cases, then controls (case/control only).machr2: Unphased MaCH imputation quality (frequently labeled'INFO').firth: Reports whether Firth regression was used (firth-fallbackonly).test: Test identifier. (Required unless only one test is run.)nobs: Number of samples in the regression.beta: Regression coefficient (for A1 if additive test).orbeta: Odds ratio for case/control, beta for quantitative traits. (Ignored if'beta'column set included.)se: Standard error of beta.ci: Bounds of symmetric approximate confidence interval (requires--ci).tz: T-statistic for linear regression, Wald Z-score for logistic/Firth.p: Asymptotic p-value (or-log10(p)) for T/Z-statistic.err: Error code for NA results.
The default is chrom,pos,ref,alt,firth,test,nobs,orbeta,se,ci,tz,p,err.
--score<filename> [i] [j] [k] [{header | header-read}] [{center | variance-standardize | dominant | recessive}] ['no-mean-imputation'] ['se'] ['zs'] ['ignore-dup-ids'] [{list-variants | list-variants-zs}] ['cols='<col set descriptor>] โ applies linear scoring system(s) to each sample ๐ง the input file should have one line per scored (variant, allele) pair. Variant IDs are read from column #i and allele codes are read from column #j, where i defaults to 1 and j defaults to i+1.- By default, a single column of input coefficients is read from column #k,
okay so k defaults to j+1 โ and psst, --score-col-nums can be used to specify multiple columns, so you're not stuck with just one. ๐
Now the modifiers, one by one, because every single one of them matters:
'header-read'makes the first line of the input file be treated as a header line containing score names. Skip that and your score(s) just get assigned the names'SCORE1','SCORE2', etc. โ while plain'header'just causes the first line to be entirely ignored.- By default, copies of unnamed alleles contribute zero to score, while missing genotypes contribute an amount proportional to the loaded (via
--read-freq) or imputed allele frequency. Wanna throw out missing observations instead? That decreases the denominator in the final average when this happens โ so use the'no-mean-imputation'modifier. ๐ซถ 'center'shifts all genotypes to mean zero.'variance-standardize'linearly transforms the genotypes to mean-0, variance-1. Both valid, both iconic. โจ'dominant'causes dosages greater than 1 to be treated as 1, while'recessive'usesmax(dosage - 1, 0)on diploid chromosomes.
๐จ bestie listen โ'dominant','recessive', and'variance-standardize'cannot be used with chrX. Periodt.
'se'causes the input coefficients to be treated as independent standard errors; in this case, standard errors for the score average/sum are reported. โ ๏ธ But note: this will systematically underestimate standard errors when scored variants are in LD. iykyk.- By default,
--scoreerrors out if a variant ID in the input file appears multiple times in the main dataset. Use the'ignore-dup-ids'modifier to skip them instead โ a warning is still printed if such variants are present, so you're never flying blind. ๐ - The
'list-variants[-zs]'modifier causes variant IDs used for scoring to be written to<output prefix>.sscore.vars[.zst]. Obsessed with a tidy file tree. ๐ธ
The main report supports the following column sets:
maybefidโ FID, if that column was in the input.fidโ Force FID column to be written even when absent in the input. (IID is always present, and positioned here.) ๐maybesidโ SID, if that column was in the input.sidโ Force SID column to be written even when absent in the input.pheno1โ First active phenotype.phenosโ All active phenotypes, if any.nalleleโ Number of nonmissing alleles.denomโ Denominator of score average (equal tonallelevalue when'no-mean-imputation'specified).dosagesumโ Sum of named allele dosages.scoreavgsโ Score averages.scoresumsโ Score sums.
The default is maybefid,maybesid,phenos,nallele,dosagesum,scoreavgs. And fr fr โ for more sophisticated polygenic risk scoring, we recommend looking at the LDpred (https://github.com/bvilhjal/ldpred) and PRSice-2 (https://www.prsice.info/) software packages. ๐ง
๐ --variant-score <filename> ['zs'] ['bin' | 'cols='<col set descriptor>]
(alias: --vscore)
Apply linear scoring system(s) to each variant. Each reported variant score is the dot product of a sample-weight vector with the total-ALT-dosage vector, with MAF-based mean imputation applied to missing dosages. ๐งฎ
Input file format: one line per sample, each starting with an ID and followed by scoring weight(s); it can also have a header line with the sample ID representation and the score name(s).
The usual .vscore text report supports the following column sets:
chromโ Chromosome ID.posโ Base-pair coordinate. (ID is always present, and positioned here.) ๐refโ Reference allele.alt1โ Alternate allele 1.altโ All alternate alleles, comma-separated.altfreqโ ALT allele frequency used for mean-imputation.nmissโ Number of missing (and thus mean-imputed) dosages.nobsโ Number of (nonmissing) sample observations. (Variant scores are always present, and positioned here.)
Default is chrom,pos,ref,alt. If binary output is requested instead, the main .vscore.bin matrix contains double-precision floating-point values, column (score) ID(s) are saved to <output prefix>.vscore.cols, and variant IDs are saved to <output prefix>.vscore.vars[.zst]. โจ
๐ --adjust-file <filename> ['zs'] ['gc'] ['cols='<column set descriptor>] ['log10'] ['input-log10'] ['test='<test name, case-sensitive>]
Given a file with unfiltered association test results, report some basic multiple-testing corrections, sorted in increasing-p-value order. ๐
'gc'causes genomic-controlled p-values to be used in the formulas.
๐ญ (This tends to be overly conservative. We note that LD Score regression usually does a better job of calibrating lambda; see Lee JJ, McGue M, Iacono WG, Chow CC (2018) The accuracy of LD Score regression as an estimator of confounding and genetic correlations in genome-wide association studies.)
'log10'causes negative base 10 logs of p-values to be reported, instead of raw p-values.'input-log10'specifies that the input file contains -log10(p) values.- If the input file contains multiple tests per variant which are distinguished by a
'TEST'column (true for--linear/--logistic/--glm), you must use'test='to select the test to process.
The following column sets are supported:
chromโ Chromosome ID.posโ Base-pair coordinate. (ID is always present, and positioned here.) ๐refโ Reference allele.alt1โ Alternate allele 1.altโ All alternate alleles, comma-separated.a1โ Tested allele. (Omitted if missing from input file.)unadjโ Unadjusted p-value.gcโ Devlin & Roeder (1999) genomic control corrected p-value (additive models only).qqโ P-value quantile.bonfโ Bonferroni correction.holmโ Holm-Bonferroni (1979) adjusted p-value.sidakssโ Sidak single-step adjusted p-value.sidaksdโ Sidak step-down adjusted p-value.fdrbhโ Benjamini & Hochberg (1995) step-up false discovery control.fdrbyโ Benjamini & Yekutieli (2001) step-up false discovery control.
Default set is chrom,a1,unadj,gc,bonf,holm,sidakss,sidaksd,fdrbh,fdrby. ๐
๐ --genotyping-rate ['dosage']
Report genotyping rate in log (this was automatic in PLINK 1.x). Nostalgia but make it optional. ๐ฆ
๐ --pgen-info
Reports basic information about a .pgen file. Little peek, little vibe check. ๐
๐ --validate
Validates all variant records in a .pgen file. Every single one. No skipping. ๐
๐ --zst-decompress <.zst file> [output filename]
(alias: --zd)
Decompress a Zstd-compressed file. If no output filename is specified, the file is decompressed to standard output.
โ ๏ธ This cannot be used with any other flags, and does not cause a log file to be generated. Solo mission only.
The following other flags are supported.
--script <fname>โ Include command-line options from file.--rerun [log]โ Rerun commands in log (default'plink2.log').--versionโ Display only version number before exiting.--silentโ Suppress regular output to console. (Error-output is not suppressed.) ๐คซ--double-idโ Set both FIDs and IIDs to the VCF/.bgensample ID.--const-fid [ID]โ Set all FIDs to the given constant. If'0'(the default), no FID column is created.--id-delim [d]โ Normally parses single-delimiter sample IDs as<FID><d><IID>, and double-delimiter IDs as<FID><d><IID><d><SID>; default delimiter is'_'.--id-delimcan no longer be used with--double-id/--const-fid; it will error out if any ID lacks the delimiter. ๐จ--idspace-to <c>โ Convert spaces in VCF/.bgensample IDs to the given character.--iid-sidโ Make--id-delimand--sample-diffinterpret two-token sample IDs as IID-SID instead of FID-IID.--vcf-require-gtโ Skip variants with no GT field.--vcf-min-gq <val>โ No-call genotypes when GQ is present and below the threshold.--vcf-max-dp <val>โ No-call genotypes when DP is present and above/below the threshold.--vcf-min-dp <val>โ No-call genotypes when DP is present and above/below the threshold.--vcf-half-call <m>โ Specify how'0/.'and similar VCF GT values should be handled. The following four modes are supported:'error'/'e'(default) errors out and reports line #.'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 name>โ Specify single-chromosome.gen/.bgenfile with no useful chromosome info inside.--missing-code [string list](alias:--missing_code) โ Comma-delimited list of missing phenotype values for Oxford-format import (default'NA').--hard-call-threshold <val>โ When importing dosage data, a hardcall is normally saved when the distance from the nearest hardcall, defined as
0.5 * sum_i |x_i - round(x_i)|
(where the x_i's are 0..2 allele dosages), is not greater than 0.1. You can adjust this threshold by providing a numeric argument to --hard-call-threshold. You can also use this with --make-[b]pgen to alter the saved hardcalls while leaving the dosages untouched, or --make-bed to tweak hardcall export. ๐
--dosage-erase-threshold <val>โ--hard-call-thresholdnormally preserves the original dosages, and several PLINK 2 commands use them when they're available. Use--dosage-erase-thresholdto make PLINK 2 erase dosages and keep only hardcalls when distance-from-hardcall <= the given level. ๐ซถ--import-dosage-certainty <val>โ The PLINK 2 file format currently supports a single dosage for each allele. Some other dosage file formats include a separate probability for every possible genotype, e.g.{P(0/0)=0.2, P(0/1)=0.52, P(1/1)=0.28}, a highly uncertain call that is nevertheless treated as a hardcall under'--hard-call-threshold 0.1'. To make PLINK 2 treat a dosage as missing whenever the largest probability is less than a threshold, use--import-dosage-certainty. ๐ญ--input-missing-genotype <c>โ'.'is always interpreted as a missing genotype code in input files. By default,'0'also is; you can change this second missing code with--input-missing-genotype.--allow-extra-chrโ Permit unrecognized chromosome codes (alias--aec). ๐--chr-set <autosome ct> ['no-x'] ['no-y'] ['no-xy'] ['no-mt']โ bestie this is for when your organism is NOT a human and you gotta tell PLINK what chromosomes it's got. The first parameter is either the number of diploid autosome pairs (if it's positive) or the number of haploid chromosomes (if it's negative). Once you've said how many diploid autosomes there are, those extra modifiers just announce which non-autosomal chromosomes don't exist:'no-x','no-y','no-xy','no-mt'. ๐--cow,--dog,--horse,--mouse,--rice,--sheepโ cute little shortcuts for those exact species, so you don't have to hand-build a--chr-setyourself. ๐๐ถ๐ด๐ญ๐พ๐--autosome-num <val>โ it's literally just an alias for--chr-set <value> no-y no-xy no-mt. That's the whole vibe. โจ--humanโ say it out loud, specify the human chromosome set explicitly, AND make your.pvar/VCF output files include a##chrSetheader line. (ngl,.pvar/VCF output files already auto-include##chrSetwhenever you've specified a nonhuman set โ this flag is for the human case.) ๐งฌ--chr-override ['file']โ okay so by default, if--chr-set/--autosome-num/--cow/etc. disagrees with a##chrSetheader line in an input file, PLINK 2 will error out on you.--chr-overridewith no argument means the command line wins;'--chr-override file'means you defer to the file instead. Pick your fighter. ๐ฅ--var-min-qual <val>โ skip variants with low or missingQUAL. bye low-quality fakes ๐--var-filter [exception(s)...]โ skip variants that haveFILTERfailures.--extract-if-info <key> <op> <val>,--exclude-if-info <key> <op> <val>โ these exclude variants which don't / do satisfy a comparison predicate on an INFO key. Aliases:--extract-ifand--exclude-if. Example so it clicks:--extract-if-info "VT == SNP". And heads up โ unless the operator is!=, the predicate always evaluates to false when the key is missing. ๐ซ--require-info <key(s)...>,--require-no-info <key(s)...>โ exclude variants based on the nonexistence or existence of an INFO key. And"<key>=."gets treated as nonexistence, iykyk. ๐--extract-col-cond <f> [valcol] [IDcol] [skip],--extract-col-cond-match <(sub)string(s)...>,--extract-col-cond-mismatch <(sub)string(s)...>,--extract-col-cond-substr,--extract-col-cond-min <min>,--extract-col-cond-max <max>โ this whole squad excludes all variants that don't have a value-column entry satisfying a condition. The deets:- By default, values are read from column 2 of the file, and variant IDs are read from column 1.
- Three types of conditions are supported:
- When
--extract-col-cond-matchis specified without--extract-col-cond-substr, the value is checked for equality with the given strings, and kept iff one of them matches. Similarly,--extract-col-cond-mismatchwithout--extract-col-cond-substrcauses the variant to be kept iff the value matches none of the given strings. - When
--extract-col-cond-matchand/or-mismatchare specified with--extract-col-cond-substr, the variant is kept iff none of the--extract-col-cond-mismatchsubstrings are contained in the value, and either--extract-col-cond-matchwas unspecified or at least one of its substrings is contained. ๐ - Otherwise, the value is interpreted as a number, and the variant is kept if the number is in
[<min>, <max>](defaultmin=0,max=DBL_MAX).
--pheno ['iid-only'] <f>โ specify an additional phenotype/covariate file. And the glow-up: comma-delimited files with a header line are now permitted. ๐--pheno-name <name...>โ only load the designated phenotype(s) from the--phenofile (if one was specified) or the.psamfile (if no--pheno). Separate multiple names with spaces or commas, and use dashes to designate ranges. So efficient. โจ--pheno-col-nums <#...>โ only load the phenotype(s) in the designated column number(s) from the--phenofile.--no-psam-phenoโ ignore phenotype(s) in the.psam/.famfile. not today, pheno ๐--strict-sid0โ okay this one's a whole paragraph, sit with me. By default, if there's no SID column in the.psam/.fam(or--update-ids) file, but there IS one in another input file (for e.g.--keep/--remove), that latter SID column is ignored; sample IDs are considered matching as long asFIDandIIDare equal (with missingFIDtreated as'0'). If you ALSO want to requireSID = '0'for a sample ID match in this situation, add--strict-sid0. ๐--input-missing-phenotype <v>โ set a nonzero number to treat as a missing pheno/covar in input files (default-9).--no-input-missing-phenotypeโ don't treat ANY nonzero number as a missing pheno/covar. ('NA'/'nan'are still treated as missing, no cap.) ๐ซ--1โ expect case/control phenotypes in input files to be coded as0= control,1= case, instead of the usual0= missing,1= ctrl,2= case. (Unlike PLINK 1.x, this does not force all phenotypes to be interpreted as case/ctrl.) periodt.--missing-catname <str>โ set the missing-categorical-phenotype string. It's case-sensitive, default'NONE'. ๐--covar ['iid-only'] <f>โ specify an additional covariate file. Comma-delimited files with a header line are now permitted. same energy as--pheno, different column. ๐ธ--covar-name <name...>โ only load the designated covariate(s) from the--covarfile (if one was specified), the--phenofile (if no--covar), or the.psamfile (if no--covaror--pheno).--covar-col-nums <#...>โ only load the covariate(s) in the designated column number(s) from the--covarfile (if one was specified) or the--phenofile (if no--covar).--within <f> [new pheno name]โ import a PLINK 1.x categorical phenotype. (The phenotype name defaults to'CATPHENO'.) The lore:- If any numeric values are present, ALL values must be numeric. In that case,
'C'is added in front of all category names. 'NA'is treated as a missing value.
- If any numeric values are present, ALL values must be numeric. In that case,
--mwithin <n>โ load--withincategories from columnn+2. ๐งฎ--family [new pheno name]โ create a categorical phenotype fromFID. The restrictions on, and handling of, numeric values are the same as for--within. ๐ซถ--family-missing-catname <nm>โ make--familytreat the specifiedFIDas missing.--keep <fname...>โ exclude all samples not named in a file.--remove <fname...>โ exclude all samples named in a file.--keep-fam <fn...>โ exclude all families not named in a file.--remove-fam <f...>โ exclude all families named in a file. bye fam ๐
--extract [{bed0 | bed1}] <f...>,--exclude [{bed0 | bed1}] <f...>โ usually excludes all variants (not) named in the given file(s). When multiple files are named, they get concatenated. With the'bed0'or'bed1'modifier, variants outside/inside the positional ranges in the interval-BED file(s) are excluded instead.'bed0'tells PLINK 2 to assume the interval bounds follow the UCSC 0-based half-open convention, while'bed1'(equivalent to PLINK 1.9'range') specifies 1-based fully-closed. Pick your coordinate religion. ๐--extract-intersect [{bed0 | bed1}] <f...>โ just like--extract, except that a variant must be in the intersection, rather than just the union, of the files to remain. math girlie behaviour. ๐ฅ--bed-border-bp <n>,--bed-border-kb <n>โ stretch BED intervals by the given amount on each side. ๐--keep-cats <filename>,--keep-cat-names <nm...>โ these can be used individually or in combination to define a list of categories to keep; all samples not in one of the named categories are excluded. Use spaces to separate category names for--keep-cat-names. And use the--missing-catnamevalue (default'NONE') to refer to the group of uncategorized samples. ๐--keep-cat-pheno <pheno>โ if more than one categorical phenotype is loaded, or you wish to filter on a categorical covariate,--keep-cat-phenomust be used to specify which phenotype/covariate--keep-catsand--keep-cat-namesapply to. ๐--remove-cats <filename>โ exclude all categories named in the file.--remove-cat-names <...>โ exclude named categories.--remove-cat-pheno <phe>โ specify the pheno for--remove-cats/--remove-cat-names. ๐--split-cat-pheno [{omit-most | omit-last}] ['covar-01'] [cat. pheno/covar name(s)...]โ split n-category phenotype(s) into n (or n-1, with'omit-most'/'omit-last') binary phenotypes, with names of the form<orig. pheno name>=<cat. name>. (As a consequence, affected phenotypes and categories are not permitted to contain the'='character.) The details:- This happens after all sample filters.
- If no phenotype or covariate names are provided, all categorical phenotypes (but not covariates) are processed.
- By default, generated covariates are coded as
1=false,2=true. To code them as0=false,1=trueinstead, add the'covar-01'modifier. โจ
--loop-cats <pheno/covar>โ run variant filters and subsequent operations on just the samples in the first category; then just the samples in the second category; and so on, for all categories in the named categorical phenotype. it's giving for-loop but make it genetics. ๐--no-id-header ['iid-only']โ don't include a header line in.idoutput files. This normally forces two-columnFID/IIDoutput; add'iid-only'to force just a single-columnIID. ๐--variance-standardize [pheno/covar name(s)...],--covar-variance-standardize [covar name(s)...]โ linearly transform named covariates (and quantitative phenotypes, if--variance-standardize) to mean-zero, variance 1. If no arguments are provided, all possible phenotypes/covariates are affected. This is frequently necessary to prevent multicollinearity when dealing with covariates whereabs(mean)is much larger thanabs(standard deviation), such as year of birth. ๐ง--quantile-normalize [...],--pheno-quantile-normalize [...],--covar-quantile-normalize [...]โ force named covariates and quantitative phenotypes to aN(0,1)distribution, preserving only the original rank orders. iconic. ๐--chr <chr(s)...>โ exclude all variants not on the given chromosome(s). Valid choices for humans are0(unplaced),1-22,X,Y,XY,MT,PAR1, andPAR2. Separate multiple chromosomes with spaces and/or commas, and use a dash (no adjacent spaces permitted) to denote a range, e.g.'--chr 1-4, 22, par1, x, par2'. ๐--not-chr <...>โ reverse of--chr(exclude variants on the listed chromosomes). ๐--autosomeโ exclude all non-autosomal variants. simple, clean, slay. โจ--autosome-parโ exclude all non-autosomal variants, except those in a pseudo-autosomal region. the little exception that could. ๐ซถ--snps-only ['just-acgt']โ kicks out every variant that isn't a SNP. โจ By default, "SNP" means all the allele codes are single-character (so multiallelic variants that mix SNPs and non-SNPs get yeeted too โ bestie, split your variants first if that's a problem for you). The'just-acgt'modifier tightens it up so SNP codes have to be in{A,C,G,T,a,c,g,t,<missing>}.--from <var ID>,--to <var ID>โ use ID(s) to name a variant range to load. When you use them together, both variants have to live on the same chromosome, no cap. (--snpscan be used to specify intervals which cross chromosome boundaries, if you need that.)--snp <var ID>โ specify one single variant to load. That's it, that's the girl. ๐--exclude-snp <ID>โ specify one single variant to exclude. The opposite energy.--window <kbs>โ team this up with--snp/--exclude-snpand it loads/excludes all variants within half the specified kb distance of the named one. Half! Remember that.--from-bp <pos>,--to-bp <pos>,--from-kb <pos>,--to-kb <pos>,--from-mb <pos>,--to-mb <pos>โ use base-pair coordinates to define a variant range to load. Notes, bestie, read them:- You must use these with
--chr, specifying a single chromosome. - Decimals and negative numbers are permitted. โจ
- The
--to-bp(/-kb/-mb) position is no longer permitted to be smaller than the--from-bpposition. So don't try it.
- You must use these with
--snps <var IDs...>,--exclude-snps <...>โ use IDs to specify variant range(s) to load or exclude. E.g.--snps rs1111-rs2222, rs3333, rs4444. Slay.--force-intersectโ PLINK 2 normally errors out when multiple variant inclusion filters (--extract,--extract-col-cond,--extract-intersect,--from/--to,--from-bp/--to-bp,--snp,--snps) are specified.--force-intersectlets the run proceed anyway, and the set intersection gets taken. ๐--thin <p>โ randomly remove variants, retaining each with prob.p.--thin-count <n>โ randomly remove variants untilnof them remain.--bp-space <bps>โ remove variants so that each pair is no closer than the given bp distance.--thin-indiv <p>โ randomly remove samples, retaining with prob.p.--thin-indiv-count <n>โ randomly remove samples untilnof them remain.--keep-col-match <f> <val(s)...>โ exclude all samples without a 3rd column entry in the given file that exactly matches one of the given strings. (Separate multiple strings with spaces.)--keep-col-match-name <col name>โ check the column with the given name instead.--keep-col-match-num <n>โ check the nth column instead.--geno [val] [{dosage | hh-missing}],--mind [val] [{dosage | hh-missing}]โ exclude variants (--geno) and/or samples (--mind) with missing call frequencies greater than a threshold (default0.1). Okay so the details matter here, bestie:- That default threshold is only applied if
--geno/--mindis invoked without an argument. When--geno/--mindisn't invoked at all, no missing call frequency ceiling is enforced. Other inclusion/exclusion default thresholds work the same way. - By default, when a dosage is present but a hardcall is not, the genotype is treated as missing; add the
'dosage'modifier to treat this case as nonmissing. - Alternatively,
'hh-missing'also treats heterozygous haploid calls as missing.
- That default threshold is only applied if
--require-pheno [name(s)...],--require-covar [name(s)...]โ remove samples missing any of the named phenotype(s)/covariate(s). If no arguments are provided, all phenotype(s)/covariate(s) must be present. โจ--maf [freq] [mode](alias:--min-af) โ exclude variants with allele frequency lower than a threshold (default0.01). By default, the nonmajor allele frequency is used; the other supported modes are'nref'(non-reference),'alt1', and'minor'(least frequent). bcftoolsfreq:modenotation is permitted.--max-maf <freq> [mode](alias:--max-af) โ exclude variants with MAF greater than the threshold.--mac <ct> [mode](alias:--min-ac) โ exclude variants with allele dosage lower than the given threshold.--max-mac <ct> [mode](alias:--max-ac) โ exclude variants with allele dosage greater than the given threshold.--maf-succโ Rule of succession allele frequency estimation (used in EIGENSOFT). Givenjobservations of one allele andkobservations of the other for a biallelic variant, infer allele frequencies of(j+1) / (j+k+2)and(k+1) / (j+k+2), rather than the defaultj / (j+k)andk / (j+k). Note that this does not affect--freq's output.--min-alleles <ct>โ exclude variants with fewer than the given # of alleles. (When a variant has exactly one ALT allele, and it's a missing-code, it's excluded by--min-alleles 2.)--max-alleles <ct>โ exclude variants with more than the given # of alleles.--read-freq <file>โ load allele frequency estimates from the given--freqor--geno-counts(or PLINK 1.9--freqx) report, instead of imputing them from the immediate dataset.--hwe <p> ['midp'] ['keep-fewhet']โ exclude variants with Hardy-Weinberg equilibrium exact test p-values below a threshold. The lore:- By default, only founders are considered.
- chrX p-values are now computed using Graffelman and Weir's method.
- For variants with
kalleles withk>2,kseparate'biallelic'tests are performed, and the variant is filtered out if any of them fail. - With
'keep-fewhet', variants which fail the test in the too-few-hets direction are not excluded. On chrX, this uses the ratio between the Graffelman/Weir p-value and the female-only p-value. - There is currently no special handling of case/control phenotypes.
--mach-r2-filter [min] [max]โ exclude variants with MaCH imputation quality metric less than min or greater than max (defaults0.1and2.0). (Monomorphic variants, withr2 = nan, are not excluded.)- This is NOT identical to the R2 metric reported by Minimac3 0.1.13+; see below.
- If a single argument is provided, it is treated as the minimum.
- The metric is not computed on chrX and MT.
--minimac3-r2-filter <min> [max]โ compute Minimac3 R2 values from scratch, and exclude variants with R2 less than min or (if max is provided) greater than max.- Note that this requires phased-dosage data for all samples and variants; otherwise this will systematically underestimate imputation quality, since unphased hardcalls/dosages are treated as if they were maximally uncertain. (Use
--extract-if-info/--exclude-if-infoto filter on precomputed Minimac3 R2 in a VCF/.pvarINFO column.)
- Note that this requires phased-dosage data for all samples and variants; otherwise this will systematically underestimate imputation quality, since unphased hardcalls/dosages are treated as if they were maximally uncertain. (Use
--keep-femalesโ exclude male and unknown-sex samples.--keep-malesโ exclude female and unknown-sex samples.--keep-nosexโ exclude all known-sex samples.--remove-femalesโ exclude female samples.--remove-malesโ exclude male samples.--remove-nosexโ exclude unknown-sex samples.--keep-foundersโ exclude nonfounder samples.--keep-nonfoundersโ exclude founder samples.--keep-if <pheno/covar> <op> <val>,--remove-if <pheno/covar> <op> <v>โ exclude samples which don't/do satisfy a comparison predicate, e.g.--keep-if "PHENO1 == case". Heads up: unless the operator is!=, the predicate always evaluates to false when the phenotype/covariate is missing. ๐ซถ--nonfoundersโ include nonfounders in allele freq/HWE calculations.--bad-freqsโ when PLINK 2 needs decent allele frequencies, it normally errors out if they aren't provided by--read-freqand less than 50 founders are available to impute them from. Use--bad-freqsto force PLINK 2 to proceed in this case.--bad-ldโ PLINK 2 normally errors out when it needs to estimate LD between variants, but there are less than 50 founders to estimate from. Use--bad-ldto force PLINK 2 to proceed.--export-allele <file>โ with--export A/A-transpose/AD, count alleles named in the file, instead of REF alleles.--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'; default is now'MT'(note that this is a change from PLINK 1.x, which defaulted to'26').--output-missing-genotype <ch>โ set the code used to represent missing genotypes in output files (default'.').--output-missing-phenotype <s>โ set the string used to represent missing phenotypes in output files (default'NA').--sort-vars [mode]โ sort variants by chromosome, then position, then ID. The following string orders are supported:'natural'/'n': Natural sort (default).'ascii'/'a': ASCII. This must be used with--make-[b]pgen/--make-bed.
--set-hh-missing ['keep-dosage']โ make--make-[b]pgen/--make-bedset non-MT heterozygous haploid hardcalls, and all female chrY calls, to missing. (Unlike PLINK 1.x, this treats unknown-sex chrY genotypes like males, not females.) By default, all associated dosages are also erased; use'keep-dosage'to keep them all.--set-mixed-mt-missing ['keep-dosage']โ make--make-[b]pgen/--make-bedset mixed MT hardcalls to missing.--split-par <bp1> <bp2>,--split-par <build>โ changes the chromosome code of all X chromosome variants with bp position<= bp1to PAR1, and those with position>= bp2to PAR2. The following build codes are supported as shorthand:'b36'/'hg18'= NCBI 36, 2709521/154584237'b37'/'hg19'= GRCh37, 2699520/154931044'b38'/'hg38'= GRCh38, 2781479/155701383
--merge-parโ merge PAR1/PAR2 back with X. Requires PAR1 to be positioned immediately before X, and PAR2 to be immediately after X. (Should not be used with--export vcf, since it causes male homozygous/missing calls in PAR1/PAR2 to be reported as haploid.)--merge-xโ merge XY back with X. This usually has to be combined with--sort-vars.--set-missing-var-ids <t>โ given a template string with a'@'where the--set-all-var-ids <t>โ bestie, this one is the sibling of the missing-ID flag ๐ซถ. Same template deal: the chromosome code should go where it goes and'#'where the bp coordinate belongs. The difference?--set-missing-var-idsassigns chromosome-and-bp-based IDs to unnamed variants, while--set-all-var-idsresets all IDs, no survivors ๐ . You may also use'$r'/'$a'to refer to the ref and alt1 alleles, or'$1'/'$2'to refer to them in alphabetical order. iconic template energy โจ--var-id-multi <t>,--var-id-multi-nonsnp <t>โ Specify alternative templates for multiallelic variants. ('$a'and'$1'/'$2'should be avoided here, though they're technically still allowed.) ๐ฌ like, you can, but why--new-id-max-allele-len <len> [{error | missing | truncate}]โ Specify maximum number of leading characters from allele codes to include in new variant IDs, and behavior on longer codes (defaults23,error).--missing-var-code <str>โ Change unnamed variant code for--rm-dup,--set-{missing|all}-var-ids, and--recover-var-ids(default'.'). ๐--update-map <f> [bpcol] [IDcol] [skip]โ Update variant bp positions. ๐--update-name <f> [newcol] [oldcol] [skip]โ Update variant IDs. โจ--recover-var-ids <file> ['strict-bim-order'] [{rigid | force}] ['partial']โ Undo--set-all-var-ids, given the original.pvar/VCF/.bimfile. Original IDs are looked up by position and allele codes. the time machine flag fr fr- By default, if the original-ID file is a
.bim, allele order is ignored. Use'strict-bim-order'to force A1=ALT, A2=REF. ๐งฌ - If any variant has multiple matching records in the original-ID file, and the IDs conflict,
--recover-var-idswrites the affected (current) ID(s) to<output prefix>.recoverid.dup, and normally errors out. If the original-ID file has the same number of variants in the same order, you can still recover the old IDs with the'rigid'modifier in this case. Alternatively, to proceed and assign the missing-ID code to these variants, add the'force'modifier. (The.recoverid.dupfile is still written when'rigid'or'force'is specified.) ๐ --recover-var-idsnormally expects to replace all variant IDs, and errors out if any are left untouched. Add the'partial'modifier when you actually want to update just a proper subset. ๐
- By default, if the original-ID file is a
--update-alleles <fname>โ Update variant allele codes.--update-ids <fname>โ Update sample IDs.--update-parents <fname>โ Update parental IDs. ๐จโ๐ฉโ๐ง--update-sex <filename> ['col-num='<n>] ['male0']โ Update sex information. ๐ซถ- By default, if there is a header line starting with
'#FID'/'#IID', sex is loaded from the first column titled'SEX'(any capitalization); otherwise, column 3 is assumed. Use'col-num='to force a column number. any capitalization, she's flexible like that - Only the first character in the sex column is processed. By default,
'1'/'M'/'m'is interpreted as male,'2'/'F'/'f'is interpreted as female, and'0'/'N'is interpreted as unknown-sex. To change this to'0'/'M'/'m'= male,'1'/'F'/'f'= female, anything else other than'2'= unknown-sex, add'male0'. โญ
- By default, if there is a header line starting with
--real-ref-allelesโ Treat A2 alleles in a PLINK 1.x fileset as actual REF alleles; otherwise they're marked as provisional. ๐--maj-ref ['force']โ Set major alleles to reference, like PLINK 1.x automatically did. (Note that this is now opt-in rather than opt-out;--keep-allele-orderis no longer necessary to prevent allele-swapping.) ๐- This can only be used in runs with
--make-bed/--make-[b]pgen/--exportand no other commands. ๐ซ - By default, this only affects variants marked as having
'provisional'reference alleles. Add'force'to apply this to all variants. - All new reference alleles are marked as provisional. ๐ท๏ธ
- This can only be used in runs with
--ref-allele ['force'] <filename> [refcol] [IDcol] [skip]--alt1-allele ['force'] <filename> [alt1col] [IDcol] [skip]โ These set the alleles specified in the file to ref (--ref-allele) or alt1 (--alt1-allele). They can be combined in the same run. ๐ฏ- These can only be used in runs with
--make-bed/--make-[b]pgen/--exportand no other commands. "--ref-allele <VCF filename> 4 3 '#'", which scrapes reference allele assignments from a VCF file, is especially useful. ๐ฅ- By default, these error out when asked to change a
'known'reference allele. Add'force'to permit that (when e.g. switching to a new reference genome). โ ๏ธ - When
--alt1-allelechanges the previous ref allele to alt1, the previous alt1 allele is set to reference and marked as provisional. ๐
- These can only be used in runs with
--ref-from-fa ['force']โ This sets reference alleles from the--fafile when it can be done unambiguously (note that it's never possible for deletions or some insertions). By default, it errors out when asked to change a'known'reference allele; add the'force'modifier to permit that. ๐ธ--normalize ['list']โ Left-normalize all variants, using the--fafile. (alias:--norm) (Assumes no differences in capitalization.) The'list'modifier causes a list of affected variant IDs to be written to<output prefix>.normalized. left-normalize, she's tidy โจ--indiv-sort <mode> [f]โ Specify sample ID sort order for merge and--make-[b]pgen/--make-bed. The following four modes are supported:'none'/'0'keeps samples in the order they were loaded. Default for non-merge. ๐ซถ'natural'/'n'invokes "natural sort", e.g.'id2' < 'ID3' < 'id10'. Default when merging.'ascii'/'a'sorts in ASCII order, e.g.'ID3' < 'id10' < 'id2'.'file'/'f'uses the order in the given file (named in the last argument). ๐
--king-table-filter <min>โ Specify minimum kinship coefficient for inclusion in--make-king-tablereport. ๐--king-table-subset <f> [kmin]โ Restrict current--make-king-tablerun to sample pairs listed in the given.kin0file. If a second argument is provided, only sample pairs with kinship >= that threshold (in the input.kin0) are processed. ๐--condition <variant ID> [{dominant | recessive}] ['multiallelic']--condition-list <fname> [{dominant | recessive}] ['multiallelic']โ Add the given variant, or all variants in the given file, as--glmcovariates. By default, this errors out if any of the variants are multiallelic; add the'multiallelic'('m'for short) modifier to allow them. They'll effectively be split against the major allele (unless--glm's'omit-ref'modifier was specified), and all induced covariate names--even for biallelic variants--will have an underscore followed by the allele code at the end. ๐ญ so many underscores--parameters <...>โ Include only the given covariates/interactions in the--glmmodel, identified by a list of 1-based indices and/or ranges of them. ๐ข--tests <...>โ Perform a (joint) test on the specified term(s) in the--glmmodel, identified by 1-based indices and/or ranges of them.- Note that, when
--parametersis also present, the indices refer to the terms remaining AFTER pruning by--parameters. ๐ - You can use
'--tests all'to include all terms.
- Note that, when
--vif <max VIF>โ Set VIF threshold for--glmmulticollinearity check (default50). (This is no longer skipped for case/control phenotypes.) ๐--max-corr <val>โ Skip--glmregression when the absolute value of the correlation between two predictors exceeds this value (default0.999). ๐ซ--xchr-model <m>โ Set the chrX--glm/--condition[-list]/--[v]scoremodel.'0'= skip chrX.'1'= add sex as a covar on chrX, code males0..1.'2'(default) = chrX sex covar, code males0..2. (Use the--glm'interaction'modifier to test for interaction between genotype and sex.) ๐งฌ
--adjust ['zs'] ['gc'] ['log10'] ['cols='<column set descriptor>]โ For each association test in this run, report some basic multiple-testing corrections, sorted in increasing-p-value order. Modifiers work the same way as they do on--adjust-file. โจ--lambdaโ Set genomic control lambda for--adjust[-file]. ๐--adjust-chr-field <n...>--adjust-pos-field <n...>--adjust-id-field <n...>--adjust-ref-field <n...>--adjust-alt-field <n...>--adjust-a1-field <n...>--adjust-test-field <n...>--adjust-p-field <n...>โ Set--adjust-fileinput field names. When multiple arguments are given to these flags, earlier names take precedence over later ones. ๐ฅ first come, first served--ci <size>โ Report confidence ratios for odds ratios/betas. ๐--pfilter <val>โ Filter out assoc. test results with higher p-values. ๐๏ธ--score-col-nums <...>โ Process all the specified coefficient columns in the--scorefile, identified by 1-based indexes and/or ranges of them. ๐ข--q-score-range <range file> <data file> [i] [j] ['header'] ['min']โ Apply--scoreto subset(s) of variants in the primary score list(s) 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 line (except possibly the first). Variant IDs are read from column #
iand p-values are read from column #j, whereidefaults to1andjdefaults toi+1. The'header'modifier causes the first nonempty line of this file to be skipped. - By default,
--q-score-rangeerrors out when a variant ID appears multiple times in the data file (and is also present in the main dataset). To use the minimum p-value in this case instead, add the'min'modifier. lowest p-value wins, periodt
--vscore-col-nums <...>โ Process all the specified coefficient columns in the--variant-scorefile, identified by 1-based indexes and/or ranges of them. ๐--parallel <k> <n>โ bestie, this one splits the output matrix intonpieces and only computes thekth one ๐ฐ. The primary output file gets the piece number baked right into its name โ likeplink2.king.13, orplink2.king.13.zstifkis 13 โจ. Stack these files up in order (concatenate them) and boom, you've got the full matrix you wanted ๐ . (Yes, you can do that before decompressing. iconic.) N.B. this generally cannot be used to directly write a symmetric square matrix ๐ญ โ picksquare0ortriangleshape instead, then postprocess as necessary.--memory <val> ['require']โ sets the size, in MiB, of the initial workspacemallocattempt ๐ง . Want it to just error out instead of shrinking the request when that first attempt flops? Add the'require'modifier, periodt.--threads <val>โ sets the max number of compute threads โก get that parallelism, queen.--d <char>โ changes the variant/covariate range delimiter (normally'-') ๐.--seed <val...>โ sets the random number seed(s) ๐ฒ. Each value has to be an integer between0and4294967295inclusive, no cap. Heads up tho:--threadsand--memory requiremay also be needed to reproduce some randomized runs ๐.--output-min-p <p>โ specify the minimum p-value to write to reports ๐. (2.23e-308is useful for preventing underflow in some programs, iykyk.)--debugโ uses a slower, more crash-resistant logging method ๐ข๐ slow and steady wins the forensic race.--randmemโ randomizes initial workspace memory ๐ (helps catch uninitialized-memory bugs, fr fr).--warning-errcodeโ returns a nonzero error code to the OS when a run completes with warning(s) ๐จ like, girl, you will know.--zst-level <lvl>โ sets the Zstd compression level (1-22, default3) ๐๏ธโจ.
Primary methods paper, bestie โ cite her: 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. ๐๐
๐ SEE ALSO ๐
The full documentation for PLINK v2.00a3 64-bit (9 Apr is maintained as a Texinfo manual ๐. If the info and PLINK v2.00a3 64-bit (9 Apr programs are properly installed at your site, this command:
info PLINK v2.00a3 64-bit (9 Apr
should give you access to the complete manual ๐ซถโจ.
And that's a wrap on the whole page, babe ๐๐ โ PLINK v2.00a3 64-bit, dated 9 Apr 2020, March 2020. Go forth and genotype, bestie, you're literally the main character of computational biology ๐ ๐
๐ฆ where this page comes from
- debian bookworm: plink2 2.00~a3.5-220809+dfsg-1+b2 ยท GPL-3.0-or-later
- debian trixie: plink2 2.00~a6.9-250129+dfsg-1+b1 ยท GPL-3.0-or-later
- ubuntu jammy: plink2 2.00~a3-220218+dfsg-1 ยท GPL-3.0-or-later
- ubuntu noble: plink2 2.00~a5.8-231123+dfsg-1 ยท GPL-3.0-or-later
- ubuntu questing: plink2 2.00~a6.9-250129+dfsg-1build2
- ubuntu resolute: plink2 2.00~a6.9-250129+dfsg-1build3 ยท GPL-3.0-or-later
- ubuntu stonking: plink2 2.00~a6.9-250129+dfsg-1build3 ยท GPL-3.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms