Set Path Variable For Perl In Vcftools Perl Script Correctly
2
0
Entering edit mode
11.1 years ago

Hi all,

I am using Ubuntu and I cannot start the vcftools/bin/vcf-fix-ploidy perl function. It says:

Can't locate Vcf.pm in @INC (@INC contains:

/etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at /opt/vcftools/bin/vcf-fix-ploidy line 9.

Ok, i have to add the vcftools/perl directory to PATH:

setenv PATH ${PATH}:/opt/vcftools/perl
setenv PATH ${PATH}:/opt/vcftools/bin
setenv PATH ${PATH}:/opt/vcftools/

neither or all of this does help.

Furthermore I have no Variable PERL5LIB or PERLLIB, too.

These are my environmental variables, that I have:

USER=user0815
LOGNAME=user0815
HOME=/home/user0815
PATH=/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/sbin:/sbin:/usr/games:/psi/bin:.:/opt/vcftools/perl
MAIL=/home/user0815/Mail/Inbox
SHELL=/bin/tcsh
SSH_CLIENT=xxx
SSH_CONNECTION=xxx
SSH_TTY=/dev/pts/15
TERM=xterm
LANG=de_DE.UTF-8
XDG_SESSION_COOKIE=xxx
NLSPATH=/usr/share/locale/%L/LC_MESSAGES/%N.cat
HOSTTYPE=x86_64-linux
VENDOR=unknown
OSTYPE=linux
MACHTYPE=x86_64
SHLVL=1
PWD=progs/vcftools/perl
GROUP=mygroup
HOST=myhost
REMOTEHOST=myremotehost
OS_TYPE=LINUX
X11BASEDIR=/usr/X11R6
NNTPSERVER=news.mydomain.de
EDITOR=vi
no_proxy=alt_domain.de
MAILCAPS=/home/user0815/.mailcap:/etc/mailcap
PSI=/psi
MATLAB_JAVA=/usr/lib/jvm/java-1.6.0-openjdk/jre/
MAPLE_JAVA=/usr/lib/jvm/java-1.6.0-openjdk/jre/
ENVIRONMENT=NOBATCH
COLUMNS=208
LINES=62

What can I do? How can I tell PERL manually to include this path?

Thanks, all the best.

perl script ubuntu • 6.4k views
ADD COMMENT
0
Entering edit mode

it's a perl question, unrelated to bioinformatics.

ADD REPLY
0
Entering edit mode

you can run vctools using: perl -I /path/to/vcftools/perl /path/to/vcftools/perl/vcf-xxxxx

ADD REPLY
0
Entering edit mode

I am sorry, if this is not hte right place to ask. Btw, with the -I flag, the same error appears.

ADD REPLY
5
Entering edit mode
11.1 years ago

The import path of any righteous tool is beset on all sides by the inequities of the selfish and the tyranny of environment variables.

Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children

https://stackoverflow.com/questions/12320543/perl-library-path

ADD COMMENT
0
Entering edit mode
11.1 years ago
SES 8.6k

You can add the PERL5LIB variable, or you can add the lib path to your script. The environment variables are good because you can move the code around without editing it, but adding the path to the script is an easier fix.

In this case, add use lib qw(/opt/vcftools/lib/perl5/site_perl); to the top of vcf-fix-ploidy before use Vcf;.

ADD COMMENT

Login before adding your answer.

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