Skip to content

Commit

Permalink
Fix changing number of fields by SeqFilter
Browse files Browse the repository at this point in the history
Fixes #121

The number of fields in SeqFilter output might differ, the program now extracts the second and the last field. Therefore, it is guaranteed to work with a variable field number.
  • Loading branch information
greatfireball authored Feb 7, 2018
1 parent a15e189 commit 5983ae3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bin/proovread
Original file line number Diff line number Diff line change
Expand Up @@ -1708,14 +1708,15 @@ sub correct_sr_mt{
$VB->hline;
$VB->verbose($cmd);
my $re = qx($cmd);
my ($bpt, $bpN) = (split(/\s/, $re))[1,6];
# extract the second field (total number of nucleotids) and the last field (number of N positions)
my ($bpt, $bpN) = (split(/\s/, $re))[1,-1];
$VB->hline;

$V->exit("SeqFilter failed to mask $fq_file: $?\n") if $?;

my $bpN_frac = $bpN/$bpt;
$VB->nline;
$VS->verbose(sprintf "Masked : %0.1f%%", $bpN/$bpt*100);
$VS->verbose(sprintf "Masked : %0.1f%%", $bpN_frac*100);

return wantarray ? (\@ref_idxs, $bpN_frac) : \@ref_idxs; # wantarray guarantees backward compatibility
}
Expand Down

0 comments on commit 5983ae3

Please sign in to comment.