Skip to content

Commit

Permalink
Merge pull request #258 from andrewjpage/div_zero_split_genes
Browse files Browse the repository at this point in the history
catch divide  by zero error
  • Loading branch information
andrewjpage authored Jul 6, 2016
2 parents 8db53d2 + 1c0a9a5 commit a25e378
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dist.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = Bio-Roary
version = 3.6.3
version = 3.6.4
author = Andrew J. Page <[email protected]>
license = GPL_3
copyright_holder = Wellcome Trust Sanger Institute
Expand Down
4 changes: 4 additions & 0 deletions lib/Bio/Roary/SplitGroups.pm
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,10 @@ sub _shared_cgn_score {
next unless(defined($input_group));
$total_shared++ if($cgn2->{$input_group});
}
if( (scalar @{ $cgn1 }) == 0)
{
return 0;
}
my $score = $total_shared/scalar @{ $cgn1 };
return $score;
}
Expand Down

0 comments on commit a25e378

Please sign in to comment.