697262435efc9a4bcbbdd4958e1b0551bafaf423 galt Mon Jul 18 22:41:37 2011 -0700 fixed segfault when -fine -minIdentity=0 -minScore=0 diff --git src/jkOwnLib/gfOut.c src/jkOwnLib/gfOut.c index 4846a35..a2841aa 100644 --- src/jkOwnLib/gfOut.c +++ src/jkOwnLib/gfOut.c @@ -118,30 +118,32 @@ nInsertBaseCount += nGap; } if (hGap != 0) { ++hInsertCount; hInsertBaseCount += hGap; } } } /* See if it looks good enough to output, and output. */ /* if (score >= minMatch) Moved to higher level */ { int gaps = nInsertCount + (stringency == ffCdna ? 0: hInsertCount); + if ((matchCount + repMatch + mismatchCount) > 0) + { int id = roundingScale(1000, matchCount + repMatch - 2*gaps, matchCount + repMatch + mismatchCount); if (id >= minIdentity) { if (isRc) { int temp; int oSize = qSeq->size; temp = nStart; nStart = oSize - nEnd; nEnd = oSize - temp; } if (targetIsRc) { int temp; temp = hStart; @@ -178,30 +180,31 @@ for (ff = ali; ff != NULL; ff = ff->right) { mustWrite(f, ff->hStart, ff->hEnd - ff->hStart); fputc(',', f); } } fprintf(f, "\n"); if (ferror(f)) { perror(""); errAbort("Write error to .psl"); } } } } +} static void pslOut(char *chromName, int chromSize, int chromOffset, struct ffAli *ali, struct dnaSeq *tSeq, struct hash *t3Hash, struct dnaSeq *qSeq, boolean qIsRc, boolean tIsRc, enum ffStringency stringency, int minMatch, struct gfOutput *out) /* Save psl for more complex alignments. */ { struct pslxData *outForm = out->data; savePslx(chromName, chromSize, chromOffset, ali, tSeq, qSeq, qIsRc, stringency, minMatch, outForm->f, t3Hash, out->reportTargetStrand, tIsRc, out->maskHash, out->minGood, out->qIsProt, out->tIsProt, outForm->saveSeq); }