Question: Error running smartpca from eigensoft
gravatar for scho249
2.2 years ago by
scho24920 wrote:


I have encountered an error trying to run smartpca from eigensoft.

I have converted ped file of my SNPs to eigensoft file format using fcgene and entered the following command line

to run smartpca:

 perl ./bin/smartpca.perl -i out_eigensoft.ped -a out_eigensoft.pedsnp -b out_eigensoft.pedind -m 0 -o out.pca -p out.plot -l out.log -e out.eval 


When I ran it, it gives an error claiming that:

OOPS couldn't open file out.pca.evec for reading at ./bin/smartpca.perl line 65.


All the files are in the bin folder, so I believe this is not the path problem...

I have been stuck for days now. Could someone help me please?




snp software error • 2.9k views
ADD COMMENTlink modified 4 months ago by silvia.shuchang.liu10 • written 2.2 years ago by scho24920

Could you paste the whole content of "out.log" to or here, if it's not too big? smartpca.perl runs several steps internally and I believe one of them dies, an early step creates out.pca.evec and a later step depends on out.pca.evec and doesn't find it

ADD REPLYlink written 2.2 years ago by Philipp Bayer5.3k

Hi Philipp,

Thanks and sorry for the late reply.

There isn't any output in the "out.log" file but only in "out.pca.par" file and this is the content it output:

genotypename: /gpfs1m/projects/landcare00051/eigensoft/dart/all/out_eigensoft.ped
snpname: /gpfs1m/projects/landcare00051/eigensoft/dart/all/out_eigensoft.pedsnp
indivname: /gpfs1m/projects/landcare00051/eigensoft/dart/all/out_eigensoft.pedind
evecoutname: /gpfs1m/projects/landcare00051/eigensoft/dart/all/pca/out.pca.evec
evaloutname: /gpfs1m/projects/landcare00051/eigensoft/dart/all/pca/out.eval
altnormstyle: NO
numoutevec: 10
numoutlieriter: 0
numoutlierevec: 10
outliersigmathresh: 6
qtmode: 0


I have set the PATH variable as well, so I was thinking it shouldn't have any problem locating the binaries....


ADD REPLYlink written 2.1 years ago by scho24920

Have you tried using smartPCA.perl with the example data provided in the archive (run "perl example.perl" in the EIGENSTRAT folder)? That way you'll at least know that PATH is correctly set up

If it works, you may run the steps that smartpca.perl runs manually, these are the steps it runs:

smartpca -p your_par_file

ploteig -i your_evec_file -c 1:2 -p your_populations -x -y -o your_plot_file

evec2pca.perl your_principal_components_number(10) your_evec_file your_individuals_file your_pca_file
ADD REPLYlink modified 2.1 years ago • written 2.1 years ago by Philipp Bayer5.3k

Hi Philipp,

Thank you so much for your advice. The example wasn't running as well and it turns out that the binary file 'smartpca' was not executable. So I used 'sudo chmod ug+x' and now it works fine.

Again thank you so much for your help!


ADD REPLYlink written 2.1 years ago by scho24920

Hi, everyone.

I've been stuck in an error for smartpca which is similar to the one described here. I do get the message:

OOPS couldn't open file out.pca.evec for reading at ./bin/smartpca.perl line 65.

But, also, I get the following message:

sh: smartpca: command not found

I'm running the exact same code Shane was (except I'm using geno type files, not ped). I guess this error has something to do with what Shane mentioned about setting the PATH variable and this not being the "path" problem... I think mine is exactly the path problem... When I check the README files for the program, there is the sentence "For this to work, the bin directory containing smartpca MUST be in your path.", and the same advise is inside the perl script. However, I really didn't understand what this means. Should I move some files from the bin folder in eigensoft to the bin folder of my local user?

I appreciate any help you could give me.

Thank you.


ADD REPLYlink written 6 months ago by rilquer100
gravatar for silvia.shuchang.liu
4 months ago by
silvia.shuchang.liu10 wrote:

Since example.evec should be an output from smartpca step, and its the input for evec2pca.perl step. But for smartpca.perl, there is no where to set this argument, so the second step cannot find example.evec. I suggest you to use the steps separately,

$../POPGEN/example.perl smartpca -p par.example >example.log ploteig -i example.evec -c 1:2 -p Case:Control -x -o example.plot.xtxt # optional evec2pca.perl 2 example.evec example.ind example.pca

Notice that for ../POPGEN/par.eample, it uses '../CONVERTF/example.ped' as indivname, so actually you can modify the example as,

../bin/smartpca -p ../POPGEN/par.example > example.log ../bin/evec2pca-ped.perl 2 example.evec ../CONVERTF/example.ped example.pca

ADD COMMENTlink written 4 months ago by silvia.shuchang.liu10
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1586 users visited in the last hour