mirror of
https://github.com/chhylp123/hifiasm.git
synced 2026-10-11 03:40:57 +08:00
UL graph done
This commit is contained in:
+10
-8
@@ -11180,7 +11180,6 @@ void debug_contig_end(ma_ug_t *ug, asg_t* read_g, kvec_asg_arc_t_warp* edge)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void renew_utg(ma_ug_t **ug, asg_t* read_g, kvec_asg_arc_t_warp* edge);
|
|
||||||
void push_sub_unitig(ma_ug_t *n_ug, ma_utg_t *src_u, asg_t *read_g, kvec_asg_arc_t_warp* edge,
|
void push_sub_unitig(ma_ug_t *n_ug, ma_utg_t *src_u, asg_t *read_g, kvec_asg_arc_t_warp* edge,
|
||||||
uint32_t beg_idx, uint32_t occ)
|
uint32_t beg_idx, uint32_t occ)
|
||||||
{
|
{
|
||||||
@@ -14819,14 +14818,14 @@ const char* command)
|
|||||||
|
|
||||||
|
|
||||||
uint32_t print_debug_gfa(asg_t *read_g, ma_ug_t *ug, ma_sub_t* coverage_cut, const char* output_file_name,
|
uint32_t print_debug_gfa(asg_t *read_g, ma_ug_t *ug, ma_sub_t* coverage_cut, const char* output_file_name,
|
||||||
ma_hit_t_alloc* sources, R_to_U* ruIndex, int max_hang, int min_ovlp)
|
ma_hit_t_alloc* sources, R_to_U* ruIndex, int max_hang, int min_ovlp, int is_polish, int is_update_ou, int is_check_alter_lable)
|
||||||
{
|
{
|
||||||
kvec_asg_arc_t_warp new_rtg_edges;
|
kvec_asg_arc_t_warp new_rtg_edges;
|
||||||
kv_init(new_rtg_edges.a);
|
kv_init(new_rtg_edges.a);
|
||||||
|
|
||||||
if(ug == NULL) {
|
if(ug == NULL) {
|
||||||
ug = ma_ug_gen(read_g);
|
ug = ma_ug_gen(read_g);
|
||||||
} else {
|
} else if(is_check_alter_lable) {
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
for (i = 0; i < ug->u.n; ++i)
|
for (i = 0; i < ug->u.n; ++i)
|
||||||
{
|
{
|
||||||
@@ -14844,8 +14843,8 @@ ma_hit_t_alloc* sources, R_to_U* ruIndex, int max_hang, int min_ovlp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
update_ug_ou(ug, read_g);
|
if(is_update_ou) update_ug_ou(ug, read_g);
|
||||||
ma_ug_seq(ug, read_g, coverage_cut, sources, &new_rtg_edges, max_hang, min_ovlp, 0, 0);
|
if(is_polish) ma_ug_seq(ug, read_g, coverage_cut, sources, &new_rtg_edges, max_hang, min_ovlp, 0, 0);
|
||||||
|
|
||||||
fprintf(stderr, "Writing raw unitig GFA to disk... \n");
|
fprintf(stderr, "Writing raw unitig GFA to disk... \n");
|
||||||
char* gfa_name = (char*)malloc(strlen(output_file_name)+25);
|
char* gfa_name = (char*)malloc(strlen(output_file_name)+25);
|
||||||
@@ -16627,7 +16626,7 @@ int min_ovlp, hap_cov_t *cov)
|
|||||||
|
|
||||||
resolve_tangles(ug, read_g, reverse_sources, 20, 100, 0.05, 0.2, ruIndex, cov->is_r_het, (uint32_t)-1, drop_ratio);
|
resolve_tangles(ug, read_g, reverse_sources, 20, 100, 0.05, 0.2, ruIndex, cov->is_r_het, (uint32_t)-1, drop_ratio);
|
||||||
drop_semi_circle(ug, g, read_g, reverse_sources, ruIndex, cov->is_r_het);
|
drop_semi_circle(ug, g, read_g, reverse_sources, ruIndex, cov->is_r_het);
|
||||||
print_debug_gfa(read_g, ug, coverage_cut, "debug_clean_end", sources, ruIndex, asm_opt.max_hang_Len, asm_opt.min_overlap_Len);
|
// print_debug_gfa(read_g, ug, coverage_cut, "debug_clean_end", sources, ruIndex, asm_opt.max_hang_Len, asm_opt.min_overlap_Len);
|
||||||
unitig_arc_del_short_diploid_by_length_topo(g, ug, drop_ratio, asm_opt.max_short_tip, reverse_sources, 0, 1);
|
unitig_arc_del_short_diploid_by_length_topo(g, ug, drop_ratio, asm_opt.max_short_tip, reverse_sources, 0, 1);
|
||||||
|
|
||||||
if(round > 0)
|
if(round > 0)
|
||||||
@@ -31549,8 +31548,11 @@ ma_sub_t **coverage_cut_ptr, int debug_g)
|
|||||||
gen_ug_opt_t(&uopt, sources, reverse_sources, max_hang_length, mini_overlap_length, gap_fuzz, min_dp, readLen, coverage_cut, ruIndex,
|
gen_ug_opt_t(&uopt, sources, reverse_sources, max_hang_length, mini_overlap_length, gap_fuzz, min_dp, readLen, coverage_cut, ruIndex,
|
||||||
(asm_opt.max_short_tip*2), 0.15, 3, 0.05, 0.9, &b_mask_t);
|
(asm_opt.max_short_tip*2), 0.15, 3, 0.05, 0.9, &b_mask_t);
|
||||||
}
|
}
|
||||||
if(asm_opt.ar) ul_realignment_gfa(&uopt, sg);
|
if(asm_opt.ar) {
|
||||||
print_debug_gfa(sg, NULL, coverage_cut, "UL.debug", sources, ruIndex, max_hang_length, mini_overlap_length);
|
ul_realignment_gfa(&uopt, sg, clean_round, min_ovlp_drop_ratio, max_ovlp_drop_ratio,
|
||||||
|
asm_opt.max_short_tip, &b_mask_t, ha_opt_triobin(&asm_opt));
|
||||||
|
}
|
||||||
|
print_debug_gfa(sg, NULL, coverage_cut, "UL.debug", sources, ruIndex, max_hang_length, mini_overlap_length, 0, 0, 0);
|
||||||
/**
|
/**
|
||||||
asg_cut_tip(sg, asm_opt.max_short_tip);
|
asg_cut_tip(sg, asm_opt.max_short_tip);
|
||||||
///debug_info_of_specfic_node("m64043_200505_112554/8849050/ccs", sg, "inner_1");
|
///debug_info_of_specfic_node("m64043_200505_112554/8849050/ccs", sg, "inner_1");
|
||||||
|
|||||||
+3
-1
@@ -259,6 +259,7 @@ typedef struct {
|
|||||||
// kv_ul_ov_t *ov;
|
// kv_ul_ov_t *ov;
|
||||||
} ul_idx_t;
|
} ul_idx_t;
|
||||||
|
|
||||||
|
#define MA_HT_DOUBLE (-1024)
|
||||||
#define MA_HT_INT (-1)
|
#define MA_HT_INT (-1)
|
||||||
#define MA_HT_QCONT (-2)
|
#define MA_HT_QCONT (-2)
|
||||||
#define MA_HT_TCONT (-3)
|
#define MA_HT_TCONT (-3)
|
||||||
@@ -1079,7 +1080,7 @@ int asg_arc_del_triangular_directly(asg_t *g, long long min_edge_length,
|
|||||||
ma_hit_t_alloc* reverse_sources, R_to_U* ruIndex);
|
ma_hit_t_alloc* reverse_sources, R_to_U* ruIndex);
|
||||||
int asg_arc_del_short_diploid_by_exact(asg_t *g, int max_ext, ma_hit_t_alloc* sources);
|
int asg_arc_del_short_diploid_by_exact(asg_t *g, int max_ext, ma_hit_t_alloc* sources);
|
||||||
uint32_t print_debug_gfa(asg_t *read_g, ma_ug_t *ug, ma_sub_t* coverage_cut, const char* output_file_name,
|
uint32_t print_debug_gfa(asg_t *read_g, ma_ug_t *ug, ma_sub_t* coverage_cut, const char* output_file_name,
|
||||||
ma_hit_t_alloc* sources, R_to_U* ruIndex, int max_hang, int min_ovlp);
|
ma_hit_t_alloc* sources, R_to_U* ruIndex, int max_hang, int min_ovlp, int is_polish, int is_update_ou, int is_check_alter_lable);
|
||||||
void debug_info_of_specfic_node(const char* name, asg_t *g, R_to_U* ruIndex, const char* command);
|
void debug_info_of_specfic_node(const char* name, asg_t *g, R_to_U* ruIndex, const char* command);
|
||||||
ma_ug_t *gen_polished_ug(const ug_opt_t *uopt, asg_t *sg);
|
ma_ug_t *gen_polished_ug(const ug_opt_t *uopt, asg_t *sg);
|
||||||
void output_unitig_graph(asg_t *sg, ma_sub_t* coverage_cut, char* output_file_name,
|
void output_unitig_graph(asg_t *sg, ma_sub_t* coverage_cut, char* output_file_name,
|
||||||
@@ -1087,6 +1088,7 @@ ma_hit_t_alloc* sources, R_to_U* ruIndex, int max_hang, int min_ovlp);
|
|||||||
void flat_soma_v(asg_t *sg, ma_hit_t_alloc* sources, R_to_U* ruIndex);
|
void flat_soma_v(asg_t *sg, ma_hit_t_alloc* sources, R_to_U* ruIndex);
|
||||||
void hic_clean(asg_t* read_g);
|
void hic_clean(asg_t* read_g);
|
||||||
int64_t count_edges_v_w(asg_t *g, uint32_t v, uint32_t w);
|
int64_t count_edges_v_w(asg_t *g, uint32_t v, uint32_t w);
|
||||||
|
void renew_utg(ma_ug_t **ug, asg_t* read_g, kvec_asg_arc_t_warp* edge);
|
||||||
|
|
||||||
#define JUNK_COV 5
|
#define JUNK_COV 5
|
||||||
#define DISCARD_RATE 0.8
|
#define DISCARD_RATE 0.8
|
||||||
|
|||||||
+3564
-16
File diff suppressed because it is too large
Load Diff
@@ -14,5 +14,6 @@ void asg_arc_cut_bub_links(asg_t *g, asg64_v *in, float len_rat, float sec_len_r
|
|||||||
void asg_arc_cut_complex_bub_links(asg_t *g, asg64_v *in, float len_rat, float ou_rat, uint32_t is_ou, bub_label_t *b_mask_t);
|
void asg_arc_cut_complex_bub_links(asg_t *g, asg64_v *in, float len_rat, float ou_rat, uint32_t is_ou, bub_label_t *b_mask_t);
|
||||||
uint32_t asg_cut_large_indel(asg_t *g, asg64_v *in, int32_t max_ext, float ou_rat, uint32_t is_ou);
|
uint32_t asg_cut_large_indel(asg_t *g, asg64_v *in, int32_t max_ext, float ou_rat, uint32_t is_ou);
|
||||||
uint32_t asg_cut_semi_circ(asg_t *g, uint32_t lim_len, uint32_t is_clean);
|
uint32_t asg_cut_semi_circ(asg_t *g, uint32_t lim_len, uint32_t is_clean);
|
||||||
void ul_realignment_gfa(ug_opt_t *uopt, asg_t *sg);
|
void ul_realignment_gfa(ug_opt_t *uopt, asg_t *sg, int64_t clean_round, double min_ovlp_drop_ratio,
|
||||||
|
double max_ovlp_drop_ratio, int64_t max_tip, bub_label_t *b_mask_t, uint32_t is_trio);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -8913,18 +8913,9 @@ static void filter_short_ulalignments(void *data, long i, int tid) // callback f
|
|||||||
const ma_ug_t *ug = (ma_ug_t *)data;
|
const ma_ug_t *ug = (ma_ug_t *)data;
|
||||||
uc_block_t *a = NULL; uc_block_t *p; int64_t k, a_n; uint32_t z, fz, lz, l, bz;
|
uc_block_t *a = NULL; uc_block_t *p; int64_t k, a_n; uint32_t z, fz, lz, l, bz;
|
||||||
a = UL_INF.a[i].bb.a; a_n = UL_INF.a[i].bb.n;
|
a = UL_INF.a[i].bb.a; a_n = UL_INF.a[i].bb.n;
|
||||||
// if(i == 4) {
|
|
||||||
// fprintf(stderr, "[M::%s::i->%ld] a_n->%ld\n", __func__, i, a_n);
|
|
||||||
// }
|
|
||||||
for (k = a_n - 1; k >= 0; k--) {
|
for (k = a_n - 1; k >= 0; k--) {
|
||||||
p = &(a[k]);
|
p = &(a[k]);
|
||||||
// if(i == 27512) {
|
|
||||||
// fprintf(stderr, "+[M::%s::k->%ld::a_n->%ld] p->ts::%u, p->te::%u, p->pchain::%u, p->pidx::%u, p->aidx::%u, p->qs::%u, p->qe::%u\n",
|
|
||||||
// __func__, k, a_n, p->ts, p->te, p->pchain, p->pidx, p->aidx, p->qs, p->qe);
|
|
||||||
// }
|
|
||||||
// if(p->qs > p->qe) {
|
|
||||||
// fprintf(stderr, "[M::%s] id->%ld, qs->%u, qe->%u\n", __func__, i, p->qs, p->qe);
|
|
||||||
// }
|
|
||||||
if(p->base || (!p->el) || (!p->pchain)) continue;
|
if(p->base || (!p->el) || (!p->pchain)) continue;
|
||||||
if(p->pidx == (uint32_t)-1) {
|
if(p->pidx == (uint32_t)-1) {
|
||||||
if(!ugl_cover_check(p->ts, p->te, &(ug->u.a[p->hid]))) {
|
if(!ugl_cover_check(p->ts, p->te, &(ug->u.a[p->hid]))) {
|
||||||
@@ -8956,10 +8947,6 @@ static void filter_short_ulalignments(void *data, long i, int tid) // callback f
|
|||||||
|
|
||||||
for (k = a_n - 1; k >= 0; k--) {
|
for (k = a_n - 1; k >= 0; k--) {
|
||||||
p = &(a[k]);
|
p = &(a[k]);
|
||||||
// if(i == 27512) {
|
|
||||||
// fprintf(stderr, "-[M::%s::k->%ld::a_n->%ld] p->ts::%u, p->te::%u, p->pchain::%u, p->pidx::%u, p->aidx::%u, p->qs::%u, p->qe::%u\n",
|
|
||||||
// __func__, k, a_n, p->ts, p->te, p->pchain, p->pidx, p->aidx, p->qs, p->qe);
|
|
||||||
// }
|
|
||||||
if(p->base || (!p->el) || (!p->pchain)) continue;
|
if(p->base || (!p->el) || (!p->pchain)) continue;
|
||||||
if(p->pidx != (uint32_t)-1) {
|
if(p->pidx != (uint32_t)-1) {
|
||||||
assert(a[p->pidx].aidx == (uint32_t)k);
|
assert(a[p->pidx].aidx == (uint32_t)k);
|
||||||
|
|||||||
Reference in New Issue
Block a user