Question: Error running smartpca from eigensoft
1
gravatar for scho249
2.3 years ago by
scho24930
scho24930 wrote:

Hi,

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?

 

Shane 

 

snp software error • 3.3k views
ADD COMMENTlink modified 6 weeks ago by miaowzai40 • written 2.3 years ago by scho24930
1

Could you paste the whole content of "out.log" to pastebin.com 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.3 years ago by Philipp Bayer5.4k

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.3 years ago by scho24930
1

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.3 years ago • written 2.3 years ago by Philipp Bayer5.4k
1

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!

Shane

ADD REPLYlink written 2.3 years ago by scho24930
1

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.

Rilquer

ADD REPLYlink written 9 months ago by rilquer1010

I have the exact same problem. I also set the bin folder into my $PATH but that didn't help.

ADD REPLYlink written 6 weeks ago by miaowzai40

Opening a new question may help , but let's try here:

what is the output of

echo $PATH

does the list contain the folder that has smartpca? You may have to run 'export PATH' once

ADD REPLYlink written 6 weeks ago by Philipp Bayer5.4k

I searched and there're one or two exact same questions on biostars as well without any answers. I checked my $PATH and the smartpca bin folder is in my $PATH, and it still doesn't work. So I've come up with a barbarian way to do it (answered below) and now it is running.

ADD REPLYlink modified 6 weeks ago • written 6 weeks ago by miaowzai40
1
gravatar for miaowzai
6 weeks ago by
miaowzai40
United States
miaowzai40 wrote:

I have the exact same problem with Rilquer and setting the $PATH didn't help (I don't know why, very strange). I couldn't run the example.perl file, either. There is a very barbarian way to solve it.

Go to your smartpca.perl file and change the system(...) calls. There're not many of them, only three. Specifically, go to line58 and change $command = "smartpca" into $command = "/your/path/to/smartpca" if the script is executable or $command = "perl /your/path/to/smartpca.perl" if the script is not executable (or make it executable first!)

Similarily, go to line 94 and change $command = "ploteig" into $command = "/your/path/to/ploteig". Lastly, go to line 110 and 113 and change the $command accordingly.

This is not a good solution, but it does the work.

ADD COMMENTlink modified 6 weeks ago • written 6 weeks ago by miaowzai40
0
gravatar for silvia.shuchang.liu
7 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 7 months ago by silvia.shuchang.liu10

I have the exact same problem with Rilquer. I understand that doing it separately would help, but I didn't understand the code in your answer. Could you please explain a little bit more about how to do this separately? Thank you so much.

ADD REPLYlink written 6 weeks ago by miaowzai40
Please log in to add an answer.

Help
Access

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