From 9c25075feda2ebf34682238cd7153247a5abd341 Mon Sep 17 00:00:00 2001 From: Haoyu Cheng Date: Thu, 12 Dec 2019 03:06:47 -0500 Subject: [PATCH] update for base-level alignment --- Correct.cpp | 32 ++++++++++++++++++++++++-------- Overlaps.cpp | 2 +- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/Correct.cpp b/Correct.cpp index e3a7b36..9e04f41 100644 --- a/Correct.cpp +++ b/Correct.cpp @@ -1164,8 +1164,8 @@ All_reads* R_INF, Correct_dumy* dumy, UC_Read* g_read) y_beg_right = 1 + overlap_list->list[ID].w_list[i + 1].y_start - 1 - x_len; } - ///cannot apply this strategy to the leftmost and the rightmost window - if(y_beg_left == -1 && y_beg_right == -1 && i > 0 && i < subWinNum - 1) + + if(y_beg_left == -1 && y_beg_right == -1) { y_beg_left = overlap_list->list[ID].w_list[i].y_start; if(overlap_list->list[ID].w_list[i].extra_begin >= 0) @@ -1176,6 +1176,16 @@ All_reads* R_INF, Correct_dumy* dumy, UC_Read* g_read) y_beg_right = y_beg_left; } + if(y_beg_left == -1 && y_beg_right != -1) + { + y_beg_left = y_beg_right; + } + + if(y_beg_right == -1 && y_beg_left != -1) + { + y_beg_right = y_beg_left; + } + if(y_beg_left != -1) { @@ -1191,12 +1201,18 @@ All_reads* R_INF, Correct_dumy* dumy, UC_Read* g_read) threshold, 1, &r_error_right, &r_y_end_right, &r_x_end_right, &aligned_xLen_right); } - ///here one of aligned_xLen_left and aligned_xLen_right must be 0 - if((i == 0 || i == subWinNum - 1) && - (x_len - (aligned_xLen_left + aligned_xLen_right) > 10)) - { - return 1.0; - } + /** + if(i == 0 || i == subWinNum - 1) + { + if(((aligned_xLen_left + aligned_xLen_right) < x_len) + && + (x_len - (aligned_xLen_left + aligned_xLen_right) > 20)) + { + return 1.0; + } + } + **/ + ///aligned in both direction if(aligned_xLen_left != 0 && aligned_xLen_right != 0) diff --git a/Overlaps.cpp b/Overlaps.cpp index 5862bb1..0abeeff 100644 --- a/Overlaps.cpp +++ b/Overlaps.cpp @@ -9617,7 +9617,7 @@ char* output_file_name, long long bubble_dist, int read_graph, int write) ma_hit_sub(min_dp, sources, n_read, readLen, mini_overlap_length, &coverage_cut); - + ////这个会断开 ma_hit_chimeric(1, sources, reverse_sources, n_read, readLen, coverage_cut); ma_hit_cut(min_dp, sources, n_read, readLen, mini_overlap_length, &coverage_cut);