When aligning, it is now quickly checked whether the sequences are
identical using their indexes
This commit is contained in:
@ -95,12 +95,26 @@ int obi_align_one_column(Obiview_p seq_view, OBIDMS_column_p seq_column,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// kmer filter
|
// Check if the sequences are identical in a quick way (same index in the same indexer)
|
||||||
align_filters(ktable, blob1, blob2, i, j, threshold, normalize, reference, similarity_mode, &score, &lcs_min);
|
if (obi_get_index_with_elt_idx_and_col_p_in_view(seq_view, seq_column, i, 0) == obi_get_index_with_elt_idx_and_col_p_in_view(seq_view, seq_column, j, 0))
|
||||||
|
{
|
||||||
|
if (similarity_mode && normalize)
|
||||||
|
score = 1.0;
|
||||||
|
else if (!similarity_mode)
|
||||||
|
score = 0.0;
|
||||||
|
else
|
||||||
|
score = blob1->length_decoded_value;
|
||||||
|
}
|
||||||
|
|
||||||
// Compute alignment score
|
else // the sequences aren't identical
|
||||||
if ((threshold == 0) || (score == -1.0)) // no threshold or filter passed, and sequences not identical: align
|
{
|
||||||
score = obiblob_sse_banded_lcs_align(blob1, blob2, threshold, normalize, reference, similarity_mode);
|
// kmer filter
|
||||||
|
align_filters(ktable, blob1, blob2, i, j, threshold, normalize, reference, similarity_mode, &score, &lcs_min, false);
|
||||||
|
|
||||||
|
// Compute alignment score
|
||||||
|
if ((threshold == 0) || (score == -1.0)) // no threshold, or filter passed: align
|
||||||
|
score = obiblob_sse_banded_lcs_align(blob1, blob2, threshold, normalize, reference, similarity_mode);
|
||||||
|
}
|
||||||
|
|
||||||
if ((score >= 0) && (((normalize || similarity_mode) && (score >= threshold)) || ((!similarity_mode && !normalize) && (score <= threshold))))
|
if ((score >= 0) && (((normalize || similarity_mode) && (score >= threshold)) || ((!similarity_mode && !normalize) && (score <= threshold))))
|
||||||
{ // Print result
|
{ // Print result
|
||||||
|
Reference in New Issue
Block a user