src/blat/blat.c 1.114
1.114 2009/10/08 18:09:38 kent
Moving repMatch calculations from blat to library so can be shared with gfServer.
Index: src/blat/blat.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/blat/blat.c,v
retrieving revision 1.113
retrieving revision 1.114
diff -b -B -U 4 -r1.113 -r1.114
--- src/blat/blat.c 10 Feb 2009 21:58:55 -0000 1.113
+++ src/blat/blat.c 8 Oct 2009 18:09:38 -0000 1.114
@@ -627,9 +627,9 @@
int main(int argc, char *argv[])
/* Process command line into global variables and call blat. */
{
-boolean dIsProtLike, qIsProtLike;
+boolean tIsProtLike, qIsProtLike;
#ifdef DEBUG
{
char *cmd = "blat hCrea.geno hCrea.mrna foo.psl -t=dnax -q=rnax";
@@ -658,15 +658,15 @@
switch (tType)
{
case gftProt:
case gftDnaX:
- dIsProtLike = TRUE;
+ tIsProtLike = TRUE;
break;
case gftDna:
- dIsProtLike = FALSE;
+ tIsProtLike = FALSE;
break;
default:
- dIsProtLike = FALSE;
+ tIsProtLike = FALSE;
errAbort("Illegal value for 't' parameter");
break;
}
if (optionExists("q"))
@@ -686,13 +686,13 @@
default:
qIsProtLike = FALSE;
break;
}
-if ((dIsProtLike ^ qIsProtLike) != 0)
+if ((tIsProtLike ^ qIsProtLike) != 0)
errAbort("d and q must both be either protein or dna");
/* Set default tile size for protein-based comparisons. */
-if (dIsProtLike)
+if (tIsProtLike)
{
tileSize = 5;
minMatch = 1;
oneOff = FALSE;
@@ -709,9 +709,9 @@
minScore = optionInt("minScore", minScore);
maxGap = optionInt("maxGap", maxGap);
minRepDivergence = optionFloat("minRepDivergence", minRepDivergence);
minIdentity = optionFloat("minIdentity", minIdentity);
-gfCheckTileSize(tileSize, dIsProtLike);
+gfCheckTileSize(tileSize, tIsProtLike);
if (minMatch < 0)
errAbort("minMatch must be at least 1");
if (maxGap > 100)
errAbort("maxGap must be less than 100");
@@ -722,46 +722,9 @@
* to reasonable value that depends on tile size. */
if (optionExists("repMatch"))
repMatch = optionInt("repMatch", repMatch);
else
- {
- if (dIsProtLike)
- {
- if (tileSize == 3)
- repMatch = 600000;
- else if (tileSize == 4)
- repMatch = 30000;
- else if (tileSize == 5)
- repMatch = 1500;
- else if (tileSize == 6)
- repMatch = 75;
- else if (tileSize <= 7)
- repMatch = 10;
- }
- else
- {
- if (tileSize == 15)
- repMatch = 16;
- else if (tileSize == 14)
- repMatch = 32;
- else if (tileSize == 13)
- repMatch = 128;
- else if (tileSize == 12)
- repMatch = 256;
- else if (tileSize == 11)
- repMatch = 4*256;
- else if (tileSize == 10)
- repMatch = 16*256;
- else if (tileSize == 9)
- repMatch = 64*256;
- else if (tileSize == 8)
- repMatch = 256*256;
- else if (tileSize == 7)
- repMatch = 1024*256;
- else if (tileSize == 6)
- repMatch = 4*1024*256;
- }
- }
+ repMatch = gfDefaultRepMatch(tileSize, stepSize, tIsProtLike);
/* Gather last few command line options. */
noHead = optionExists("noHead");
ooc = optionVal("ooc", NULL);