Plotting file eigenvec
1
7
Entering edit mode
10.6 years ago

Good morning,

I'm doing a research on GWAS and I've obtained some file .eigenvec and .eigenval after executing the command --pca on PLINK 1.9.

How can I plot those files? What software can i use for this purpose?

Thank you in advance

plink pca gwas • 9.4k views
ADD COMMENT
0
Entering edit mode

Relevant post: Gwas Stepwise Tutorial

ADD REPLY
10
Entering edit mode
10.6 years ago

This is straightforward in R.

  1. Load the .eigenvec file. E.g. eigenvec_table <- read.table('plink.eigenvec')

  2. Use plot() on the columns you're interested in. Top eigenvector will be in column 3, second eigenvector will be in column 4, etc., so if you want a set of pairwise plots covering the top 4 eigenvectors, use e.g. plot(eigenvec_table[3:6])

ADD COMMENT
0
Entering edit mode

Hi Chris, Why there is a "#" in the header of plink2.eigenvec? when R read "plink2.eigenvec", "#" line will be ignored

ADD REPLY
1
Entering edit mode

That depends on how you read the file with R.

For consistency with VCF, practically all plink2-output header lines start with ‘#’.

ADD REPLY
0
Entering edit mode

how to specify the colors to the different samples before plot pca?

ADD REPLY

Login before adding your answer.

Traffic: 1941 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6