debug hic_hits

This commit is contained in:
chhylp123
2021-02-09 18:40:49 -05:00
parent 8467d58ef1
commit 5bb22f701c
3 changed files with 14 additions and 27 deletions
+3 -14
View File
@@ -10757,7 +10757,7 @@ R_to_U* ruIndex, float chimeric_rate, float drop_ratio, int max_hang, int min_ov
ma_ug_destroy(ug); ma_ug_destroy(ug);
kv_destroy(new_rtg_edges.a); kv_destroy(new_rtg_edges.a);
///output_unitig_graph(sg, coverage_cut, output_file_name, sources, ruIndex, max_hang, min_ovlp); output_unitig_graph(sg, coverage_cut, output_file_name, sources, ruIndex, max_hang, min_ovlp);
output_trio_unitig_graph(sg, coverage_cut, output_file_name, FATHER, sources, output_trio_unitig_graph(sg, coverage_cut, output_file_name, FATHER, sources,
reverse_sources, bubble_dist, (asm_opt.max_short_tip*2), 0.15, 3, ruIndex, reverse_sources, bubble_dist, (asm_opt.max_short_tip*2), 0.15, 3, ruIndex,
0.05, 0.9, max_hang, min_ovlp, 0); 0.05, 0.9, max_hang, min_ovlp, 0);
@@ -26089,13 +26089,11 @@ ma_sub_t **coverage_cut_ptr, int debug_g)
/*******************************for debug***************************************/ /*******************************for debug***************************************/
} }
rescue_bubble_by_chain(sg, coverage_cut, sources, reverse_sources, bubble_dist,
(asm_opt.max_short_tip*2), 0.15, 3, ruIndex, 0.05, 0.9, max_hang_length, mini_overlap_length, 10, gap_fuzz);
if (ha_opt_triobin(&asm_opt) && ha_opt_hic(&asm_opt)) if (ha_opt_triobin(&asm_opt) && ha_opt_hic(&asm_opt))
{ {
rescue_bubble_by_chain(sg, coverage_cut, sources, reverse_sources, bubble_dist,
(asm_opt.max_short_tip*2), 0.15, 3, ruIndex, 0.05, 0.9, max_hang_length, mini_overlap_length, 10, gap_fuzz);
char *buf = (char*)calloc(strlen(output_file_name) + 25, 1); char *buf = (char*)calloc(strlen(output_file_name) + 25, 1);
sprintf(buf, "%s.hic.bench", output_file_name); sprintf(buf, "%s.hic.bench", output_file_name);
benchmark_hic_graph(sg, coverage_cut, buf, sources, reverse_sources, bubble_dist, benchmark_hic_graph(sg, coverage_cut, buf, sources, reverse_sources, bubble_dist,
@@ -26104,9 +26102,6 @@ ma_sub_t **coverage_cut_ptr, int debug_g)
} }
else if (ha_opt_triobin(&asm_opt)) else if (ha_opt_triobin(&asm_opt))
{ {
rescue_bubble_by_chain(sg, coverage_cut, sources, reverse_sources, bubble_dist,
(asm_opt.max_short_tip*2), 0.15, 3, ruIndex, 0.05, 0.9, max_hang_length, mini_overlap_length, 10, gap_fuzz);
char *buf = (char*)calloc(strlen(output_file_name) + 25, 1); char *buf = (char*)calloc(strlen(output_file_name) + 25, 1);
sprintf(buf, "%s.dip", output_file_name); sprintf(buf, "%s.dip", output_file_name);
output_unitig_graph(sg, coverage_cut, buf, sources, ruIndex, max_hang_length, mini_overlap_length); output_unitig_graph(sg, coverage_cut, buf, sources, ruIndex, max_hang_length, mini_overlap_length);
@@ -26121,9 +26116,6 @@ ma_sub_t **coverage_cut_ptr, int debug_g)
} }
else if(ha_opt_hic(&asm_opt)) else if(ha_opt_hic(&asm_opt))
{ {
rescue_bubble_by_chain(sg, coverage_cut, sources, reverse_sources, bubble_dist,
(asm_opt.max_short_tip*2), 0.15, 3, ruIndex, 0.05, 0.9, max_hang_length, mini_overlap_length, 10, gap_fuzz);
char *buf = (char*)calloc(strlen(output_file_name) + 25, 1); char *buf = (char*)calloc(strlen(output_file_name) + 25, 1);
sprintf(buf, "%s.hic", output_file_name); sprintf(buf, "%s.hic", output_file_name);
output_hic_graph(sg, coverage_cut, buf, sources, reverse_sources, bubble_dist, output_hic_graph(sg, coverage_cut, buf, sources, reverse_sources, bubble_dist,
@@ -26139,9 +26131,6 @@ ma_sub_t **coverage_cut_ptr, int debug_g)
output_read_graph(sg, coverage_cut, output_file_name, n_read); output_read_graph(sg, coverage_cut, output_file_name, n_read);
} }
rescue_bubble_by_chain(sg, coverage_cut, sources, reverse_sources, bubble_dist,
(asm_opt.max_short_tip*2), 0.15, 3, ruIndex, 0.05, 0.9, max_hang_length, mini_overlap_length, 10, gap_fuzz);
output_contig_graph_primary_pre(sg, coverage_cut, output_file_name, sources, reverse_sources, output_contig_graph_primary_pre(sg, coverage_cut, output_file_name, sources, reverse_sources,
asm_opt.small_pop_bubble_size, asm_opt.max_short_tip, ruIndex, max_hang_length, mini_overlap_length); asm_opt.small_pop_bubble_size, asm_opt.max_short_tip, ruIndex, max_hang_length, mini_overlap_length);
+2 -1
View File
@@ -1049,7 +1049,8 @@ typedef struct{
double weight; double weight;
uint32_t uID:31, del:1; uint32_t uID:31, del:1;
uint64_t dis; uint64_t dis;
uint64_t occ:63, scaff:1; uint64_t occ;
///uint64_t occ:63, scaff:1;
///uint32_t enzyme; ///uint32_t enzyme;
} hc_edge; } hc_edge;
+9 -12
View File
@@ -11401,19 +11401,17 @@ int hic_short_align(const enzyme *fn1, const enzyme *fn2, ha_ug_index* idx)
return 1; return 1;
} }
int hic_short_align_back(const char *fn1, const char *fn2, ha_ug_index* idx)
int hic_short_align_debug(const char *fn1, const char *fn2, ha_ug_index* idx)
{ {
double index_time = yak_realtime(); double index_time = yak_realtime();
sldat_t sl; sldat_t sl;
gzFile fp1, fp2;
kvec_hc_edge back_hc_edge; kvec_hc_edge back_hc_edge;
kv_init(back_hc_edge.a); kv_init(back_hc_edge.a);
gzFile fp1, fp2;
if ((fp1 = gzopen(fn1, "r")) == 0) return 0; if ((fp1 = gzopen(fn1, "r")) == 0) return 0;
if ((fp2 = gzopen(fn2, "r")) == 0) return 0; if ((fp2 = gzopen(fn2, "r")) == 0) return 0;
sl.ks1 = kseq_init(fp1); sl.ks1 = kseq_init(fp1);
sl.ks2 = kseq_init(fp2); sl.ks2 = kseq_init(fp2);
sl.idx = idx; sl.idx = idx;
sl.link = idx->link; sl.link = idx->link;
sl.chunk_size = 20000000; sl.chunk_size = 20000000;
@@ -11430,20 +11428,20 @@ int hic_short_align_debug(const char *fn1, const char *fn2, ha_ug_index* idx)
// load_reads(&R2, fn2); // load_reads(&R2, fn2);
// test_reads(&R1, fn1); // test_reads(&R1, fn1);
/*******************************for debug************************************/ /*******************************for debug************************************/
fprintf(stderr, "+sl->hits.a.n: %u\n", (uint32_t)sl.hits.a.n);
kt_pipeline(3, worker_pipeline, &sl, 3); kt_pipeline(3, worker_pipeline, &sl, 3);
fprintf(stderr, "+sl->hits.a.n: %u\n", (uint32_t)sl.hits.a.n); fprintf(stderr, "-sl->hits.a.n: %u\n", (uint32_t)sl.hits.a.n);
dedup_hits(&sl.hits); fprintf(stderr, "fn1: %s, fn2: %s\n", fn1, fn2);
fprintf(stderr, "+sl->hits.a.n: %u\n", (uint32_t)sl.hits.a.n);
/*******************************for debug************************************/ /*******************************for debug************************************/
// sort_hits(&sl.hits); // sort_hits(&sl.hits);
// print_hits(idx, &sl.hits, fn1); // print_hits(idx, &sl.hits, fn1);
/*******************************for debug************************************/ /*******************************for debug************************************/
dedup_hits(&sl.hits);
write_hc_hits(&sl.hits, asm_opt.output_file_name); write_hc_hits(&sl.hits, asm_opt.output_file_name);
} }
///fprintf(stderr, "u.n: %d, uID_bits: %lu, pos_bits: %lu, sl.hits.a.n: %u\n", (uint32_t)idx->ug->u.n, idx->uID_bits, idx->pos_bits, (uint32_t)sl.hits.a.n); fprintf(stderr, "u.n: %d, uID_bits: %lu, pos_bits: %lu, sl.hits.a.n: %u\n", (uint32_t)idx->ug->u.n, idx->uID_bits, idx->pos_bits, (uint32_t)sl.hits.a.n);
H_partition hap; H_partition hap;
MT M; MT M;
@@ -11515,7 +11513,6 @@ int hic_short_align_debug(const char *fn1, const char *fn2, ha_ug_index* idx)
destory_G_partition(gp); free(gp); destory_G_partition(gp); free(gp);
kv_destroy(sl.hits.a); kv_destroy(sl.hits.a);
destory_bubbles(&bub); destory_bubbles(&bub);
kseq_destroy(sl.ks1); kseq_destroy(sl.ks1);
kseq_destroy(sl.ks2); kseq_destroy(sl.ks2);
gzclose(fp1); gzclose(fp1);
@@ -11537,7 +11534,7 @@ void hic_analysis(ma_ug_t *ug, asg_t* read_g, hc_links* link)
ug_index->link = link; ug_index->link = link;
///test_unitig_index(ug_index, ug); ///test_unitig_index(ug_index, ug);
///hic_short_align(asm_opt.hic_reads[0], asm_opt.hic_reads[1], ug_index); ///hic_short_align(asm_opt.hic_reads[0], asm_opt.hic_reads[1], ug_index);
hic_short_align_debug(asm_opt.hic_reads[0]->a[0], asm_opt.hic_reads[1]->a[0], ug_index); hic_short_align_back(asm_opt.hic_reads[0]->a[0], asm_opt.hic_reads[1]->a[0], ug_index);
destory_hc_pt_index(ug_index); destory_hc_pt_index(ug_index);
} }