Core local alignment algorithm.
175 int queryMatchCount = 0;
183 while (queryMatchCount < queryLength)
185 if (r1 == searchSize - 1)
190 if (queryLength - q1 < tupleSize)
200 if ((pos =
MatchTuple(query+q1, queryLength-q1, reference, searchStartIndex + r1, searchSize - r1, matchedLen, mismatch))
232 queryMatchCount = q1;
242 for (
int i = 1; i < queryLength - q1 - tupleSize; i++)
247 if (searchStartIndex + r1 >= reference.getNumberBases())
250 queryLength - q1 -i ,
252 searchStartIndex + r1,
258 if (matchPosition < 0)
259 matchPosition = pos + q1 + i ;
261 queryMatchCount += i;
266 r1 += pos + tupleSize;
270 while (searchStartIndex + r1 < reference.getNumberBases()
271 && query[q1]==reference[searchStartIndex + r1]
277 if (q1 < queryLength)
280 queryMatchCount = q1;
285 queryMatchCount = queryLength ;
insertion to the reference (the query sequence contains bases that have no corresponding base in the ...
void Add(Operation operation, int count)
Append the specified operation with the specified count to this object.
void clear()
Clear this object so that it has no Cigar Operations.
int MatchTuple(const QueryType query, const int queryLength, const ReferenceType reference, const ReferenceIndex searchStartIndex, const int searchSize, int &matchedLength, int &mismatch)
Match 'query' to the 'reference' from 'searchStartIndex' up to 'searchSize', store matched length to ...
mismatch operation. Associated with CIGAR Operation "M"
Soft clip on the read (clipped sequence present in the query sequence, but not in reference)...
match/mismatch operation. Associated with CIGAR Operation "M"
deletion from the reference (the reference contains bases that have no corresponding base in the quer...