3de452af33eb095927dc7305001f950b81f05693
hiram
  Wed Sep 9 16:13:30 2026 -0700
adjust trfBig to use 500 kb windows for calculation and corresponding script from claude to reassembly broken annotations at this smaller window size refs #38321

diff --git src/hg/utils/automation/doSimpleRepeat.pl src/hg/utils/automation/doSimpleRepeat.pl
index 6677cc0159f..2f896d52671 100755
--- src/hg/utils/automation/doSimpleRepeat.pl
+++ src/hg/utils/automation/doSimpleRepeat.pl
@@ -5,30 +5,31 @@
 
 # $Id: doSimpleRepeat.pl,v 1.5 2009/06/08 18:38:58 hiram Exp $
 
 use Getopt::Long;
 use warnings;
 use strict;
 use Carp;
 use FindBin qw($Bin);
 use lib "$Bin";
 use HgAutomate;
 use HgRemoteScript;
 use HgStepManager;
 
 # Hardcoded (for now):
 my $chunkSize = 50000000;	# will be readjusted if seqCount > 100000
+my $trfChunkSize = 500000;	# new argument to trfBig Sept 2026
 my $singleRunSize = 200000000;
 my $clusterBin = qw(/cluster/bin/$MACHTYPE);
 
 # Option variable names, both common and peculiar to this script:
 use vars @HgAutomate::commonOptionVars;
 use vars @HgStepManager::optionVars;
 use vars qw/
     $opt_buildDir
     $opt_unmaskedSeq
     $opt_trf409
     /;
 
 # Specify the steps supported with -continue / -stop:
 my $stepper = new HgStepManager(
     [ { name => 'trf',     func => \&doTrf },
@@ -195,31 +196,31 @@
 
 # Use local disk for output, and move the final result to \$finalOut
 # when done, to minimize I/O.
 set tmpDir = `mktemp -d -p \$TMPDIR doSimpleRepeat.cluster.XXXXXX`
 pushd \$tmpDir
 
 foreach spec (`cat \$inLst`)
   # Remove path and .2bit filename to get just the seq:start-end spec:
   set base = `echo \$spec | sed -r -e 's/^[^:]+://'`
 
   # If \$spec is the whole sequence, twoBitToFa removes the :start-end part,
   # which causes liftUp to barf later.  So tweak the header back to
   # seq:start-end for liftUp's sake:
   twoBitToFa \$spec stdout \\
   | sed -e "s/^>.*/>\$base/" \\
-  | $clusterBin/trfBig $trf409Option -trf=$clusterBin/$trfCmd \\
+  | $clusterBin/trfBig -chunkMaxSize=$trfChunkSize $trf409Option -trf=$clusterBin/$trfCmd \\
       stdin /dev/null -bedAt=\$base.bed -tempDir=\$tmpDir
 end
 
 # Due to the large chunk size, .lft files can have thousands of lines.
 # Even though the liftUp code does &lineFileClose, somehow we still
 # run out of filehandles.  So limit the size of liftSpecs:
 split -a 3 -d -l 500 \$inLft SplitLft.
 
 # Lift up:
 foreach splitLft (SplitLft.*)
   set bedFiles = `awk '{print \$2 ".bed"};' \$splitLft`
   endsInLf -zeroOk \$bedFiles
   set lineCount=`cat \$bedFiles | wc -l`
   if (\$lineCount > 0) then
     cat \$bedFiles \\
@@ -324,31 +325,31 @@
   setenv TMPDIR "/data/tmp"
 else if ( -d "/scratch/tmp" ) then
   setenv TMPDIR "/scratch/tmp"
 else
   set tmpSz = `df --output=avail -k /tmp | tail -1`
   set shmSz = `df --output=avail -k /dev/shm | tail -1`
   if ( "\${shmSz}" > "\${tmpSz}" ) then
      mkdir -p /dev/shm/tmp
      chmod 777 /dev/shm/tmp
      setenv TMPDIR "/dev/shm/tmp"
   else
      setenv TMPDIR "/tmp"
   endif
 endif
 twoBitToFa $unmaskedSeq stdout \\
-| $clusterBin/trfBig $trf409Option -trf=$clusterBin/$trfCmd \\
+| $clusterBin/trfBig -chunkMaxSize=$trfChunkSize $trf409Option -trf=$clusterBin/$trfCmd \\
       stdin /dev/null -bedAt=simpleRepeat.bed -tempDir=\$TMPDIR
 _EOF_
   );
   $bossScript->execute();
 } # doSingle
 
 sub doTrf {
   if ($useCluster) {
     &doCluster();
   } else {
     &doSingle();
   }
 } # doTrf