$ plink2 --export --help PLINK v2.00a3.7LM AVX2 Intel (24 Oct 2022) www./plink/2.0/ (C) 2005-2022 Shaun Purcell, Christopher Chang GNU General Public License v3 --help present, ignoring other flags.
--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='<#>] ['sample-v2'] Create a new fileset with all filters applied. The following output formats are supported: (actually, only A, AD, Av, bcf, bgen-1.x, haps, hapslegend, ind-major-bed, oxford, ped, tped, and vcf are implemented for now) * '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'. * 'Av': Variant-major 0/1/2. * 'beagle': Unphased per-autosome .dat and .map files, readable by early BEAGLE versions. * 'beagle-nomap': Single .beagle.dat file. * 'bgen-1.x': Oxford-format .bgen + .sample. For v1.2/v1.3, sample identifiers are stored in the .bgen (with id-delim and id-paste settings 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.txt file. Does not support multiple chromosomes. * 'fastphase': Per-chromosome fastPHASE files, with .chr-<chr #>.phase.inp filename extensions. * 'fastphase-1chr': Single .phase.inp file. 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 .haps file is block-gzipped. * '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. * 'ind-major-bed': PLINK 1 sample-major .bed (+ .bim + .fam). * 'lgen': PLINK 1long-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-v2': Oxford-format .gen + .sample. When the 'bgz' modifier is present, the .gen file is block-gzipped. 'oxford' requests the original .gen file format with 5 leading columns (understood by older PLINK builds); 'oxford-v2' requests the current 6-leading-column flavor. * 'ped', 'compound-genotypes': PLINK 1 sample-major (.ped + .map), loadable with --pedmap. * 'structure': Structure-format. * 'tped': PLINK 1 variant-major (.tped + .tfam), loadable with --tfile. * 'vcf', : VCF (default version 4.3). If PAR1 and PAR2 are present, 'vcf-4.2', they are automatically merged with chrX, with proper 'bcf', handling of chromosome codes and male ploidy. 'bcf-4.2' When the 'bgz' modifier is present, the VCF file is block-gzipped. (This always happens with BCF output.) The 'id-paste' modifier controls which .psam columns are used to construct sample IDs (choices are maybefid, fid, iid, maybesid, and sid; default is maybefid,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 six 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. 'DS-only': Same as DS-force, except GT field is omitted. '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 -> 0 and 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, --export defaults 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 'Av' formats; use --export-allele to control which alleles are counted there.) * 'sample-v2' exports .sample files according to the QCTOOLv2 rather than the original specification. Only one ID column is exported ('id-paste' and 'id-delim' settings apply), parental IDs are exported if present, and category names are preserved rather than converted to positive integers.
--export-allele <file> : With --export A/AD/Av, count alleles named in the file, instead of REF alleles.
$ plink2 --bfile a1 --export bgen-1.1 --out t1 PLINK v2.00a3.7LM AVX2 Intel (24 Oct 2022) www./plink/2.0/ (C) 2005-2022 Shaun Purcell, Christopher Chang GNU General Public License v3 Logging to t1.log. Options in effect: --bfile a1 --export bgen-1.1 --out t1
Start time: Thu Dec 1 18:59:10 2022 1031523 MiB RAM detected; reserving 515761 MiB for main workspace. Using up to 96 threads (change this with --threads). 86 samples (0 females, 0 males, 86 ambiguous; 86 founders) loaded from a1.fam. 50904 variants loaded from a1.bim. Note: No phenotype data present. Writing t1.bgen ... done. Writing t1.sample ... done.