PLINK is the workhorse for genotype data management and quality control, but it is a stateful rewriter of allele bookkeeping rather than a calculator: PLINK 1.x re-derives the A1 (effect) allele as the minor allele on every load, so effect estimates and PRS weights silently lose their allele anchor unless the alleles are pinned, while PLINK 2.0 tracks genuine REF/ALT. The QC decisions that matter most are not the thresholds but the order (variant missingness before sample missingness), the controls-only HWE convention (automatic in 1.9, manual in 2.0), and the case/control differential-missingness confounder that injects false association.
conda install -c bioconda plink plink2--geno (variant) and --mind (sample) in separate invocations, variant first, to control the implicit order.midp; in plink2 the controls-only behavior must be added explicitly.--make-king), not PI_HAT (--genome).--split-par) before any sex check or X-specific analysis.Tell your AI agent what you want to do: - "Convert this VCF to a PLINK fileset, keeping REF/ALT honest" - "Run standard GWAS QC on my genotypes in the correct order" - "Apply controls-only HWE filtering with mid-p" - "Find related individuals with KING and prune to unrelated" - "Check reported sex against X heterozygosity after splitting PAR" - "Test for differential missingness between cases and controls" - "Merge two genotype datasets and resolve strand flips"
"Convert imputed.vcf.gz to a PLINK 2.0 pgen fileset preserving dosages, then export a biallelic BED with the reference allele pinned from the GRCh38 FASTA."
"Run QC on cohort.bed: variant missingness at 0.02, then sample missingness at 0.02, MAF 0.01, and controls-only HWE at 1e-6 with mid-p."
"Compute KING kinship and remove one of each pair closer than second-degree, and flag heterozygosity outliers beyond 3 SD on LD-pruned SNPs."
"Run a differential-missingness test between my cases and controls and give me the list of variants to drop before GWAS."
--genome force 1.9; dosages and KING favor 2.0).--keep-allele-order on any BED export..pgen through QC if every downstream tool supports it; export .bed only as a last step and always with --keep-allele-order.--flip; resolve by allele frequency or drop them before merging cohorts.--glm on the filtered fileset.pgen