I did LD pruning in PLINK. As a result, I have .bed,.bim,.fam,.log and .nosex files. Now, I am trying to do PCA in eigenstrat.
As I understand, I need a parameter file to run the program. I guess I will just write a name for output file but How can I obtain input files?
I am trying to run convertf -p /data/myname/parfile.txt but it gives following error:
No command 'convertf' found, did you mean:
Command 'convert' from package 'imagemagick' (main) Command
'convert' from package 'graphicsmagick-imagemagick-compat' (universe)
convertf: command not found
By default, --pca extracts the top 20 principal components of the
variance-standardized relationship matrix; you can change the number
by passing a numeric parameter. Eigenvectors are written to
plink.eigenvec, and top eigenvalues are written to plink.eigenval. The
'header' modifier adds a header line to the .eigenvec file(s), and the
'tabs' modifier makes the .eigenvec file(s) tab- instead of
space-delimited. You can request variant weights with the 'var-wts'
modifier, and dump the matrix by using --pca in combination with
--make-rel/--make-grm-gz/--make-grm-bin.
You were only two clicks away :) - If you would follow the link that I provided you would find:
This is a simple port of GCTA's --pca flag, which generates the same
files from a previously computed relationship matrix.
Then if you go to the link of GCTA software:
Input the GRM and output the first n (n = 20, by default) eigenvalues
(saved as *.eigenval, plain text file) and eigenvectors (saved as
*.eigenvec, plain text file), which are equivalent to those calculated by the program EIGENSTRAT.
Actually, I have to use EIGENSTRAT to learn. It is my homework :) If you know how can I do in eigenstrat, please let me know.
By the way, I tried to do pca in plink. I got .eigenvec and .eigenval files. I want to draw a plot. In .eigenvec file, I have family ID column, sample individual ID column and 20 PC columns,respectively. Should I use first two PC columns? How can I draw a plot? I tried to draw in R using first two PCs and got a plot but I need to colour up it and give population names. How can I figure it out?
The EIGENSTRAT manual is very detailed. Try to ask more specific questions or say what you have tried and where you're struggling. If you don't understand what you want to plot I would suggest to learn why to use PCA in genetic analysis in the first place. Try googling it and read relevant papers/reviews. Your last question is a different topic and is how to plot it using R. Read an R manual and check the plot() function and check all the parameters that you can use. For colors it is: col.
I coverted bim/fam/bed files to ped/map files using --recode.
I created a txt file with the following contents. (parfile.txt)
I am trying to run convertf -p /data/myname/parfile.txt but it gives following error:
No command 'convertf' found, did you mean:
I hope that someone can help me.
Thanks