Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sh: smartpca: command not found #46

Open
montenegrina opened this issue Apr 24, 2020 · 6 comments
Open

sh: smartpca: command not found #46

montenegrina opened this issue Apr 24, 2020 · 6 comments

Comments

@montenegrina
Copy link

Hello,

I downloaded in the current directory from where I am running smartpca.perl that script and evec2pca-ped.perl

I was running:
perl smartpca.perl -i output5F.bed -a output5F.pedsnp -b output5F.pedind -o output5F.pca -p output5F.plot -e output5F.eval -l output5F.smart
pca.log -m 5 -k 3 -t 2
smartpca -p output5F.pca.par >output5F.smartpca.log
sh: smartpca: command not found
OOPS couldn't open file output5F.pca.evec for reading at smartpca.perl line 65.

Can you please tell me how to resolve this?

I made both scripts executable via:
chmod a+x evec2pca-ped.perl
chmod a+x smartpca.perl

Please advise,
Thanks

@montenegrina
Copy link
Author

I also tried to add to the $PATH where both .perl scripts are:
export PATH="/projects/com_grassim/anamaria/anamaria/anamaria/dbgap_gokind/69568/PhenoGenotypeFiles/RootStudyConsentSet_phs000018.GAIN_GoKinD.v2.p1.c1.DS-T1DCR-IRB/GenotypeFiles/Output3:$PATH"

but again the same error

@MatthewMah
Copy link
Contributor

Did you build the smartpca executable?

@montenegrina
Copy link
Author

no I just downloaded smartpca.perl and evec2pca-ped.perl

How do I build this?

@montenegrina
Copy link
Author

I am running this on Ubuntu cluster

@montenegrina
Copy link
Author

I did try to install it from source in /src but after running "make" I got this:

$ make
cc -I/software/linux-el7-x86_64/tools/gtc2vcf/include -I../include -I/usr/include/openblas -c -o baseprog.o baseprog.c
cc -I/software/linux-el7-x86_64/tools/gtc2vcf/include -I../include -I/usr/include/openblas -c -o mcio.o mcio.c
cc -I/software/linux-el7-x86_64/tools/gtc2vcf/include -I../include -I/usr/include/openblas -c -o egsubs.o egsubs.c
cc -I/software/linux-el7-x86_64/tools/gtc2vcf/include -I../include -I/usr/include/openblas -c -o admutils.o admutils.c
cc -I/software/linux-el7-x86_64/tools/gtc2vcf/include -I../include -I/usr/include/openblas -c -o h2d.o h2d.c
cc -I/software/linux-el7-x86_64/tools/gtc2vcf/include -I../include -I/usr/include/openblas -c -o eigensrc/exclude.o eigensrc/exclude.c
make -C nicksrc
make[1]: Entering directory /projects/com_grassim/anamaria/anamaria/anamaria/dbgap_gokind/69568/PhenoGenotypeFiles/RootStudyConsentSet_phs000018.GAIN_GoKinD.v2.p1.c1.DS-T1DCR-IRB/GenotypeFiles/Output3/EIG/src/nicksrc' cc -I../../include -D_GNU_SOURCE -c -o gauss.o gauss.c cc -I../../include -D_GNU_SOURCE -c -o gds.o gds.c cc -I../../include -D_GNU_SOURCE -c -o getpars.o getpars.c cc -I../../include -D_GNU_SOURCE -c -o linsubs.o linsubs.c cc -I../../include -D_GNU_SOURCE -c -o sortit.o sortit.c cc -I../../include -D_GNU_SOURCE -c -o statsubs.o statsubs.c cc -I../../include -D_GNU_SOURCE -c -o strsubs.o strsubs.c cc -I../../include -D_GNU_SOURCE -c -o vsubs.o vsubs.c cc -I../../include -D_GNU_SOURCE -c -o xsearch.o xsearch.c cc -I../../include -D_GNU_SOURCE -c -o twtable.o twtable.c ar -r libnick.a gauss.o gds.o getpars.o linsubs.o sortit.o statsubs.o strsubs.o vsubs.o xsearch.o twtable.o ar: creating libnick.a make[1]: Leaving directory /projects/com_grassim/anamaria/anamaria/anamaria/dbgap_gokind/69568/PhenoGenotypeFiles/RootStudyConsentSet_phs000018.GAIN_GoKinD.v2.p1.c1.DS-T1DCR-IRB/GenotypeFiles/Output3/EIG/src/nicksrc'
cc -L/software/linux-el7-x86_64/tools/gtc2vcf/lib baseprog.o mcio.o egsubs.o admutils.o h2d.o eigensrc/exclude.o nicksrc/libnick.a -lgsl -lopenblas -lm -lpthread -o baseprog
/usr/bin/ld: cannot find -lopenblas
collect2: error: ld returned 1 exit status
make: *** [baseprog] Error 1

@MatthewMah
Copy link
Contributor

First, you have to install gsl and and openblas. The commands should be something like:

sudo apt-get install gsl-dev
sudo apt-get install openblas-dev

I don't have an Ubuntu machine available to verify these are correct. The package names may be different.

Once these are installed, try to run "make". If this fails, then you need to tell the linker where to find the gsl and openblas libraries. You can do this on the command line with something like:

make LDFLAGS="-L/usr/local/opt/openblas/lib -L/usr/local/opt/gsl/lib"

Or you can modify the Makefile.

I don't know where these libraries will be located on your machine, so the above paths are simply examples. You can find them using the standard utility find with something like:

find / "libgsl*"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants