-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcount.h
25 lines (20 loc) · 1.44 KB
/
count.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
#ifndef COUNT_H
#define COUNT_H
#include "common.h"
#include "argparse.h"
// struct to store counts
struct counts_t {
std::vector<std::array<COUNT_T, 5>> pos_counts; // position base counts
std::unordered_map<uint32_t, std::unordered_map<std::string, COUNT_T>> ins_counts; // insertion counts
};
// compute position and insertion counts
counts_t compute_counts(const char* const in_reads_fn, std::string const & ref, uint8_t const min_qual, std::vector<std::pair<std::pair<uint32_t,uint32_t>, std::pair<uint32_t,uint32_t>>> const & min_max_primer_inds, args_t const & user_args);
// compute consensus genome sequence from counts
std::string compute_consensus(std::vector<std::array<COUNT_T, 5>> const & pos_counts, std::unordered_map<uint32_t, std::unordered_map<std::string, COUNT_T>> & ins_counts, args_t const & user_args);
// write pos_counts as TSV file
void write_pos_counts_tsv(std::vector<std::array<COUNT_T, 5>> const & pos_counts, std::ostream & out_file, char delim='\t');
void write_pos_counts_tsv(std::vector<std::array<COUNT_T, 5>> const & pos_counts, const char* const out_fn, char delim='\t');
// write ins_counts as JSON file
void write_ins_counts_json(std::unordered_map<uint32_t, std::unordered_map<std::string, COUNT_T>> & ins_counts, std::ostream & out_file);
void write_ins_counts_json(std::unordered_map<uint32_t, std::unordered_map<std::string, COUNT_T>> & ins_counts, const char* const out_fn);
#endif