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
\n"); horizontalLine(); doTopTiles(numMotifs, tn.forCgi, logFile, considerRc); loadAndColorProfiles(tn.forCgi, goodSeq, goodSeqElSize, considerRc); remove(tn.forCgi); fprintf(htmlOut, "\n"); freeSeqList(&goodSeq); } void doRandomTest(boolean premade, boolean considerRc) /* Generate tables for scores on random sequences. */