我在安装Bio-DB-HTS(https://github.com/Ensembl/Bio-DB-HTS)时遇到一些问题,需要从克隆的git存储库中运行perl脚本。
系统和Perl信息
我在Mac OSx High Sierra v.10.13.6上,并使用perl 5,版本18,版本2(v5.18.2)。我已经在最初的问题中添加了此信息。
背景信息
当尝试执行本地安装时,根据自述文件的说明,我收到错误消息...
git clone https://github.com/Ensembl/Bio-DB-HTS.git
cd Bio-DB-HTS-2.10
perl INSTALL.pl
lzma.h library header not found in /usr/include
我尝试安装LZMA库,但发现它实际上已安装,并且路径/ usr / include中根本没有lzma.h头文件。由于不推荐使用LZMA并用XZ代替,因此我安装了XZ库
brew install xz
快速搜索后,我在...中找到了lzma.h标头
/usr/local/Cellar/xz/5.2.4/include/lzma.h
现在这是我不确定如何进行的地方,并且在尝试解决此问题时是否弄不清楚了什么。由于/ usr / include的目录具有受限制的访问权限,因此我在INSTALL.pl脚本中添加了一行,以检查两个位置的文件是否存在(这可能会干扰分析中的某些内容,因为除了如果有条件,但是,这次运行安装程序时,我遇到了一个新问题。
perl INSTALL.pl
BioPerl does not seem to be installed. Please install it and try again.
On Debian/Ubuntu systems you can do this with the command:
apt-get install bioperl
On other systems use the CPAN shell:
perl -MCPAN -e 'install Bio::Perl'
这是我的主要问题所在。当尝试使用cpan测试安装Bio:Perl时,在各个阶段都会失败,而且我不确定哪些是必不可少的。输出的最后几行是
Result: FAIL
Failed 3/325 test programs. 16/19945 subtests failed.
CJFIELDS/BioPerl-1.007002.tar.gz
./Build test -- NOT OK
//hint// to see the cpan-testers results for installing this module,
try:
reports CJFIELDS/BioPerl-1.007002.tar.gz
Running Build install
make test had returned bad status, won't install without force
我将cpan重新配置为自动安装依赖项,如此处How do I tell CPAN to install all dependencies?所述。
perl -MCPAN -Mlocal::lib=~/perl5 -e 'my $c = "CPAN::HandleConfig"; $c->load(doit => 1, autoconfig => 1); $c->edit(prerequisites_policy => "follow"); $c->edit(build_requires_install_policy => "yes"); $c->commit'
并尝试再次安装以强制安装...
perl -f -MCPAN -e 'install Bio::Perl'
但是我得到同样的错误
Result: FAIL
Failed 3/325 test programs. 16/19945 subtests failed.
CJFIELDS/BioPerl-1.007002.tar.gz
./Build test -- NOT OK
//hint// to see the cpan-testers results for installing this module,
try:
reports CJFIELDS/BioPerl-1.007002.tar.gz
Running Build install
make test had returned bad status, won't install without force
当我查看使用...安装了哪些模块时
cpan -l
Bio::DB::HTS 2.11
Bio::DB::HTS::ReadIterator 2.11
Bio::DB::HTS::VCF 2.11
Bio::DB::HTS::Faidx 2.11
Bio::DB::HTS::PileupWrapper 2.11
Bio::DB::HTS::Alignment 2.11
Bio::DB::HTS::ConfigData undef
.
.
.
Bio::DB::HTS::VCF::Iterator 2.11
Bio::DB::HTS::VCF::Row 2.11
我看到有很多需要Bio-DB-HTS软件包的东西(假设当安装Bio :: Perl时它们是成功的安装之一),但现在它提示错误
Can't locate Bio/SeqFeature/Lite.pm in @INC
但是,我从来没有真正安装过Bio:Seq或Bio :: Perl。我确实有一些perl知识,但主要是在python上工作,所以我对如何进行操作有些迷茫。
其他信息
我的cpan将模块安装到
/usr/local/perl
我已经将路径添加到我的环境变量中
export PERL5LIB=/usr/local/perl
编辑的信息(失败的测试和错误),以回应Shawn
@Shawn,其一连串的错误,测试失败和推荐的安装。我可以发布一些前两个错误的示例。我不太确定该怎么看。
推荐的安装
Checking prerequisites...
recommends:
* Algorithm::Munkres is not installed
* Array::Compare is not installed
* Bio::Phylo is not installed
* Convert::Binary::C is not installed
* GD is not installed
* Graph is not installed
* GraphViz is not installed
* HTML::TableExtract is not installed
* Inline::C (0.53) is installed, but we prefer to have 0.67
* PostScript::TextBlock is not installed
* SVG is not installed
* SVG::Graph is not installed
* Set::Scalar is not installed
* Sort::Naturally is not installed
* Spreadsheet::ParseExcel is not installed
* XML::DOM is not installed
* XML::DOM::XPath is not installed
* XML::Parser::PerlSAX is not installed
* XML::SAX::Writer is not installed
* XML::Twig is not installed
* YAML is not installed
Checking optional features...
EntrezGene............disabled
requires:
! Bio::ASN1::EntrezGene is not installed
MySQL Tests...........disabled
requires:
! DBD::mysql is not installed
Pg Tests..............disabled
requires:
! DBD::Pg is not installed
这是测试摘要报告。我没有打印失败测试的整个列表,因为它非常长。但是我能看到的是/LocalDB/SeqFeature_BDB.t是查看详细输出时大多数失败测试的一部分。
Test Summary Report
-------------------
t/LocalDB/Fasta.t (Wstat: 1024 Tests: 109 Failed: 4)
Failed tests: 73, 91, 95, 101
Non-zero exit status: 4
t/LocalDB/Index/Index.t (Wstat: 20224 Tests: 36 Failed: 6)
Failed tests: 12-17
Non-zero exit status: 79
Parse errors: Bad plan. You planned 73 tests but ran 36.
t/LocalDB/Qual.t (Wstat: 1536 Tests: 56 Failed: 6)
Failed tests: 7-9, 49-50, 52
Non-zero exit status: 6
t/LocalDB/SeqFeature_BDB.t (Wstat: 0 Tests: 38 Failed: 4)
Failed tests: 17-19, 24
Parse errors: Bad plan. You planned 116 tests but ran 38.
t/Perl.t (Wstat: 512 Tests: 47 Failed: 16)
Failed tests: 28, 28, 28, 28-29, 29, 29, 29-30, 30, 30
30-31, 31, 31, 31
Non-zero exit status: 2
Parse errors: Tests out of sequence. Found (24) but expected (26)
Tests out of sequence. Found (25) but expected (27)
Tests out of sequence. Found (26) but expected (28)
Tests out of sequence. Found (26) but expected (29)
Tests out of sequence. Found (27) but expected (30)
Displayed the first 5 of 23 TAP syntax errors.
Re-run prove with the -p option to see them all.
t/RemoteDB/BioFetch.t (Wstat: 0 Tests: 83 Failed: 47)
Failed tests: 20-21, 21-22, 22-23, 23-24, 24-25, 25-26
26-27, 27-28, 28-29, 29-30, 30, 30, 30-31
31, 31, 31-32, 32, 32, 32-33, 33, 33, 33-34
34, 34, 34-35, 35, 35, 35-36, 36, 36, 36
Parse errors: Tests out of sequence. Found (4) but expected (6)
Tests out of sequence. Found (6) but expected (7)
Tests out of sequence. Found (7) but expected (8)
Tests out of sequence. Found (5) but expected (9)
Tests out of sequence. Found (6) but expected (10)
Displayed the first 5 of 79 TAP syntax errors.
Re-run prove with the -p option to see them all.
t/RemoteDB/GenBank.t (Wstat: 0 Tests: 658 Failed: 614)
Failed tests: 10-11, 11, 11-12, 12, 12-13, 13, 13-14
14, 14-15, 15, 15-16, 16, 16-17, 17, 17-18
18, 18-19, 19, 19, 19, 19, 19, 19-20, 20
20, 20, 20, 20, 20-21, 21, 21, 21, 21, 21
21-22, 22, 22, 22, 22, 22, 22-23, 23, 23
答案 0 :(得分:2)
感谢所有提供帮助的人,最后我设法弄清楚了。如果有人遇到同样的问题,我将从头到尾解释该过程。
我发布的问题是解决测试失败的问题,以解决如何使用CPAN安装Bio :: Perl的问题。尽管我在安装Bio-DB-HTS时遇到了一些问题(在发布之前已解决),但我将说明在有人遇到相同问题的情况下,我如何也成功进行了安装。
似乎Mac用户倾向于lzma.h标头丢失的问题。如果安装Bio-DB-HTS。我必须修改Bio-DB-HTS / INSTALL.pl文件中的一行,以检查lzma.h文件是否存在。有关说明,请参见下面的“在Mac OSx上安装Bio-DB-HTS”。
解决Bio :: Perl的安装
基本上,我通过重新安装/重新配置CPAN安装解决了该问题。尽管我认为最终的问题是由于我选择手动整理CPAN目录结构时未设置某些环境变量引起的,但我建议让CPAN使用local:lib选项为您完成此操作,因为它将设置或告诉您如何在安装结束时设置环境变量。
我只在下面设置了一个环境变量(PERL5LIB),这可能是我出错的原因。注意!您在下面看到的路径是针对我的系统的。
PATH="/Users/sjamal/perl5/bin${PATH:+:${PATH}}"; export PATH;
PERL5LIB="/Users/sjamal/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB;
PERL_LOCAL_LIB_ROOT="/Users/sjamal/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT;
PERL_MB_OPT="--install_base \"/Users/sjamal/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=/Users/sjamal/perl5"; export PERL_MM_OPT;
如果您已经像我一样对其进行了配置,但是从一开始就需要重新进行安装,则需要删除在安装cpan的用户上创建的CPAN文件夹。
/Users/<USERNAME>/.cpan
rm -rf /Users/<USERNAME>/.cpan
现在,您应该能够像在第一个实例上一样运行cpan命令,并得到有关如何设置安装方式的许多问题的提示,在这里您可以选择“ local:lib” (如果您能够访问sudo,则也可以选择“ sudo”选项)。我根据多个建议安装了cpanm,并且由于它显然提示的问题较少,然后安装了Bio :: Perl。尽管我应该提到安装没有通过测试并拒绝安装,所以我不得不运行force命令来构建Bio :: Perl。
cpan -i App:cpanminus
cpanm --force Bio::Perl
您现在应该已经安装了Bio :: Perl。
在Mac OSx上安装Bio-DB-HTS
lzma库在Mac OSx上已被弃用,但已由XZ库替换,因此,如果您也缺少该文件,则可以使用brew安装XZ。如果您尚未安装brew,可以在https://brew.sh/
中找到如何安装它。brew install xz
现在您将在使用brew安装XZ的位置中有一个lzma.h头文件,在我的情况下为/usr/local/Cellar/xz/5.2.4/include/lzma.h。
git clone https://github.com/Ensembl/Bio-DB-HTS.git
cd Bio-DB-HTS-2.10
vim Bio-DB-HTS/INSTALL.pl
因此,我使用vim更改了行...
-e '/usr/include/lzma.h' or die <<END;
到
-e '/usr/include/lzma.h' **|| '/usr/local/Cellar/xz/5.2.4/include/lzma.h'** or die <<END;
注意!您必须将'/ usr / local / Cellar / xz / 5.2.4 / include / lzma.h'路径更改为刚刚通过brew安装XZ软件包中的lzma.h的位置。但是,我想澄清一下,除了告诉脚本文件确实存在之外,这没有解决任何其他问题。安装脚本将无法使用该文件(如果需要的话),因为安装脚本中没有其他更改。
您现在应该只需运行以下perl脚本即可安装Bio-DB-HTS
cd Bio-DB-HTS-2.10
perl INSTALL.pl
希望有帮助!
Sabri