cbb1262183e62300d8b02b003f1ff0b0e602f8ba
hiram
  Mon Jul 9 09:31:59 2018 -0700
allow maximum sequence count to be defined in hg.conf hgBlat.maxSequenceCount no redmine

diff --git src/hg/hgBlat/hgBlat.c src/hg/hgBlat/hgBlat.c
index 86ccfb8..3c5e852 100644
--- src/hg/hgBlat/hgBlat.c
+++ src/hg/hgBlat/hgBlat.c
@@ -639,30 +639,34 @@
 
 /* If feeling lucky only do the first one. */
 if(feelingLucky && seqList != NULL)
     {
     seqList->next = NULL;
     }
 
 /* Figure out size allowed. */
 maxSingleSize = (isTx ? 10000 : 75000);
 maxTotalSize = maxSingleSize * 2.5;
 #ifdef LOWELAB
 maxSeqCount = 200;
 #else
 maxSeqCount = 25;
 #endif
+char *optionMaxSeqCount = cfgOptionDefault("hgBlat.maxSequenceCount", NULL);
+
+if (isNotEmpty(optionMaxSeqCount))
+   maxSeqCount = sqlSigned(optionMaxSeqCount);
 
 /* Create temporary file to store sequence. */
 trashDirFile(&faTn, "hgSs", "hgSs", ".fa");
 faWriteAll(faTn.forCgi, seqList);
 
 /* Create a temporary .psl file with the alignments against genome. */
 trashDirFile(&pslTn, "hgSs", "hgSs", ".pslx");
 f = mustOpen(pslTn.forCgi, "w");
 gvo = gfOutputPsl(0, qIsProt, FALSE, f, FALSE, TRUE);
 serve = findServer(db, isTx);
 /* Write header for extended (possibly protein) psl file. */
 if (isTx)
     {
     if (isTxTx)
         {
@@ -689,32 +693,32 @@
 else if (qType == gftDnaX)
     {
     minSingleSize = 36;
     }
 
 
 /* Loop through each sequence. */
 for (seq = seqList; seq != NULL; seq = seq->next)
     {
     printf(" "); fflush(stdout);  /* prevent apache cgi timeout by outputting something */
     oneSize = realSeqSize(seq, !isTx);
     // Impose half the usual bot delay per sequence
 	hgBotDelayFrac(0.5);
     if (++seqCount > maxSeqCount)
         {
-	warn("More than 25 input sequences, stopping at %s.",
-	    seq->name);
+	warn("More than %d input sequences, stopping at %s<br>(see also: cgi-bin/hg.conf hgBlat.maxSequenceCount setting).",
+	    maxSeqCount, seq->name);
 	break;
 	}
     if (oneSize > maxSingleSize)
 	{
 	warn("Sequence %s is %d letters long (max is %d), skipping",
 	    seq->name, oneSize, maxSingleSize);
 	continue;
 	}
     if (oneSize < minSingleSize)
         {
 	warn("Warning: Sequence %s is only %d letters long (%d is the recommended minimum)", 
 		seq->name, oneSize, minSingleSize);
 	// we could use "continue;" here to actually enforce skipping, 
 	// but let's give the short sequence a chance, it might work.
 	// minimum possible length = tileSize+stepSize, so mpl=16 for dna stepSize=5, mpl=10 for protein.