When aligning, it is now quickly checked whether the sequences are

identical using their indexes
This commit is contained in:
Celine Mercier
2016-11-28 11:39:29 +01:00
parent 8ce6f6c80b
commit 5fb025f310

View File

@ -95,12 +95,26 @@ int obi_align_one_column(Obiview_p seq_view, OBIDMS_column_p seq_column,
return -1; return -1;
} }
// Check if the sequences are identical in a quick way (same index in the same indexer)
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;
}
else // the sequences aren't identical
{
// kmer filter // kmer filter
align_filters(ktable, blob1, blob2, i, j, threshold, normalize, reference, similarity_mode, &score, &lcs_min); align_filters(ktable, blob1, blob2, i, j, threshold, normalize, reference, similarity_mode, &score, &lcs_min, false);
// Compute alignment score // Compute alignment score
if ((threshold == 0) || (score == -1.0)) // no threshold or filter passed, and sequences not identical: align 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); 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