Skip to content

Commit f9f1300

Browse files
committed
polish
1 parent 747f295 commit f9f1300

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/align.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,7 @@ int wfa_collect_noisy_aln_str_with_ps_hap(const call_var_opt_t *opt, int n_reads
11711171
return n_cons;
11721172
}
11731173

1174-
int collect_noisy_read_info(bam_chunk_t *chunk, hts_pos_t reg_beg, hts_pos_t reg_end, int noisy_reg_i, int n_noisy_reg_reads, int *noisy_reg_reads, int **read_lens,
1174+
int collect_noisy_read_info(const call_var_opt_t *opt, bam_chunk_t *chunk, hts_pos_t reg_beg, hts_pos_t reg_end, int noisy_reg_i, int n_noisy_reg_reads, int *noisy_reg_reads, int **read_lens,
11751175
uint8_t ***read_seqs, uint8_t **strands, uint8_t ***read_quals, char ***read_names, int **fully_covers, int **read_haps, hts_pos_t **phase_sets) {
11761176
*read_lens = (int*)calloc(n_noisy_reg_reads, sizeof(int));
11771177
*read_seqs = (uint8_t**)malloc(n_noisy_reg_reads * sizeof(uint8_t*));
@@ -1202,7 +1202,7 @@ int collect_noisy_read_info(bam_chunk_t *chunk, hts_pos_t reg_beg, hts_pos_t reg
12021202
if (op == BAM_CDEL) {
12031203
reg_digar_beg = reg_beg;
12041204
reg_read_beg = qi;
1205-
beg_is_del = 1;
1205+
if (len > opt->noisy_reg_flank_len) beg_is_del = 1;
12061206
} else {
12071207
reg_digar_beg = reg_beg;
12081208
reg_read_beg = qi + (reg_beg - digar_beg);
@@ -1212,7 +1212,7 @@ int collect_noisy_read_info(bam_chunk_t *chunk, hts_pos_t reg_beg, hts_pos_t reg
12121212
if (op == BAM_CDEL) {
12131213
reg_digar_end = reg_end;
12141214
reg_read_end = qi-1;
1215-
end_is_del = 1;
1215+
if (len > opt->noisy_reg_flank_len) end_is_del = 1;
12161216
} else {
12171217
reg_digar_end = reg_end;
12181218
reg_read_end = qi + (reg_end - digar_beg);
@@ -1252,7 +1252,7 @@ int collect_noisy_reg_aln_strs(const call_var_opt_t *opt, bam_chunk_t *chunk, ht
12521252
if (n_noisy_reg_reads <= 0) return 0;
12531253
// fully_cover: 0 -> none, 1 -> left, 2 -> right, 3 -> both
12541254
char **names = NULL; uint8_t **seqs = NULL; uint8_t *strands=NULL; int *fully_covers = NULL, *lens = NULL, *haps = NULL; hts_pos_t *phase_sets = NULL; uint8_t **base_quals = NULL;
1255-
collect_noisy_read_info(chunk, noisy_reg_beg, noisy_reg_end, noisy_reg_i, n_noisy_reg_reads, noisy_reads, &lens, &seqs, &strands, &base_quals, &names, &fully_covers, &haps, &phase_sets);
1255+
collect_noisy_read_info(opt, chunk, noisy_reg_beg, noisy_reg_end, noisy_reg_i, n_noisy_reg_reads, noisy_reads, &lens, &seqs, &strands, &base_quals, &names, &fully_covers, &haps, &phase_sets);
12561256

12571257
sort_by_full_cover_and_length(n_noisy_reg_reads, noisy_reads, lens, seqs, base_quals, strands, fully_covers, names, haps, phase_sets);
12581258
// >= min_hap_full_read_count reads for each hap && >= min_hap_read_count reads (including not full-cover, but >= full-cover length) for each hap

0 commit comments

Comments
 (0)