-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProcessor.hpp
More file actions
101 lines (85 loc) · 2.19 KB
/
Processor.hpp
File metadata and controls
101 lines (85 loc) · 2.19 KB
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
//
// Created by Walfred (Wangfei) MA at the University of Southern California,
// Mark Chaisson Lab on 2/13/23.
//
// Licensed under the MIT License.
// If you use this code, please cite our work.
//
#ifndef Processor_hpp
#define Processor_hpp
#include <atomic>
#include <mutex>
#include <thread>
#include <atomic>
#include <memory>
#include <stdio.h>
#include <string>
#include <vector>
#include <chrono>
#include "config.hpp"
#include "FastaReader.hpp"
#include "FastqReader.hpp"
#include "KtableReader.hpp"
#include "KmerMatrix.hpp"
#include "KmerCounter.hpp"
#include "KmerWindow.hpp"
#include "Regression.hpp"
#include "PriorData.hpp"
#include "Genotyper.hpp"
using namespace std;
class Processor
{
public:
Processor
(
std::vector<std::string>& infiles,
std::vector<std::string>& outfiles,
std::vector<float> &d,
std::string &mfile,
std::string &bfile,
std::unordered_set<std::string> &g,
std::vector<char *> &r,
const int w,
const int n,
const int N,
string ref=""
):
inputfiles(infiles),
outputfiles(outfiles),
depths(d),
genes(g),
matrixfile(mfile),
backgroundfile(bfile),
priordata_manager(mfile, (n+1)/2),
regions(r),
window(w),
nthreads(n),
Nsubthreads(N),
reference(ref)
{};
void Run();
void Load();
void Onethread();
const std::vector<std::string>& inputfiles;
const std::vector<std::string>& outputfiles;
const std::string &matrixfile;
const std::string &backgroundfile;
std::vector<char *> ®ions;
const std::vector<float> &depths;
const std::unordered_set<std::string> &genes;
const int window;
const int nthreads;
const int Nsubthreads;
std::string reference;
private:
uint totalkmers, totalgroups;
std::atomic_uint restfileindex = {0};
std::mutex Threads_lock;
std::mutex Threads_lock2;
//kmer_hash_type kmer_hash;
//kmer_hash_type_mul kmer_multi_hash;
//unordered_set<ull, Hash10M> backgroud;
KmerCounter *Counter =NULL;
PriorData priordata_manager;
};
#endif /* Processor_hpp */