Skip to content

Commit

Permalink
Check for implausible genome size, and fail if so.
Browse files Browse the repository at this point in the history
  • Loading branch information
brianwalenz committed Aug 26, 2016
1 parent 72c709e commit 5629db4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/pipelines/canu/Defaults.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,20 @@ sub checkParameters () {
# Check for inconsistent parameters
#

# Genome size isn't properly decoded until later, but we want to fail quickly. So, just test if
# a unitless number is supplied, and if that number is tiny.

{
my $gs = getGlobal("genomeSize");

if (($gs =~ m/^(\d+)$/) ||
($gs =~ m/^(\d+\.\d+)$/)) {
if ($gs < 1000) {
addCommandLineError("ERROR: Implausibly small genome size $gs. Check units!\n");
}
}
}

foreach my $var ("corOvlErrorRate", "obtOvlErrorRate", "utgOvlErrorRate", "corErrorRate", "cnsErrorRate", "obtErrorRate") {
if (!defined(getGlobal($var))) {
addCommandLineError("ERROR: Invalid '$var' specified; must be set\n");
Expand Down

0 comments on commit 5629db4

Please sign in to comment.