Skip to content

Commit

Permalink
Merge pull request #354 from chhylp123/hifiasm_dev_debug
Browse files Browse the repository at this point in the history
fixed gap filling with UL
  • Loading branch information
chhylp123 authored Nov 25, 2022
2 parents b84e7ec + fc76af1 commit deb3194
Show file tree
Hide file tree
Showing 6 changed files with 762 additions and 184 deletions.
2 changes: 1 addition & 1 deletion CommandLines.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
31 changes: 19 additions & 12 deletions Overlaps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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);
}

Expand Down
16 changes: 16 additions & 0 deletions Overlaps.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
Loading

0 comments on commit deb3194

Please sign in to comment.