From 8ce6f6c80b5b8ca5a2263ea2a800627fd54354c6 Mon Sep 17 00:00:00 2001 From: Celine Mercier Date: Mon, 28 Nov 2016 11:38:02 +0100 Subject: [PATCH] Added an argument to specify whether the two sequences can be identical when applying filters before aligning --- src/upperband.c | 7 +++++-- src/upperband.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/upperband.c b/src/upperband.c index b84a563..eeca342 100644 --- a/src/upperband.c +++ b/src/upperband.c @@ -307,8 +307,11 @@ bool is_possible(Kmer_table_p ktable, index_t idx1, index_t idx2, int l1, int l2 } -void align_filters(Kmer_table_p ktable, Obi_blob_p seq1, Obi_blob_p seq2, index_t idx1, index_t idx2, double threshold, bool normalize, int reference, bool similarity_mode, double* score, int* LCSmin) +void align_filters(Kmer_table_p ktable, Obi_blob_p seq1, Obi_blob_p seq2, index_t idx1, index_t idx2, + double threshold, bool normalize, int reference, bool similarity_mode, double* score, int* LCSmin, + bool can_be_identical) { // score takes value -2 if filters are not passed, -1 if filters are passed and >= 0 with max score if the 2 sequences are identical. + // TODO move to obi_align.c int l1; int l2; @@ -316,7 +319,7 @@ void align_filters(Kmer_table_p ktable, Obi_blob_p seq1, Obi_blob_p seq2, index_ *score = -2.0; - if (obi_blob_compare(seq1, seq2) == 0) // the 2 sequences are identical. TODO add bool arg indicating whether that's a possibility? + if (can_be_identical && (obi_blob_compare(seq1, seq2) == 0)) // the 2 sequences are identical. { if (similarity_mode && normalize) *score = 1.0; diff --git a/src/upperband.h b/src/upperband.h index 5b4ef4e..56031cf 100644 --- a/src/upperband.h +++ b/src/upperband.h @@ -19,7 +19,7 @@ typedef struct { Kmer_table_p hash_seq_column(Obiview_p view, OBIDMS_column_p seq_col); -void align_filters(Kmer_table_p ktable, Obi_blob_p seq1, Obi_blob_p seq2, index_t idx1, index_t idx2, double threshold, bool normalize, int reference, bool similarity_mode, double* score, int* LCSmin); +void align_filters(Kmer_table_p ktable, Obi_blob_p seq1, Obi_blob_p seq2, index_t idx1, index_t idx2, double threshold, bool normalize, int reference, bool similarity_mode, double* score, int* LCSmin, bool can_be_identical); void free_kmer_tables(Kmer_table_p ktable, size_t count); #endif