a7d69cfa82b5c09dddad7f5ccd794b04d009ba0e kent Thu Jul 17 15:15:29 2014 -0700 Making Improbizer take more sequences, and warn when you exceed limit. diff --git src/ameme/ameme.c src/ameme/ameme.c index 8e3451b..25faf3a 100644 --- src/ameme/ameme.c +++ src/ameme/ameme.c @@ -184,31 +184,31 @@ double seqElSize = goodSeqElSize; double rcFactor = (considerRc ? 2.0 : 1.0); double acc; if (startScanLines > goodSeqListSize) startScanLines = goodSeqListSize; acc = ((rcFactor * numMotifs * startScanLines * maxOcc * seqElSize * seqElSize * goodSeqListSize) /1000000 + 3)/(machineSpeed() * 60); acc += 30*convergeTime(considerRc); return acc; } double calcApproximateTime(boolean considerRc) /* Get an estimated time in minutes. */ { double time, t; -double convMult = 0.33; /* Adjust for server speed here. */ +double convMult = 0.15; /* Adjust for server speed here. */ time = findSeedsFragTime(considerRc, defaultTileSize); t = findSeedsScanTime(considerRc); if (t < time) time = t; return time*convMult; } /* Frequency tables for the null model (background). */ double mark0[5] = {1.0, 0.25, 0.25, 0.25, 0.25}; /* The probability of finding a base in sequence. */ /* N T C A G */ double *freq = &mark0[1]; /* Frequency table that allows -1 indices for N's */ @@ -2142,49 +2142,51 @@ } freeProfile(&rcProf); freeProfileList(&profList); freeProfileList(&newList); } fclose(f); } void pasteToFa(char *varName, char **retFileName, int *retSeqCount, int *retLongestLen) /* Returns a (temporary) fa file made from the contents of the CGI variable * varName. */ { static struct tempName tn; FILE *f; -char *lines[1024]; +char *lines[1024*4 + 1]; int lineCount; char *rawGood; char *cleanSeq; int i; int lineIx = 0; char *goodName = NULL; int seqCount = 0; int longestLen = 0; int oneLen = 0; *retFileName = NULL; *retSeqCount = 0; rawGood = cgiString(varName); makeTempName(&tn, "imp", ".fa"); goodName = cloneString(tn.forCgi); lineCount = chopString(rawGood, "\r\n", lines, ArraySize(lines)); if (lineCount <= 0) return; +if (lineCount == ArraySize(lines)) + errAbort("Too many sequences for program to handle. Maximum is %d", (int)ArraySize(lines) - 1); f = mustOpen(goodName, "w"); if (lines[0][0] == '>') /* Looks like an FA file - just copy it to file. */ { for (i=0; i<lineCount; ++i) { if (lines[i][0] == '>') { ++seqCount; oneLen = 0; } else { oneLen += strlen(lines[i])-1; if (oneLen > longestLen) longestLen = oneLen; @@ -2680,31 +2682,31 @@ "per sequence; %s align; ", (useLocation ? "use" : "ignore"), (considerRc ? "" : "don't "), maxOcc, (leftAlign ? "left" : "right") ); fprintf(htmlOut, "restrain expansionist tendencies %f; number of sequences in initial scan %d; ", constrainer, startScanLimit); backgroundName = bgSource; if (backgroundName == NULL) backgroundName = badName; if (backgroundName == NULL) backgroundName = "same as foreground"; fprintf(htmlOut, "background model %s; background data %s;</P>", (nullModelCgiName == NULL ? "Markov 0" : nullModelCgiName), backgroundName); approxTime = calcApproximateTime(considerRc); -progress("This run would take about %2.2f minutes on a lightly loaded vintage 2003 web server.", +progress("This run would take about %2.2f minutes on a lightly loaded vintage 2010 web server.", approxTime); fprintf(htmlOut, "<TT><PRE>\n"); horizontalLine(); doTopTiles(numMotifs, tn.forCgi, logFile, considerRc); loadAndColorProfiles(tn.forCgi, goodSeq, goodSeqElSize, considerRc); remove(tn.forCgi); fprintf(htmlOut, "</TT></PRE>\n"); freeSeqList(&goodSeq); } void doRandomTest(boolean premade, boolean considerRc) /* Generate tables for scores on random sequences. */