PCA using plink files
2
0
Entering edit mode
6.9 years ago
MAPK ★ 2.1k

I have .bed, .bim and .fam files. I have tried shellfish.py program from

http://www.stats.ox.ac.uk/~davison/software/shellfish/shellfish.php

using this command /shellfish/shellfish.py --pca --numpcs 10 --maxprocs 8 --file myfile --out qcvcf --ignore-sge which keeps spitting this error:

16:58:39 256 16:58:39 shellfish error: The command 'which lines' exited with code 256: please ensure that the program 'lines' is present in the current directory (or on your $PATH)

Is there any other ways to do PCA using set of .bed, .bim and .fam files? Also, what could be the cause of the error using shellfish.py as I would prefer to use shellfish.py?

pca • 14k views
ADD COMMENT
0
Entering edit mode

The error message is clear :-) It seems you have to install (or add to your path) a program called "lines"

An alternative to shellfish is smartpca

ADD REPLY
0
Entering edit mode

I agree the message is clear, but the program "lines" is already in shellfish package and still generates this error.

ADD REPLY
0
Entering edit mode

I'd try to add "." to the PATH, or just the full path to "lines"

ADD REPLY
4
Entering edit mode
6.9 years ago

plink 2.0 (http://www.cog-genomics.org/plink/2.0 ) has efficient PCA implementations. For smaller datasets (let's say <5000 samples),

plink2 --bfile myfile --pca 10 --out qcvcf

works; larger datasets can be handled with

plink2 --bfile myfile --pca approx 10 --out qcvcf
ADD COMMENT
3
Entering edit mode
6.9 years ago
sbk ▴ 60

@MAPK,

I haven't used shellfish.py so couldnt comment on it. You can probably use GCTA tool to compute PCs. Using the plink files first generate GRM files and the use the GRM file to compute PCs.

# compute GRM file
gcta64 --bfile  $bfile  --autosome --maf 0.01 --make-grm-bin --out $bfile --thread-num 28 

# compute principal components using GCTA
 gcta64 --grm-bin $bfile --pca 20 --out $bfile --thread-num 28

Here is the link to GCTA tool: http://cnsgenomics.com/software/gcta/

ADD COMMENT

Login before adding your answer.

Traffic: 2418 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