Skip to content
Lizhong Wang edited this page Apr 24, 2017 · 8 revisions

Short for Principal Component Analysis , calculate with smartpca in EIGENSOFT.


01.Run.PCA

Run like this: smartpca -p smartpca.par >smartpca.par.log.

Prepare a parameter file smartpca.par like this:

# input
genotypename: input.ped
snpname:      input.map
indivname:    input.pedind

# output
evecoutname:  PCAout.evec
evaloutname:  PCAout.eigenvalues

# PC number
numoutevec:          4

# outlier
numoutlieriter:      0
altnormstyle:        NO
numoutlierevec:      10
outliersigmathresh:  6

# Multi-threading
numthreads:          10

# output EIGENSTRAT files
outputformat:      EIGENSTRAT
genotypeoutname:   input.EIGENSTRAT.geno
snpoutname:        input.EIGENSTRAT.snp
indivoutname:      input.EIGENSTRAT.ind

More parameters of smartpca.


02. Tracy-Widom (TW) statistics

twstats -t EIG4.2/POPGEN/twtable -i PCAout.eigenvalues -o PCAout.eigenvalues.TWstatistics

03.plot

# plot PC1 and PC2
ploteig -i PCAout.evec -c 1:2 -p poplist -o PCAout.plot.xtxt -x

More of ploteig.

Welcome!

「如无必要,勿增实体」

Clone this wiki locally