forked from vadanamu/DeepRM
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRecordMerger.h
More file actions
67 lines (57 loc) · 2.26 KB
/
Copy pathRecordMerger.h
File metadata and controls
67 lines (57 loc) · 2.26 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
/***************************************************************************************************
*
* Copyright (C) 2025 Genome4me Incorporated - All Rights Reserved.
*
* This software, including its source code, embedded concepts, and associated
* documentation, is proprietary to Genome4me Incorporated and is protected
* under trade secret and copyright law. Unauthorized use, copying, modification,
* distribution, or disclosure to third parties, in whole or in part, is
* strictly prohibited unless prior written permission is granted by Genome4me
* Incorporated. Any such unauthorized actions constitute an infringement of
* the intellectual property rights of Genome4me Incorporated. For licensing
* inquiries or permissions, please contact Genome4me Incorporated.
*
**************************************************************************************************/
#pragma once
#include "../bam/BamReader.h"
#include "../pod5/Pod5Reader.h"
#include "../utils/Utils.h"
#include <vector>
#include <memory>
using namespace std;
namespace deeprm {
struct ProcessedRecord {
string read_id;
vector<uint16_t> segment_len_arr;
vector<double> signal_token;
vector<uint8_t> kmer_token;
vector<float> dwell_motor_token;
vector<float> dwell_pore_token;
vector<uint8_t> bq_token;
int64_t label_id;
};
class RecordMerger {
private:
NormalizationFactors norm_factors;
int cb_len;
int kmer_len;
int max_token_len;
int sampling;
int dwell_shift;
int sig_window;
uint64_t label_div;
vector<BamRecord> bam_records;
vector<Pod5RecordMeta> pod5_meta_records;
public:
RecordMerger(const NormalizationFactors& nf, int cb_len, int kmer_len,
int max_token_len, int sampling, int dwell_shift, int sig_window,
uint64_t label_div);
bool process_merged_record_with_meta(const BamRecord& bam_rec,
const Pod5RecordMeta& pod5_meta,
vector<ProcessedRecord>& output) const;
void add_bam_records(vector<BamRecord>&& records);
void add_pod5_meta_records(vector<Pod5RecordMeta>&& meta_records);
vector<ProcessedRecord> merge_and_process_with_meta();
void clear();
};
} // namespace deeprm