Commit 2c545d12 authored by Matthieu Muffato's avatar Matthieu Muffato
Browse files

bugfix: chunk_length and chunk_size must be updated at the same time the...

bugfix: chunk_length and chunk_size must be updated at the same time the sequences are written (thank you @mn1 !)
parent ce1cf0ec
......@@ -147,12 +147,10 @@ sub write_output {
while (my $seq_object = $input_seqio->next_seq) {
$chunk_seqio->write_seq( $seq_object );
$chunk_length += $seq_object->length();
$chunk_size += 1;
if((my $seq_length = $seq_object->length()) + $chunk_length <= $max_chunk_length) {
$chunk_length += $seq_length;
$chunk_size += 1;
} else {
if ($chunk_length > $max_chunk_length) {
# dataflow the current chunk:
$self->dataflow_output_id( {
......
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