-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathcorrect.hpp
48 lines (39 loc) · 1.34 KB
/
correct.hpp
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
#ifndef _rattle_correct_h
#define _rattle_correct_h
#include <unordered_map>
#include <string>
#include "fasta.hpp"
#include "cluster.hpp"
struct pos_info_t {
char nt;
double err;
int occ;
int total_occ;
};
typedef std::unordered_map<char, pos_info_t> map_nt_info_t;
typedef std::vector<std::string> msa_t;
struct pack_to_correct_t {
int original_cluster_id;
read_set_t reads;
};
struct corrected_pack_t {
int original_cluster_id;
std::string consensus;
read_set_t reads;
read_set_t uncorrected_reads;
};
struct correction_results_t {
read_set_t corrected;
read_set_t uncorrected;
read_set_t consensi;
};
struct consensus_vector_t {
std::vector<map_nt_info_t> nt_info;
std::vector<char> consensus_nt;
};
consensus_vector_t generate_consensus_vector(const read_set_t &reads, const msa_t &aln, int n_threads);
corrected_pack_t correct_read_pack(const read_set_t &reads, const msa_t &aln, double min_occ, double gap_occ, double err_ratio, int n_threads);
correction_results_t correct_reads(const cluster_set_t &clusters, read_set_t &reads, double min_occ, double gap_occ, double err_ratio, int split, int min_reads, int n_threads, bool verbose, std::vector<std::string> labels);
void fix_msa_ends(read_set_t &reads, msa_t &aln);
std::vector<std::string> splitString(std::string str, char delimiter);
#endif