Commit 8ce6f6c8 by Celine Mercier

Added an argument to specify whether the two sequences can be identical

when applying filters before aligning
parent 3e53f941
......@@ -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;
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment