github chrchang/plink-ng v1.9.1
1.9.1: Bugfixes from line-by-line review

one hour ago

Majority of these are from #665.

Association analysis

  • Case/control adaptive permutation (--assoc perm): every permuted statistic below the observed one was counted as a tie, inflating EMP1.
  • --assoc/--model max(T) permutation ('mperm='), and --test-missing: after the first batch of permutations, the running maximum used for early exits came from stale permutations.
  • Several --test-missing permutation fixes.
  • QT --assoc set test: permuted set statistics were read from uninitialized memory, so EMP1 was meaningless (usually 1/(N+1) for every set with a significant variant, and dependent on --perm-batch-size (#725).
  • --linear and QT --assoc set tests: variants whose t-test p-value underflowed to 0 kept their raw t statistic instead of the capped chi-square, distorting set scores.
  • --fisher midp, --model fisher-midp: 2x3 mid-p values missed tied tables and could be up to 50% too large. Regular p-values are unaffected.
  • --model --adjust: after the first chrY or MT variant, adjusted results were listed under the wrong variant IDs.
  • --adjust: SIDAK_SS and SIDAK_SD printed 0 for p-values between roughly 1e-16 and 1e-27 (#568).
  • --linear/--logistic:
    • With "--xchr-model 0" (also forced by 'genotypic', 'hethom', 'dominant', and 'recessive'), a skipped chromosome preceding an analyzed one caused the skipped chromosome's genotypes to be analyzed under the next chromosome's variant IDs (e.g. XY results came from X genotypes) (#715).
    • 'dominant' with 'sex' interaction terms: the interaction used additive instead of dominant coding. Non-chrX haploid variants could take the diploid additive coding path.
    • 'standard-beta' with missing genotypes: some samples with missing calls stayed in the phenotype standardization.
    • Joint tests (--tests, 'genotypic', etc.) on chromosomes where no tested term applies now report NA instead of a stale statistic, and are skipped by permutation.
    • --logistic with no variant ('no-snp'): rows were missing their trailing NA columns and newline, merging adjacent records.
    • --mperm-save-all: values were written for variants excluded from the analysis (shifting the dump), and with a joint test, the original-statistic row held the ADD statistic instead of the joint statistic (#715).
  • --model and QT --assoc with --mperm-save-all: skipped variants (and --pfilter-skipped ones) did not write their placeholders, shifting the dump's columns.
  • --dfam: the hypergeometric covariance term had the wrong sign (and was missing a factor in two places); families with genotyped parents counted unaffected children in the variance; and with --remove/--keep (or other sample filters) plus unrelated samples, case/control status was misread near the end of the file (#712).
  • --tdt, "--tdt poo": males' heterozygous chrX calls were not set to missing, so fathers and sons were counted as heterozygous parents/children (inflating chrX transmission counts several-fold on test data). --tdt poo 'mat' was unreachable (#720).
  • "--fast-epistasis boost": a tiny negative likelihood ratio (rounding error) printed p=0 for pairs with no interaction; STAT is now clamped to 0 (p=1) (#592).
  • --epistasis/--fast-epistasis .summary: per-variant best results were seeded from the wrong cells of the result matrix.
  • --meta-analysis 'weighted-z': WEIGHTED_Z and P(WZ) were nan whenever a study had a very small p-value, and p=0 studies were dropped. OR=0 input is now rejected (BAD_ES) instead of poisoning the variant.
  • --clump-replicate now behaves as documented: a clump is kept iff its p2-significant results, including the index variant's own, come from at least two files (#722).
  • --clump-range/--clump-verbose: a range starting at a clump's last position was not reported (#721).
  • --lasso: with covariates, the low-memory code path (used when the data matrix doesn't fit in the workspace) started from uninitialized coefficients. Constant phenotypes/covariates such as a constant 0.1 were not detected. MT haploid handling was applied inconsistently.

Linkage disequilibrium

  • chrX: haplotype frequencies for pairs where the second variant is on chrX used the wrong male correction, and --r/--r2 'dprime' misplaced chrX boundaries and windowed results. Affects --r/--r2 'dprime', --ld, --indep-pairphase and other haplotype-based r^2.
  • --ld/--twolocus HWE printout: chrX male counts were subtracted incorrectly, and also applied off chrX.
  • --r/--r2 square 'bin'/'bin4' spanning several calculation blocks: rows were truncated, giving a wrong-size matrix.
  • --show-tags ignored het. haploid filtering; --blocks built its haploid filters for the wrong samples (which could also hang).
    Distances, relationships and clustering
  • --cluster, --neighbour and --mds-plot with --read-dists: the documented allele-count distance matrix was used as an IBS similarity matrix, inverting the clustering. These now produce the genotype-based results (#723).
  • --mds-plot 'by-cluster': half of the cluster distance matrix was never accumulated, so results were wrong unless samples were grouped by cluster in file order. 'eigendecomp' left one matrix entry uncentered (#712).
  • --cluster --match/--match-type: after a missing covariate value, later covariates were compared with the wrong match type.
  • --genome: if the first chromosome was haploid or MT, its variants were still read.

Sets

  • --write-set listed the wrong variant IDs.
  • Set definitions could drop the variants in a range's final partial word from set unions. --gene filtering was skipped in one --set parsing path.
  • --set-table with no surviving sets wrote all rows on one line (#591).
  • --annotate with a long --annotate-snp-field name sized its header column incorrectly.

Data management and file conversion

  • --autosome-xy had no effect (#721).
  • --flip-subset with --indiv-sort flipped the wrong samples.
  • --lfile with an unsorted .map scrambled variant order.
  • --merge-mode 6/7 diff reports printed the wrong alleles.
  • --recode HV with multi-character alleles corrupted genotypes.
  • --freq with --within (.frq.strat): long contig names corrupted the report (#686).
  • --vcf-half-call haploid could set the wrong allele at multiallelic sites.
  • BCF input: headers listing an INFO/FORMAT/FILTER ID more than once shifted later dictionary indices (including FORMAT:GT's), and contig lines with only an ID were rejected.
  • --cm-map : an '@' in the file name was still treated as a chromosome placeholder.
  • --oblig-missing counted duplicate (cluster, variant) entries twice.
  • --simulate: a typo in the conditional genotype probability calculation; --simulate-qt with tag variants never applied the causal effect.
  • --dosage --score: the CNT2 column used the wrong missing-call counts.
  • --homozyg group-verbose printed swapped alleles for variants whose allele order was reversed internally.
  • Numbers in a tiny window just below 1e-3 printed in scientific notation could get the wrong mantissa/exponent.

Other

  • --cm-map with an '@' pattern now errors out when no matching file exists (previously it exited 0 with no positions updated) (#713).
  • --show-tags and --flip-scan now reject --ld-xchr 3; previously they were treating it as mode 1 (#712).
  • A few flags sharing a prefix with a shorter flag (--set-r2-phase, --set-max, --tag-mode2, --write-set-r2, and --mcc) were matched as that shorter flag (or the wrong branch); they are now parsed as themselves.
  • --groupdist's log output now labels the standard error of the mean "sem" instead of "sd" (#724).

Don't miss a new plink-ng release

NewReleases is sending notifications on new releases.