ngsfilter and alignpairedend: paired-end reads are now correctly

reversed and labeled to be aligned correctly by alignpairedend
This commit is contained in:
Celine Mercier
2019-07-23 18:56:51 +02:00
parent 1759302829
commit d99702f56f
7 changed files with 39 additions and 5 deletions

View File

@ -65,7 +65,7 @@ void obi_free_shifted_ali(Obi_ali_p ali)
Obi_ali_p kmer_similarity(Obiview_p view1, OBIDMS_column_p column1, index_t idx1, index_t elt_idx1,
Obiview_p view2, OBIDMS_column_p column2, index_t idx2, index_t elt_idx2,
OBIDMS_column_p qual_col1, OBIDMS_column_p qual_col2,
OBIDMS_column_p qual_col1, OBIDMS_column_p qual_col2, OBIDMS_column_p reversed_column,
uint8_t kmer_size,
int32_t** kmer_pos_array_p, int32_t* kmer_pos_array_height_p,
int32_t** shift_array_p, int32_t* shift_array_height_p,
@ -78,6 +78,7 @@ Obi_ali_p kmer_similarity(Obiview_p view1, OBIDMS_column_p column1, index_t idx1
Obi_ali_p ali = NULL;
int i, j;
bool switched_seqs;
bool reversed;
int score = 0;
Obi_blob_p blob1 = NULL;
Obi_blob_p blob2 = NULL;
@ -189,6 +190,14 @@ Obi_ali_p kmer_similarity(Obiview_p view1, OBIDMS_column_p column1, index_t idx1
seq2 = reverse_complement_sequence(seq2);
blob2 = obi_seq_to_blob(seq2);
// Check if the sequences have been reverse-complemented by the ngsfilter tool
if (reversed_column != NULL)
reversed = obi_get_bool_with_elt_idx_and_col_p_in_view(view1, reversed_column, idx1, 0); // assuming that reversed_column is in view1 is dirty but faster
else
reversed = false;
if (reversed)
switched_seqs = !switched_seqs;
// Save total length for the shift counts array
total_len = len1 + len2 + 1; // +1 for shift 0