1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
/*
This file is a part of KMC software distributed under GNU GPL 3 licence.
The homepage of the KMC project is http://sun.aei.polsl.pl/kmc
Authors: Marek Kokot
Version: 3.1.1
Date : 2019-05-19
*/
#ifndef _KMC_HEADER_H
#define _KMC_HEADER_H
#include "defs.h"
#include <string>
#include <iostream>
//************************************************************************************************************
// CKMC_header - represents header of KMC database.
//************************************************************************************************************
struct CKMC_header
{
public:
uint32 kmer_len = 0;
uint32 mode = 0;
uint32 counter_size = 0;
uint32 lut_prefix_len = 0;
uint32 signature_len = 0; //only for kmc2
uint32 min_count = 0;
uint32 max_count = 0;
uint64 total_kmers = 0;
bool both_strands = true;
uint32 db_version = 0;
uint32 header_offset = 0;
uint64 file_size = 0;
uint32 no_of_bins = 0; //only for kmc2
bool IsKMC2()const
{
return db_version == 0x200;
}
CKMC_header(std::string file_name);
private:
template<typename T> void load_uint(FILE* file, T& res)
{
res = 0;
for (uint32 i = 0; i < sizeof(T); ++i)
res += (T)getc(file) << (i << 3);
}
};
#endif
// ***** EOF
|