4165c71e12cef21e41d7042b9f8f1ba71d9cd910
hiram
  Fri Oct 18 13:29:11 2024 -0700
eliminate direct use of /scratch/tmp and instead use appropriate tmpDir function no redmine

diff --git src/hg/utils/automation/doWindowMasker.pl src/hg/utils/automation/doWindowMasker.pl
index 56669e3..1b8d577 100755
--- src/hg/utils/automation/doWindowMasker.pl
+++ src/hg/utils/automation/doWindowMasker.pl
@@ -104,70 +104,72 @@
 }
 
 
 #########################################################################
 # * step: count [workhorse]
 sub doCount {
   my $runDir = "$buildDir";
   &HgAutomate::checkCleanSlate('count', 'mask', "$runDir/windowmasker.counts");
   &HgAutomate::mustMkdir($runDir);
 
   my $whatItDoes = "It does WindowMasker counts step.";
   my $workhorse = &HgAutomate::chooseWorkhorse();
   my $bossScript = new HgRemoteScript("$runDir/doCount.csh", $workhorse,
 				      $runDir, $whatItDoes);
 
+  my $tmpDir = &HgAutomate::tmpDir();
   $bossScript->add(<<_EOF_
 set windowMaskerDir = /cluster/bin/\$MACHTYPE
 set windowMasker = \$windowMaskerDir/windowmasker
 set fa = $db.fa
-set tmpDir = `mktemp -d -p /scratch/tmp doWindowMasker.XXXXXX`
+set tmpDir = `mktemp -d -p $tmpDir doWindowMasker.XXXXXX`
 chmod 775 \$tmpDir
 set inputTwoBit = $unmaskedSeq
 pushd \$tmpDir
 twoBitToFa \$inputTwoBit \$fa
 \$windowMasker -mk_counts true -input \$fa -output windowmasker.counts
 popd
 cp \$tmpDir/windowmasker.counts .
 rm -rf \$tmpDir
 _EOF_
   );
   $bossScript->execute();
 } # doCount
 
 
 #########################################################################
 # * step: mask [workhorse]
 sub doMask {
   printf STDERR "# doMask: obsolete step, no longer needed\n";
   return 0;
 } # doMask
 
 #########################################################################
 # * step: sdust [workhorse]
 sub doSdust {
   my $runDir = "$buildDir";
   &HgAutomate::checkExistsUnlessDebug('mask', 'sdust', "$runDir/windowmasker.counts");
   my $whatItDoes = "It does WindowMasker masking step with -sdust true.";
   my $workhorse = &HgAutomate::chooseWorkhorse();
   my $bossScript = new HgRemoteScript("$runDir/doSdust.csh", $workhorse,
 				      $runDir, $whatItDoes);
+  my $tmpDir = &HgAutomate::tmpDir();
   $bossScript->add(<<_EOF_
 set windowMaskerDir = /cluster/bin/\$MACHTYPE
 set windowMasker = \$windowMaskerDir/windowmasker
 set fa = $db.fa
-set tmpDir = `mktemp -d -p /scratch/tmp doWindowMasker.XXXXXX`
+set tmpDir = `mktemp -d -p $tmpDir doWindowMasker.XXXXXX`
 chmod 775 \$tmpDir
 set inputTwoBit = $unmaskedSeq
 cp windowmasker.counts \$tmpDir
 pushd \$tmpDir
 twoBitToFa \$inputTwoBit \$fa
 \$windowMasker -ustat windowmasker.counts -sdust true -input \$fa -output windowmasker.intervals
 perl -wpe \'if \(s\/^\>lcl\\\|\(\.\*\)\\n\$\/\/\) { \$chr = \$1\; } \\
    if \(\/^\(\\d+\) \- \(\\d+\)\/\) { \\
    \$s=\$1\; \$e=\$2+1\; s\/\(\\d+\) \- \(\\d+\)\/\$chr\\t\$s\\t\$e\/\; \\
    }\' windowmasker.intervals > windowmasker.sdust.bed
 popd
 cp \$tmpDir/windowmasker.sdust.bed .
 rm -rf \$tmpDir
 _EOF_
   );