C obi_lcs: fixed checking for identical sequences when aligning 2
columns
This commit is contained in:
@ -70,7 +70,7 @@ static int create_alignment_output_columns(Obiview_p output_view,
|
|||||||
/**
|
/**
|
||||||
* @brief Internal function printing the result of one alignment to the output view.
|
* @brief Internal function printing the result of one alignment to the output view.
|
||||||
*
|
*
|
||||||
* @param output_view A pointer on the writable view where the columns should be created.
|
* @param output_view A pointer on the writable view where the result should be written.
|
||||||
* @param line The line in the output view where the result should be written.
|
* @param line The line in the output view where the result should be written.
|
||||||
* @param idx1_column A pointer on the column where the index referring to the line of the first sequence aligned in the input view should be written.
|
* @param idx1_column A pointer on the column where the index referring to the line of the first sequence aligned in the input view should be written.
|
||||||
* @param idx2_column A pointer on the column where the index referring to the line of the second sequence aligned in the input view should be written.
|
* @param idx2_column A pointer on the column where the index referring to the line of the second sequence aligned in the input view should be written.
|
||||||
@ -85,7 +85,7 @@ static int create_alignment_output_columns(Obiview_p output_view,
|
|||||||
* @param seq2_column A pointer on the column where the second sequence aligned should be written.
|
* @param seq2_column A pointer on the column where the second sequence aligned should be written.
|
||||||
* @param seq1_idx The index of the sequence of the first sequence aligned.
|
* @param seq1_idx The index of the sequence of the first sequence aligned.
|
||||||
* @param seq2_idx The index of the sequence of the second sequence aligned.
|
* @param seq2_idx The index of the sequence of the second sequence aligned.
|
||||||
* @param print_count A boolean indicating whether the aligned sequence counts should be copied in the output view. // Count columns not implement yet
|
* @param print_count A boolean indicating whether the aligned sequence counts should be copied in the output view.
|
||||||
* @param count1_column A pointer on the column where the count of the first sequence aligned should be written.
|
* @param count1_column A pointer on the column where the count of the first sequence aligned should be written.
|
||||||
* @param count2_column A pointer on the column where the count of the second sequence aligned should be written.
|
* @param count2_column A pointer on the column where the count of the second sequence aligned should be written.
|
||||||
* @param count1 The count of the first sequence aligned.
|
* @param count1 The count of the first sequence aligned.
|
||||||
@ -448,7 +448,7 @@ int obi_lcs_align_one_column(const char* dms_name,
|
|||||||
|
|
||||||
// Open the sequence column to align
|
// Open the sequence column to align
|
||||||
// If a column name wasn't given, open default sequence column
|
// If a column name wasn't given, open default sequence column
|
||||||
if (strcmp(seq_column_name, "") == 0)
|
if (strcmp(seq_column_name, "") == 0) // TODO check for NULL
|
||||||
{
|
{
|
||||||
if (strcmp((seq_view->infos)->view_type, VIEW_TYPE_NUC_SEQS) == 0)
|
if (strcmp((seq_view->infos)->view_type, VIEW_TYPE_NUC_SEQS) == 0)
|
||||||
iseq_column = obi_view_get_column(seq_view, NUC_SEQUENCE_COLUMN);
|
iseq_column = obi_view_get_column(seq_view, NUC_SEQUENCE_COLUMN);
|
||||||
@ -997,13 +997,13 @@ int obi_lcs_align_two_columns(const char* dms_name,
|
|||||||
score = blob1->length_decoded_value;
|
score = blob1->length_decoded_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
else // the sequences aren't identical
|
else // the sequences aren't identical or we don't know
|
||||||
{
|
{
|
||||||
// kmer filter (offset for the index of the kmer table of the 2nd sequence because the kmer tables of the 2 sequence columns are concatenated in one)
|
// kmer filter (offset for the index of the kmer table of the 2nd sequence because the kmer tables of the 2 sequence columns are concatenated in one)
|
||||||
align_filters(ktable, blob1, blob2, i, seq1_count+j, threshold, normalize, reference, similarity_mode, &score, &lcs_min, false);
|
align_filters(ktable, blob1, blob2, i, seq1_count+j, threshold, normalize, reference, similarity_mode, &score, &lcs_min, !same_indexer);
|
||||||
|
|
||||||
// Compute alignment score
|
// Compute alignment score
|
||||||
if ((threshold == 0) || (score == -1.0)) // no threshold, or filter passed: align
|
if ((score < 0) && ((threshold == 0) || (score == -1.0))) // (sequences are not identical), and (no threshold, or filter passed): align
|
||||||
score = obiblob_sse_banded_lcs_align(blob1, blob2, threshold, normalize, reference, similarity_mode, &lcs_length, &ali_length);
|
score = obiblob_sse_banded_lcs_align(blob1, blob2, threshold, normalize, reference, similarity_mode, &lcs_length, &ali_length);
|
||||||
|
|
||||||
// TODO check this
|
// TODO check this
|
||||||
|
Reference in New Issue
Block a user