From 10db6b0434191ccd323b72a7429cce230f88ca63 Mon Sep 17 00:00:00 2001 From: Heng Li Date: Thu, 4 May 2017 17:45:19 +0800 Subject: [PATCH] wrong HPC --- map.c | 8 +++++--- sketch.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/map.c b/map.c index 88d62e1..2c22899 100644 --- a/map.c +++ b/map.c @@ -10,7 +10,7 @@ void mm_mapopt_init(mm_mapopt_t *opt) { memset(opt, 0, sizeof(mm_mapopt_t)); - opt->n_frag_mini = 100; + opt->n_frag_mini = 1000; opt->max_occ_frac = 1e-5f; opt->mid_occ_frac = 2e-4f; opt->sdust_thres = 0; @@ -261,7 +261,7 @@ void mm_map_frag(const mm_mapopt_t *opt, const mm_idx_t *mi, mm_tbuf_t *b, uint3 } } radix_sort_128x(a, a + n_a); -// for (i = 0; i < n_a; ++i) printf("%c\t%d\t%d\n", "+-"[a[i].x>>63], (uint32_t)a[i].x>>1, (uint32_t)a[i].y); + //for (i = 0; i < n_a; ++i) printf("%c\t%s\t%d\t%d\n", "+-"[a[i].x>>63], mi->seq[a[i].x<<1>>33].name, (uint32_t)a[i].x>>1, (uint32_t)a[i].y); t = (int*)kmalloc(b->km_fixed, (n_a + opt->min_cnt - 1) / opt->min_cnt * sizeof(int)); n_t = mm_liss(opt->radius, opt->min_cnt, b->km_fixed, n_a, a, t); @@ -278,7 +278,9 @@ void mm_map_frag(const mm_mapopt_t *opt, const mm_idx_t *mi, mm_tbuf_t *b, uint3 else if (t[i] > max2) max2 = t[i]; off += t[i]; } - printf("%s\t%d\t%d\t", qname, max, max2); + if (a_st) printf("%s:%d-%d", qname, (uint32_t)a_st->y, (uint32_t)(a_en-1)->y); + else printf("%s:*", qname); + printf("\t%d\t%d\t", max, max2); if (max_i >= 0) printf("%s:%d-%d", mi->seq[a_st->x<<1>>33].name, (uint32_t)a_st->x>>1, (uint32_t)(a_en-1)->x>>1); else printf("*"); printf("\t%d\t%d\t%d\t%d\t%d\n", n_tot, n_low, s_low, n, n_t); diff --git a/sketch.c b/sketch.c index c5da0d9..b141cba 100644 --- a/sketch.c +++ b/sketch.c @@ -112,7 +112,7 @@ void mm_sketch(void *km, const char *str, int len, int w, int k, uint32_t rid, i info.x = hash64(kmer[z], mask) << 8 | kmer_span; info.y = (uint64_t)rid<<32 | (uint32_t)i<<1 | z; } - } else l = 0, tq.count = tq.front = 0; + } else l = 0, tq.count = tq.front = 0, kmer_span = 0; buf[buf_pos] = info; // need to do this here as appropriate buf_pos and buf[buf_pos] are needed below if (l == w + k - 1) { // special case for the first window - because identical k-mers are not stored yet for (j = buf_pos + 1; j < w; ++j)