QTLtools-pca(1)

✨ NAME ✨

QTLtools pca πŸ’– is the command that conducts PCA (Principal Component Analysis) for you, bestie πŸ¦‹

🌸 SYNOPSIS 🌸

QTLtools pca --vcf [in.vcf|in.vcf.gz|in.bcf] | --bed in.bed.gz --out
output.txt [OPTIONS]

πŸ’… DESCRIPTION πŸ’…

okay so this mode runs a Principal Component Analysis (PCA) on either your molecular phenotype quantifications or your genotype data, and it's literally iconic πŸ”₯ People use it to (i) spot outliers in the data, (ii) sniff out stratification in the data, or (iii) build a covariate matrix before QTL mapping. QTLtools' PCA is powered by singular value decomposition (SVD), so it's giving math bestie energy 🧠✨ ngl, when you're building a covariate matrix to account for technical covariates, you should really use --center and --scale 🫢

πŸŽ€ OPTIONS πŸŽ€

  • --vcf [in.vcf|in.bcf|in.vcf.gz|in.bed.gz] β€” your genotypes, in VCF/BCF/BED format. This one is REQUIRED unless you're using --bed πŸ’œ
  • --bed quantifications.bed.gz β€” your quantifications, in BED format. REQUIRED unless you're using --vcf πŸ“
  • --out output_prefix β€” the output file prefix. REQUIRED no excuses 😭
  • --center β€” centers the variables (genotypes or phenotypes) by subtracting the mean from each value. Main character energy πŸ‘‘
  • --scale β€” scales the variables (genotypes or phenotypes) by dividing each value by the standard deviation πŸ“
  • --region chr:start-end β€” the genomic region you want processed. For example chr4:12334456-16334456, or just chr5 🧚
  • --exclude-chrs string β€” chromosomes you want to kick out, given as a space separated list. This only applies to --vcf πŸ™ˆ Its default is DEFAULT="X Y M MT XY chrX chrY chrM chrMT chrXY"
  • --maf float β€” excludes sites with a minor allele frequency below this number. Only applies to --vcf. Default is DEFAULT=0.0 ✨
  • --distance integer β€” only includes sites separated by this many base pairs. Only applies to --vcf. Default is DEFAULT=0 🌈

πŸ¦‹ OUTPUT FILES πŸ¦‹

.pca

this file holds the principal components that were calculated πŸ’– The names of the principal components, which live in the first column, are built from the output file prefix, whether the data was centered, whether the data was scaled, and the principal component number. Very organized, very slay πŸ’…

.pca_stats

this file has the standard deviation of each principal component, plus the variance and the cumulative variance explained by each PC πŸ“Šβœ¨

πŸ“ EXAMPLES πŸ“

  • Running pca on RNAseq quantifications to calculate technical covariates 🧬
QTLtools pca --bed genes.50percent.chr22.bed.gz --out
genes.50percent.chr22 --center --scale
  • Running pca on genotypes to detect population stratification 🌍
QTLtools pca --vcf genotypes.chr22.vcf.gz --out genotypes.chr22
--center --scale --maf 0.05 --distance 5000

πŸ”— SEE ALSO πŸ”—

πŸ™ˆ BUGS πŸ™ˆ

🚨 Versions up to and including 1.2 have a bug when reading missing genotypes in VCF/BCF files. It affects variants that have a DS field in their genotype's FORMAT and a missing genotype (DS field is .) in one of the samples. When that happens, the genotypes for all the samples get set to missing, which effectively removes that variant from the analyses. Yikes 😭

Please submit bugs to <https://github.com/qtltools/qtltools> πŸ›

πŸ‘‘ AUTHORS πŸ‘‘

Halit Ongen (halitongen@gmail.com), Olivier Delaneau (olivier.delaneau@gmail.com) πŸ’œ


Bestie, that's the whole tea 🌈 This page is from QTLtools v1.3, dated 06 May 2020, and it's the QTLtools-pca(1) manual. Now go run some PCA and make it iconic πŸ’–πŸ§šβœ¨