我正在努力让biotools在我的Mac上工作,这样我就可以运行一些使用Bio::DB::Sam的Perl5代码,但是已经被阻止了。
最后,get (删除了一些行):
Running Build test
t/Align/AlignStats.t ................... ok
t/Align/AlignUtil.t .................... ok
t/Align/Graphics.t ..................... skipped: The optional module GD (or dependencies thereof) was not installed
...
t/AlignIO/msf.t ........................ ok
t/AlignIO/nexml.t ...................... skipped: The optional module Bio::Phylo (or dependencies thereof) was not installed
t/AlignIO/nexus.t ...................... ok
...
t/Assembly/ContigSpectrum.t ............ ok
t/Assembly/IO/bowtie.t ................. skipped: The optional module Bio::DB::Sam (or dependencies thereof) was not installed
t/Assembly/IO/sam.t .................... skipped: The optional module Bio::DB::Sam (or dependencies thereof) was not installed
t/Assembly/core.t ...................... ok
t/Cluster/UniGene.t .................... ok 之后,我用以下方法测试:
perl -e "use Bio::DB::Sam;"并得到:
Can't locate Bio/DB/Sam.pm in @INC (you may need to install the Bio::DB::Sam module) (@INC contains: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.2/darwin-thread-multi-2level /Library/Perl/Updates/5.18.2 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.当从GitHub克隆bioperl时(同步到修改73c446c69a77)并试图以这种方式安装时,我得到了相同的结果。
请注意,我已经通过以下方式安装了samtools 0.1.18 (以匹配我们集群上的版本):
后来,我得到了这个
$ which samtools
/Users/gvwilson/debarcer-packages/bin/samtools此构建没有生成“.so”文件,尽管samtools中有一条规则--0.1.18 Makefile看起来像它(可能吗?)应该生产一个。
发布于 2016-03-19 00:46:39
模块Bio::DB::Sam提供绑定到不依赖赫特利布的旧版本的samtools。这一点很重要,因为使用samtools或其他对齐器生成的SAM/BAM文件可能会遇到问题,因为现在大多数工具都使用htslib。
对于构建模块,使用所使用的版本是正确的,但是如果不知道正确的标志,则很难构建。我之前提供了一个解决方案,我将在这里展示一个更好的方法(只需为Perl模块使用包管理器)。
wget http://sourceforge.net/projects/samtools/files/samtools/0.1.18/samtools-0.1.18.tar.bz2
tar xjf samtools-0.1.18.tar.bz2 && cd samtools-0.1.18
make CFLAGS=-fPIC
export SAMTOOLS=`pwd`最后一个命令将允许您安装Perl模块,而无需查找samtools的路径并提示您输入它。注意,在Mac上可能不需要额外的CFLAGS参数,所以先尝试不使用它。它在Linux上是必需的,而且由于模块使用了如此多的内存,所以您很可能只在Linux机器上使用它。现在,安装Perl模块。
cpanm Bio::DB::Sam或者cpan,如果你愿意的话。这将为您提供一个工作的Bio::DB::Sam。我不知道您想要做什么,但我要提到的是,EBI的优秀人员开发了名为Bio::DB::HTS的htslib绑定,该绑定基于林肯斯坦在Bio::DB::Sam模块中的XS代码。这正是您应该使用的内容,因为上面提到的SAMtools版本已经很老了,而且还没有开发出来。不过,这是我的观点,也是一个警告,Bio::DB::Sam没有什么问题。
编辑:
您会发现在不使用"system“Perl的情况下更容易管理Perl,这里有一个解决方案。其他人可能有他们喜欢的方法,但是百酿 (结合cpan减号)会使这种工作更有趣,更少痛苦(而且他们是受欢迎的选择)。这将是我的第一步:设置perlbrew,安装Perl 5.22,然后安装cpan减号。这听起来可能很有挑战性,但只是几个命令而已。与…有关的东西:
curl -L http://install.perlbrew.pl | bash
source ~/perl5/perlbrew/etc/bashrc
perlbrew install perl-5.22.1
perlbrew switch perl-5.22.1
perlbrew install-cpanm应该能起作用。这将为您提供一个优秀的Perl,您的"system“Perl没有提供一些不错的特性。这是一个好主意,因为使用/usr/bin/perl需要sudo,它涉及到可能导致问题的系统库,最近的Apple更改意味着使用根目录/库是完全不稳定的。
发布于 2016-03-24 18:16:37
您需要安装一个额外的(可选)模块来使用samtools。这就是The optional module Bio::DB::Sam信息的意义所在。对于BioPerl的其他部分,您不需要它,所以它不是一个硬依赖项。
对于Bio::DB::Sam,您需要samtools-0.1.17 (该模块根据其文档使用的最新版本)。我下载了源代码并运行了make。有一些警告,但似乎是有效的。从你的问题上看,我不认为你在这里有什么问题。
然后我安装了Bio::DB::Sam
$ cpan Bio::DB::Sam有一些编译器警告,但是模块通过了测试并安装了。cpan命令也处理了依赖关系,因此它也为我安装了BioPerl。
如果需要一些环境变量,可以将它们设置为命令的一次性运行:
$ CFLAGS=... SAMTOOLS=... cpan Bio::DB::Sam请注意,安装Bio::DB::Sam会促使我找到samtools的位置。我将其指向构建目录:
$ cpan5.22.0 Bio::DB::Sam
Running install for module 'Bio::DB::Sam'
Configuring L/LD/LDS/Bio-SamTools-1.43.tar.gz with Build.PL
This module requires samtools 0.1.10 or higher (samtools.sourceforge.net).
Please enter the location of the bam.h and compiled libbam.a files: /Users/brian/Downloads/samtools-0.1.17我敢打赌没有像SES给出的答案这样复杂的东西。你只需要一个可选的模块。Bio::DB::Sam的自述文件指出了一些人们可能会遇到的问题,并提供了一些解决办法,但我没有遇到这些问题,而且我的设置与您的非常接近。
注意,外侨::SamTools是一个Perl包,它安装非Perl,但是它说它安装了0.1.19。也许这也有效,但这不是Bio::DB::Sam在罐头上说的话。
https://stackoverflow.com/questions/36088231
复制相似问题