69bd7a8ab744d23ab1e364f1bdbcde1add08a6cf
hiram
  Thu Nov 30 14:42:50 2023 -0800
do not use windowMasker when it claims to have masked everything refs #29545

diff --git src/hg/utils/automation/doAssemblyHub.pl src/hg/utils/automation/doAssemblyHub.pl
index 22f5794..0c6090b 100755
--- src/hg/utils/automation/doAssemblyHub.pl
+++ src/hg/utils/automation/doAssemblyHub.pl
@@ -1510,30 +1510,32 @@
       printf STDERR "ERROR: simpleRepeat step not completed\n";
       printf STDERR "can not find: $buildDir/trackData/simpleRepeat/doCleanup.csh\n";
       $goNoGo = 1;
   }
   if ($goNoGo) {
       printf STDERR "ERROR: must complete repeatMasker, windowMasker and simpleRepeat before addMask\n";
       exit 255;
   }
   &HgAutomate::mustMkdir($runDir);
 
   my $whatItDoes = "add together (windowMasker or repeatMasker) and trf/simpleRepeats to construct masked 2bit file";
   my $bossScript = newBash HgRemoteScript("$runDir/doAddMask.bash",
                     $workhorse, $runDir, $whatItDoes);
 
   my $wmMasked=`grep "masked total" $buildDir/trackData/windowMasker/faSize.$defaultName.cleanWMSdust.txt | awk '{print \$1}' | sed -e 's/%//;'`;
+  chomp $wmMasked;
+  $wmMasked = 0 if ($wmMasked > 98);
   my $rmMasked = 0;
   if (! $noRmsk) {
     $rmMasked=`grep "masked total" $buildDir/trackData/repeatMasker/faSize.rmsk.txt | awk '{print \$1}' | sed -e 's/%//;'`;
   }
 
   my $src2BitToMask = "../repeatMasker/$defaultName.rmsk.2bit";
   if ($noRmsk || ($wmMasked > $rmMasked)) {
     $src2BitToMask = "../windowMasker/$defaultName.cleanWMSdust.2bit";
   }
 
   my $accessionId = $defaultName;
   if ($accessionId =~ m/^GC[AF]_/) {
      my @a = split('_', $defaultName);
      $accessionId = sprintf("%s_%s", $a[0], $a[1]);
   }