From da445066f3d37f681d25474c6e0fdbbf73dcef95 Mon Sep 17 00:00:00 2001 From: Celine Mercier Date: Sun, 9 Dec 2018 19:14:51 +0100 Subject: [PATCH] C alignment filter: added a check for sequences not being equal when the threshold requires that they are --- src/upperband.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/upperband.c b/src/upperband.c index 090b417..7833963 100755 --- a/src/upperband.c +++ b/src/upperband.c @@ -355,17 +355,26 @@ void align_filters(Kmer_table_p ktable, Obi_blob_p seq1, Obi_blob_p seq2, index_ *score = -2.0; - if (can_be_identical && (obi_blob_compare(seq1, seq2) == 0)) // the 2 sequences are identical. + if (can_be_identical) { - if (similarity_mode && normalize) - *score = 1.0; - else if (!similarity_mode) - *score = 0.0; - else - *score = l1; + if (obi_blob_compare(seq1, seq2) == 0) + { + if (similarity_mode && normalize) + *score = 1.0; + else if (!similarity_mode) + *score = 0.0; + else + *score = l1; + } } - else if (threshold != 0) + else if ((similarity_mode && normalize && (threshold == 1.0)) || + (!similarity_mode && (threshold == 0.0))) + { // The sequences must be identical but are not + return; + } + + else if (threshold != 0.0) { l2 = seq2->length_decoded_value;