-
Notifications
You must be signed in to change notification settings - Fork 0
/
state.h
178 lines (117 loc) · 3.58 KB
/
state.h
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
//
// Created by ylf9811 on 2021/7/8.
//
#ifndef RERABBITQC_STATE_H
#define RERABBITQC_STATE_H
#include <cstring>
#include <fstream>
#include <iostream>
#include <sstream>
#include <unordered_map>
#include "Globals.h"
#include "Reference.h"
#include "cmdinfo.h"
#include "nthash.hpp"
struct node {
int pre, cnt;
uint64_t v;
int slen;
std::string seq;
int64_t *dist;
};
class State {
public:
State(CmdInfo *cmd_info, int seq_len, int qul_range, bool is_reed2);
State(const char *info, int info_len, CmdInfo *cmd_info, int seq_len, int qul_range, bool is_reed2);
std::string ParseString();
~State();
void StateInfo(neoReference &ref);
void StateORP(neoReference &ref);
void ExtendBuffer(int old_len, int new_len);
void Summarize();
static State *MergeStates(const std::vector<State *> &states);
static State *MergeStatesSlave(const std::vector<State *> &states);
static void PrintStates(const State *state);
static void PrintFilterResults(const State *state);
static void PrintAdapterToFile(const State *state);
static std::string list2string(int64_t *list, int size);
static std::string list2string(double *list, int size);
void HashInsert(const char *seq, int len, int eva_len);
void HashState();
//void HashQueryAndAdd(uint64_t now, int offset, int len, int eva_len);
bool HashQueryAndAdd(uint64_t now, int offset, int len, int eva_len);
int *GetHeadHashGraph() const;
node *GetHashGraph() const;
int GetHashNum() const;
int64_t GetQ20Bases() const;
int64_t GetQ30Bases() const;
int64_t GetLines() const;
int GetMallocSeqLen() const;
int GetQulRange() const;
int GetRealSeqLen() const;
int GetKmerBufLen() const;
int *GetPosQul() const;
int *GetPosCnt() const;
int *GetLenCnt() const;
int *GetGcCnt() const;
int *GetQulCnt() const;
int64_t *GetKmer() const;
int64_t GetKmerMin() const;
int64_t GetKmerMax() const;
bool IsHasSummarize() const;
int64_t GetTotBases() const;
int64_t GetGcBases() const;
double GetOrpCost() const;
double GetAvgLen() const;
void AddPassReads();
void AddFailShort();
void AddFailLong();
void AddFailN();
void AddFailLowq();
void AddTrimAdapter();
void AddTrimAdapterBase(int cnt);
std::unordered_map<std::string, int> GetAdapterMap();
CmdInfo *GetCmdInfo() const;
//private:
public:
CmdInfo *cmd_info_;
int64_t q20bases_;
int64_t q30bases_;
int64_t lines_;
int malloc_seq_len_;
int qul_range_;
int real_seq_len_;
int kmer_buf_len_;
int *pos_qul_;
int *pos_cnt_;
int *len_cnt_;
int *gc_cnt_;
int *qul_cnt_;
int64_t *kmer_;
int64_t kmer_min_;
int64_t kmer_max_;
int64_t tot_bases_;
int64_t gc_bases_;
double avg_len;
bool has_summarize_;
int *head_hash_graph_;
node *hash_graph_;
int hash_num_;
bool is_read2_;
bool do_over_represent_analyze_;
int over_representation_sampling_;
int64_t over_representation_qcnt_;
int64_t over_representation_pcnt_;
int64_t *bf_zone_;
double orpCost;
public:
int64_t pass_reads_;
int64_t fail_short_;
int64_t fail_long_;
int64_t fail_N_;
int64_t fail_lowq_;
int64_t trim_adapter_;
int64_t trim_adapter_bases_;
std::unordered_map<std::string, int> adapter_map_;
};
#endif//RERABBITQC_STATE_H