include/semiGappedScoring.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int4 semiGappedScoring_score (struct ungappedExtension *ungappedExtension, struct PSSMatrix PSSMatrix, int4 subjectSize, unsigned char *subject, int4 dropoff)
void semiGappedScoring_free ()


Function Documentation

void semiGappedScoring_free (  ) 

Definition at line 1147 of file semiGappedScoring.c.

References semiGappedScoring_bestRow, and semiGappedScoring_insertQrow.

Referenced by main().

01148 {
01149     free(semiGappedScoring_bestRow);
01150     free(semiGappedScoring_insertQrow);
01151 }

Here is the caller graph for this function:

int4 semiGappedScoring_score ( struct ungappedExtension ungappedExtension,
struct PSSMatrix  PSSMatrix,
int4  subjectSize,
unsigned char *  subject,
int4  dropoff 
)

Definition at line 24 of file semiGappedScoring.c.

References dpResults::best, dpResults::bestScore, blast_numSemiGapped, ungappedExtension::end, int4, PSSMatrix::length, PSSMatrix::matrix, oldSemiGappedScoring_score(), parameters_restrictedInsertionScoring, parameters_semiGappedDropoffIncrease, PSSMatrix_chop(), coordinate::queryOffset, ungappedExtension::seed, semiGappedScoring_dpAfterSeed(), semiGappedScoring_dpBeforeSeed(), ungappedExtension::start, PSSMatrix::strandLength, and coordinate::subjectOffset.

Referenced by alignments_findGoodAlignments().

00026 {
00027     struct coordinate seed;
00028     unsigned char *choppedSubject;
00029     struct PSSMatrix choppedPSSMatrix;
00030     int4 choppedSubjectSize;
00031     struct dpResults beforeDpResults, afterDpResults;
00032     int4 strandOffset = 0;
00033 
00034     // Increment counter number of HSP's semi-gapped
00035         blast_numSemiGapped++;
00036 
00037     // Use old code if restricted insertion has been disabled
00038     if (!parameters_restrictedInsertionScoring)
00039     {
00040         return oldSemiGappedScoring_score(ungappedExtension, PSSMatrix, subjectSize, subject, dropoff);
00041     }
00042 
00043     // Perform dynamic programming for points before the seed
00044     seed = ungappedExtension->seed;
00045     if (seed.queryOffset > PSSMatrix.strandLength)
00046     {
00047             // If query position is in the second strand, remove first strand from PSSM
00048         strandOffset = PSSMatrix.strandLength;
00049                 seed.queryOffset -= PSSMatrix.strandLength;
00050                 PSSMatrix = PSSMatrix_chop(PSSMatrix, PSSMatrix.strandLength);
00051     }
00052     else
00053     {
00054         // Otherwise remove second strand
00055         PSSMatrix.length = PSSMatrix.strandLength;
00056     }
00057 
00058     beforeDpResults = semiGappedScoring_dpBeforeSeed(subject, PSSMatrix,
00059                     seed, dropoff + parameters_semiGappedDropoffIncrease);
00060 
00061     // Chop the start off the query and subject so they begin at the seed
00062     choppedPSSMatrix = PSSMatrix_chop(PSSMatrix, seed.queryOffset);
00063     choppedSubject = subject + seed.subjectOffset;
00064     choppedSubjectSize = subjectSize - seed.subjectOffset;
00065 
00066     // Perform dynamic programming for points after the seed
00067     afterDpResults = semiGappedScoring_dpAfterSeed(choppedSubject, choppedPSSMatrix,
00068                     dropoff + parameters_semiGappedDropoffIncrease, choppedSubjectSize);
00069 
00070     // Re-adjust result change due to chopping subject/query and strand adjustment
00071     afterDpResults.best.queryOffset += seed.queryOffset + strandOffset;
00072     afterDpResults.best.subjectOffset += seed.subjectOffset;
00073     beforeDpResults.best.queryOffset += strandOffset;
00074 
00075     // Associate best scoring start and end points with the ungapped extension
00076     ungappedExtension->start = beforeDpResults.best;
00077     ungappedExtension->end = afterDpResults.best;
00078 
00079 //    if (dloc == 88197331)
00080 //        printf("semiGapped[%d,%d,%d]\n", beforeDpResults.bestScore, afterDpResults.bestScore,
00081 //        choppedPSSMatrix.matrix[0][choppedSubject[0]]);
00082 
00083     // Determine score by combining score from the two traces, and the match score at
00084     // the seed position
00085     return beforeDpResults.bestScore + afterDpResults.bestScore +
00086            choppedPSSMatrix.matrix[0][choppedSubject[0]];
00087 }

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Wed Dec 19 20:52:03 2007 for fsa-blast by  doxygen 1.5.2