-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsmoother.hpp
62 lines (51 loc) · 1.31 KB
/
smoother.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef SNP_HPP
#define SNP_HPP
#include <assert.h>
#include <chrono>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <omp.h>
#include <pthread.h>
#include <set>
#include <string>
#include <thread>
#include <unordered_map>
#include <vector>
#include <zlib.h>
#include <spdlog/spdlog.h>
#include "bam.hpp"
#include "chromosomes.hpp"
#include "config.hpp"
#include "fastq.hpp"
using namespace std;
class Smoother {
public:
// Loading BAM file
samFile *bam_file;
bam_hdr_t *bam_header;
hts_idx_t *bam_index;
// output BAM file
samFile *out_bam_file;
vector<vector<vector<bam1_t *>>> bam_entries;
vector<vector<vector<int>>> read_seq_max_lengths;
vector<vector<vector<char *>>> read_seqs;
vector<vector<vector<char *>>> new_read_seqs;
vector<vector<vector<uint8_t *>>> new_read_quals;
vector<vector<vector<int>>> new_read_seq_max_lengths;
set<string> warned_chromosomes;
void run();
bool load_batch_bam(int p);
void process_batch(vector<bam1_t *> bam_entries, int, int);
void smooth_read(bam1_t *alignment, char *read_seq, int, int, int);
Configuration *config;
private:
double global_num_bases = 1;
double global_num_mismatch;
double global_num_indel;
double expected_mismatch_rate = 0.002;
int num_ignored_reads = 0;
int reads_processed = 0;
};
#endif