fixed gap filling with UL

This commit is contained in:
chhylp123
2022-11-25 11:46:37 -05:00
parent 979d83f68d
commit fc76af1285
6 changed files with 760 additions and 182 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
#include <pthread.h>
#include <stdint.h>
#define HA_VERSION "0.17.4-r455"
#define HA_VERSION "0.17.5-r458"
#define VERBOSE 0
+19 -12
View File
@@ -31706,17 +31706,24 @@ int64_t mini_overlap_length, int64_t max_hang_length,
ug_opt_t *uopt, 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, char *o_file)
{
ma_ug_t *iug = 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), o_file);
asg_t *ng = gen_ng(iug, *sg, uopt, coverage_cut, ruIndex, 256);
ma_ug_destroy(iug); asg_destroy(*sg);
(*sources) = R_INF.paf;
(*reverse_sources) = R_INF.reverse_paf;
(*n_read) = R_INF.total_reads;
(*readLen) = R_INF.read_length;
(*sg) = ng;
ma_hit_contained_advance(*sources, *n_read, *coverage_cut, ruIndex, max_hang_length, mini_overlap_length);
post_rescue(uopt, *sg, (*sources), (*reverse_sources), ruIndex, b_mask_t, 0);
ul_renew_t nopt; memset(&nopt, 0, sizeof(nopt));
nopt.src = sources; nopt.r_src = reverse_sources; nopt.ruIndex = ruIndex;
nopt.n_read = n_read; nopt.readLen = readLen; nopt.sg = sg;
nopt.cov = coverage_cut; nopt.b_mask_t = b_mask_t;
nopt.max_hang = max_hang_length; nopt.mini_ovlp = 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), o_file, &nopt);;
// ma_ug_t *iug = 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), o_file);
// asg_t *ng = gen_ng(iug, *sg, uopt, coverage_cut, ruIndex, 256);
// ma_ug_destroy(iug); asg_destroy(*sg);
// (*sources) = R_INF.paf;
// (*reverse_sources) = R_INF.reverse_paf;
// (*n_read) = R_INF.total_reads;
// (*readLen) = R_INF.read_length;
// (*sg) = ng;
// ma_hit_contained_advance(*sources, *n_read, *coverage_cut, ruIndex, max_hang_length, mini_overlap_length);
// post_rescue(uopt, *sg, (*sources), (*reverse_sources), ruIndex, b_mask_t, 0);
}
void clean_graph(
@@ -32015,7 +32022,7 @@ ma_sub_t **coverage_cut_ptr, int debug_g)
*coverage_cut_ptr = coverage_cut;
*sg_ptr = sg;
destory_bub_label_t(&b_mask_t);
free(o_file); if(asm_opt.ar) destory_all_ul_t(&UL_INF);
free(o_file); ///if(asm_opt.ar) destory_all_ul_t(&UL_INF);
fprintf(stderr, "Inconsistency threshold for low-quality regions in BED files: %u%%\n", asm_opt.bed_inconsist_rate);
}
+16
View File
@@ -1077,6 +1077,20 @@ typedef struct{
uint64_t* readLen;
}ug_opt_t;
typedef struct{
ma_hit_t_alloc **src;
ma_hit_t_alloc **r_src;
long long *n_read;
uint64_t **readLen;
asg_t **sg;
R_to_U *ruIndex;
ma_sub_t **cov;
bub_label_t *b_mask_t;
int64_t max_hang;
int64_t mini_ovlp;
}ul_renew_t;
void adjust_utg_by_trio(ma_ug_t **ug, asg_t* read_g, uint8_t flag, float drop_rate,
ma_hit_t_alloc* sources, ma_hit_t_alloc* reverse_sources, ma_sub_t* coverage_cut,
long long tipsLen, float tip_drop_ratio, long long stops_threshold,
@@ -1145,6 +1159,8 @@ void set_reverse_overlap(ma_hit_t* dest, ma_hit_t* source);
// void break_ug_contig(ma_ug_t **ug, asg_t *read_g, All_reads *RNF, ma_sub_t *coverage_cut,
// ma_hit_t_alloc* sources, R_to_U* ruIndex, kvec_asg_arc_t_warp* edge, int max_hang, int min_ovlp,
// int* b_low_cov, int* b_high_cov, double m_rate);
void ma_hit_contained_advance(ma_hit_t_alloc* sources, long long n_read, ma_sub_t *coverage_cut,
R_to_U* ruIndex, int max_hang, int min_ovlp);
#define JUNK_COV 5
#define DISCARD_RATE 0.8
+721 -167
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -23,8 +23,8 @@ 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);
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);
ma_ug_t *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, char *o_file);
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, char *o_file, ul_renew_t *ropt);
void recover_contain_g(asg_t *g, ma_hit_t_alloc *src, R_to_U* ruIndex, int64_t max_hang, int64_t min_ovlp, int64_t ul_occ);
void normalize_gou(asg_t *g);
void prt_specfic_sge(asg_t *g, uint32_t src, uint32_t dst, const char* cmd);
+1
View File
@@ -115,5 +115,6 @@ void filter_ul_ug(ma_ug_t *ug);
void gen_ul_vec_rid_t(all_ul_t *x, All_reads *rdb, ma_ug_t *ug);
void update_ug_arch_ul_mul(ma_ug_t *ug);
void print_ul_alignment(ma_ug_t *ug, all_ul_t *aln, uint32_t id, const char* cmd);
void clear_all_ul_t(all_ul_t *x);
#endif