From 123aceb6a6300fcb092672f57f70fb00cd660022 Mon Sep 17 00:00:00 2001 From: zzh Date: Tue, 2 Apr 2024 07:49:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86fmt=E5=92=8Ckmer=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E5=88=B0=E5=BB=BA=E7=B4=A2=E5=BC=95=E7=9A=84=E8=BF=87=E7=A8=8B?= =?UTF-8?q?=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bwtindex.c | 14 +++++++++++--- main.c | 2 ++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/bwtindex.c b/bwtindex.c index 5973332..cf07e8a 100644 --- a/bwtindex.c +++ b/bwtindex.c @@ -230,7 +230,7 @@ int bwa_bwt2bytesa(int argc, char *argv[]) // the "bwt2bytesa" command int bwa_bwt2fmt(int argc, char *argv[]) // create fmt index { bwt_t *bwt; - char buf[1024]; + //char buf[1024]; if (optind + 1 > argc) { fprintf(stderr, "Usage: fastbwa bwt2fmt \n"); return 1; @@ -369,14 +369,22 @@ int bwa_idx_build(const char *fa, const char *prefix, int algo_type, int block_s bwt_dump_sa(str3, bwt); bwt_destroy(bwt); if (bwa_verbose >= 3) fprintf(stderr, "%.2f sec\n", (float)(clock() - t) / CLOCKS_PER_SEC); - { + { + t = clock(); // build FMT-Index FMTIndex *fmt; strcpy(str, prefix); strcat(str, ".fmt"); fmt = create_fmt_from_bwt(bwt); dump_fmt(str, fmt); // create Kmer-Hash - + fmt_create_kmer_index(fmt); + strcpy(str, prefix); strcat(str, ".kmer"); + fmt_dump_kmer_idx(str, &fmt->kmer_hash); + if (bwa_verbose >= 3) fprintf(stderr, "%.2f sec\n", (float)(clock() - t) / CLOCKS_PER_SEC); + // create byte sa + bwt_cal_byte_sa(bwt, 4); + strcpy(str, prefix); strcat(str, ".bytesa"); + bwt_dump_byte_sa(str, bwt); } } free(str3); free(str2); free(str); diff --git a/main.c b/main.c index 86b8ab1..718e7c0 100644 --- a/main.c +++ b/main.c @@ -80,6 +80,8 @@ static int usage() fprintf(stderr, " bwtupdate update .bwt to the new format\n"); fprintf(stderr, " bwt2sa generate SA from BWT and Occ\n"); fprintf(stderr, " bwt2bytesa generate SA(using byte array) from BWT and Occ\n"); + fprintf(stderr, " bwt2fmt generate FMT-Index from BWT\n"); + fprintf(stderr, " buildkmer generate kmer index from FMT\n"); fprintf(stderr, "\n"); fprintf(stderr, "Note: To use BWA, you need to first index the genome with `bwa index'.\n"