veg / hyphy-analyses

HyPhy standalone analyses
MIT License
37 stars 17 forks source link

Error in LoadFunctionLibrary when running in non-hyphy folder #11

Closed lskfs closed 4 years ago

lskfs commented 4 years ago

I tried to use pre-msa.bf tool to create codon alignment

when I run in hyphy folder it run successfully and generate the output:

./hyphy ../hyphy-analyses/codon-msa/pre-msa.bf --input ../hyphy-analyses/codon-msa/example.fas

but when I run in non-hyphy folder it got into LoadFunctionLibrary error:

/share/app/software/hyphy-2.5.17/hyphy \
    /share/app/software/hyphy-analyses/codon-msa/pre-msa.bf \
    --input /share/app/software/hyphy-analyses/codon-msa/example.fas

with Error information as below:

Could not read command file from 'libv3/tasks/alignments.bf' (expanded to '/share/app/software/hyphy-analyses/codon-msa/libv3/tasks/alignments.bf') in call to LoadFunctionLibrary("libv3/tasks/alignments.bf", /share/app/software/hyphy-analyses/codon-msa/);

So I create a softlink of libv3 under codon-msa directory:

cd /share/app/software/hyphy-analyses/codon-msa/
ln -s /share/app/software/hyphy-2.5.17/res/TemplateBatchFiles/libv3

then rerun the command show:

Could not read command file from 'libv3/UtilityFunctions.bf' (expanded to '/share/app/software/hyphy-analyses/codon-msa/libv3/libv3/UtilityFunctions.bf') in call to LoadFunctionLibrary("libv3/UtilityFunctions.bf", /share/app/software/hyphy-analyses/codon-msa/libv3/);

So how to run hyphy codon-msa tool under non-hyphy folder?

spond commented 4 years ago

Dear @moveAFs,

HyPhy needs to know where to find its library files (TemplateBatchFiles). It will look in

  1. Current working directory
  2. The install directory (whatever was specified to CMake, default is /usr/local/lib/hyphy)
  3. If there is a command line argument LIBPATH=/path/to/hyphy/res, then look in this directory

Based on your example, you should be able to run

/share/app/software/hyphy-2.5.17/hyphy LIBPATH=/share/app/software/hyphy-2.5.17/res ...

Best, Sergei

lskfs commented 4 years ago
/share/app/software/hyphy-2.5.17/hyphy LIBPATH=/share/app/software/hyphy-2.5.17/res ...

This solved problem, great thanks!