Commit d6e67f01 authored by Matthieu Muffato's avatar Matthieu Muffato
Browse files

Pulling in Roy's bug-fixes

- always write the sequence to the current seqio - fix for creating lots of empty output files
- fix warning "Use of uninitialized value in subroutine entry"
parents e56909c5 2b491cd1
......@@ -128,14 +128,14 @@ sub write_output {
my $chunk_size = 0; # number of sequences in the current chunk
my $chunk_name = $output_prefix.$chunk_number.$output_suffix;
my $chunk_seqio = Bio::SeqIO->new(-file => '>'.$chunk_name, -format => 'fasta');
while (my $seq_object = $input_seqio->next_seq) {
$chunk_seqio->write_seq( $seq_object );
if((my $seq_length = $seq_object->length()) + $chunk_length <= $max_chunk_length) {
# add to the current chunk:
$chunk_seqio->write_seq( $seq_object );
$chunk_length += $seq_length;
$chunk_size += 1;
} else {
# dataflow the current chunk:
......@@ -163,6 +163,8 @@ sub write_output {
'chunk_length' => $chunk_length,
'chunk_size' => $chunk_size
}, 2);
} else {
unlink $chunk_name unless (stat($chunk_name))[7];
}
}
......
=pod
=head1 NAME
......@@ -84,7 +85,7 @@ sub stringify {
local $Data::Dumper::Quotekeys = 1; # conserve some space
local $Data::Dumper::Useqq = 1; # escape the \n and \t correctly
local $Data::Dumper::Pair = ' => '; # make sure we always produce Perl-parsable structures, no matter what is set externally
local $Data::Dumper::Maxdepth = undef; # make sure nobody can mess up stringification by setting a lower Maxdepth
local $Data::Dumper::Maxdepth = 0; # make sure nobody can mess up stringification by setting a lower Maxdepth
return Dumper($structure);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment