fast-bwa/fmt_idx.h

44 lines
1.1 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/*
Description: 通过fmt-idx数据结构对seed过程进行加速fm-index twice search in one time
Copyright : All right reserved by ICT
Author : Zhang Zhonghai
Date : 2023/12/24
*/
#ifndef BWA_FMT_IDX_H
#define BWA_FMT_IDX_H
#include <stdint.h>
#include <stddef.h>
#include "bwt.h"
typedef uint64_t bwtint_t;
/*
ignore the first 12 bases, and give the entrence directly
*/
typedef struct {
uint8_t range[9]; // 前36位表示起始行后36位表示结束行fm-index索引行
} kmer_range_t;
typedef struct
{
bwtint_t primary; // S^{-1}(0), or the primary index of BWT
bwtint_t L2[5]; // C(), cumulative count
bwtint_t seq_len; // sequence length
bwtint_t bwt_size; // size of bwt, about seq_len/4
uint32_t *bwt; // BWT
// kmer entry
kmer_range_t *kmer_range;
// occurance array, separated to two parts
uint32_t cnt_table[256];
// suffix array
int sa_intv;
bwtint_t n_sa;
bwtint_t *sa;
} bwtd_t;
// 创建fmt-index索引数据
void BuildBwtdFromBwt(bwt_t *bwt, bwtd_t **bwtd_p);
#endif