-
Notifications
You must be signed in to change notification settings - Fork 0
/
Test.cc
85 lines (76 loc) · 2.31 KB
/
Test.cc
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
#include <string>
#include <stdio.h>
#include <locale.h>
#include <getopt.h>
#include <libgen.h>
#include <sys/time.h>
#include <queue>
#include <utility>
#include <functional>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <zlib.h>
#include <climits>
// #include <unordered_map>
#include <unistd.h>
#include "Common.h"
// #include "Parsers/BAMParser.h"
// #include "Parsers/SAMParser.h"
// #include "Fields/Sequence.h"
// #include "Fields/ReadName.h"
// #include "Fields/MappingFlag.h"
// #include "Fields/EditOperation.h"
// #include "Fields/MappingQuality.h"
// #include "Fields/QualityScore.h"
// #include "Fields/PairedEnd.h"
// #include "Fields/OptionalField.h"
using namespace std;
// bool optTest = false;
// bool optForce = false;
// bool optStdout = false;
// string optRef = "";
// string optInput = "";
// string optRange = "";
// string optOutput = "";
// size_t optBlock = 1000000;
// char optQuality = 0;
// char optLossy = 0;
// static const char *NAMES[8] = {
// "SQ","RN","MF","ML",
// "MQ","QQ","PE","OF"
// };
// #include "Sort.h"
int main (int argc, char **argv) {
// sortFile(argv[1], (string(argv[1]) + "._sort").c_str(), atoi(argv[2]) * MB);
// SAMParser *parser = new SAMParser(argv[1]);
// QualityScoreCompressor *sq = new QualityScoreCompressor(optBlock);
// string comment = parser->readComment();
// int64_t blockCount = 0;
// Array<uint8_t> outputBuffer(0, MB);
// while (parser->hasNext()) {
// string chr = parser->head();
// size_t _i;
// for (_i = 0; _i < optBlock
// && parser->hasNext()
// && parser->head() == chr; _i++) {
// const Record &rc = parser->next();
// sq->addRecord(rc.getQuality()/*, rc.getSequence()*/, rc.getMappingFlag());
// parser->readNext();
// }
// LOGN("\r Chr %-6s %5.2lf%% [%ld]", chr.c_str(), (100.0 * parser->fpos()) / parser->fsize(), blockCount + 1);
// sq->outputRecords(outputBuffer, 0, _i);
// // dz file
// size_t out_sz = outputBuffer.size();
// fwrite(&out_sz, sizeof(size_t), 1, stdout);
// if (out_sz)
// fwrite(outputBuffer.data(), 1, out_sz, stdout);
// blockCount++;
// }
// LOGN("\n");
// LOGN("QUAL: %'15lu\n", sq->compressedSize());
// delete sq;
// delete parser;
return 0;
}