我在Centos7环境中使用Bio :: DB :: Sam,使用版本0.1.17的samtools。我正在使用此过程来执行我的安装:
wget http://sourceforge.net/projects/samtools/files/samtools/0.1.17/samtools-0.1.17.tar.bz2
tar xjf samtools-0.1.17.tar.bz2 && cd samtools-0.1.17
make CFLAGS=-fPIC
export SAMTOOLS=`pwd`
cpanm Bio::DB::Sam
我发现here(注意我改变了samtools的版本)
崩溃间歇性地发生,有时在相同的输入文件上。我的一般程序如下:
的Perl:
my $sortbam = align_and_sort_and_index($reads_file); # steps 1 and 2
my @all_gene_ids = qw(gene_id1 gene_id2 gene_id3); # really lots more
for (my $worker=0; $worker <= $n_threads; $worker++) {
my $pid = fork;
die "fork error: $!" unless defined $pid;
next if $pid; # parent
my @gene_ids = get_unique_subset(@all_gene_ids, $worker);
my $sam = Bio::DB::Sam->new(-bam=>$sortbam, -fasta=>$ampl_seqfile, -autoindex=>0);
foreach my $gene_id (@gene_ids) {
# THIS NEXT LINE IS THE ONE THAT SEGFAULTS (SOMETIMES):
my @alignments = $sam->get_features_by_location(-seq_id => $gene_id);
# do something interesting with @alignments...
}
exit;
}
while ((my $pid=wait()) != -1) {
print "reaped $pid\n";
}
迄今为止,我尝试过以下方法:
任何和所有建议都将不胜感激。谢谢!