-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinclude.h
176 lines (156 loc) · 4.61 KB
/
include.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
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
/*
Pheniqs : PHilology ENcoder wIth Quality Statistics
Copyright (C) 2018 Lior Galanti
NYU Center for Genetics and System Biology
Author: Lior Galanti <[email protected]>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PHENIQS_INCLUDE_H
#define PHENIQS_INCLUDE_H
/* Support for accouting for the illumina control number in FASTQ comment field
Currently disabled by default
#define PHENIQS_ILLUMINA_CONTROL_NUMBER
*/
/* Support for propegating SAM tags pheniqs does not directly interact with
Incomplete experimental code pending further reasearch into rules for transforming tags
#define PHENIQS_EXTENDED_SAM_TAG
*/
/* Support for propegating SAM alignment fields
Incomplete experimental code pending further reasearch into rules for transformtion
#define PHENIQS_SAM_ALIGNMENT
*/
/* STL dependencies */
#include <algorithm>
#include <cmath>
#include <condition_variable>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <errno.h>
#include <exception>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <math.h>
#include <mutex>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <thread>
#include <unistd.h>
#include <unordered_map>
#include <vector>
#include <stddef.h>
#include <regex>
using std::cerr;
using std::condition_variable;
using std::cin;
using std::cout;
using std::endl;
using std::exception;
using std::fixed;
using std::hash;
using std::hex;
using std::istream;
using std::ifstream;
using std::int16_t;
using std::int32_t;
using std::int64_t;
using std::int8_t;
using std::invalid_argument;
using std::ios_base;
using std::istreambuf_iterator;
using std::list;
using std::lock_guard;
using std::log10;
using std::make_pair;
using std::map;
using std::max;
using std::min;
using std::move;
using std::mutex;
using std::numeric_limits;
using std::ostream;
using std::out_of_range;
using std::pair;
using std::recursive_mutex;
using std::set;
using std::setprecision;
using std::setw;
using std::left;
using std::right;
using std::size_t;
using std::string;
using std::thread;
using std::to_string;
using std::uint16_t;
using std::uint32_t;
using std::uint64_t;
using std::uint8_t;
using std::unique_lock;
using std::unordered_map;
using std::vector;
using std::regex;
using std::smatch;
using std::regex_match;
/* zlib dependencies
Used for probing gzip compressed files */
#include <zlib.h>
/* RapidJSON dependencies */
#define RAPIDJSON_NO_SIZETYPEDEFINE
#define RAPIDJSON_SCHEMA_USE_INTERNALREGEX 0
namespace rapidjson { typedef ::std::size_t SizeType; }
#include <rapidjson/document.h>
#include <rapidjson/error/en.h>
#include <rapidjson/pointer.h>
#include <rapidjson/prettywriter.h>
#include <rapidjson/schema.h>
#include <rapidjson/stringbuffer.h>
#include <rapidjson/filewritestream.h>
using rapidjson::Document;
using rapidjson::Pointer;
using rapidjson::PrettyWriter;
using rapidjson::SizeType;
using rapidjson::StringBuffer;
using rapidjson::StringRef;
using rapidjson::Type;
using rapidjson::Value;
using rapidjson::SchemaDocument;
using rapidjson::SchemaValidator;
using rapidjson::kArrayType;
using rapidjson::kNullType;
using rapidjson::kObjectType;
using rapidjson::kStringType;
/* HTSLib dependencies
We disable warnings from HTSLib to not litter the output until type comparisson warnings are resolved */
#ifdef __GNUC__
#pragma GCC system_header
#endif
#include <htslib/bgzf.h>
#include <htslib/hts_endian.h>
#include <htslib/hfile.h>
#include <htslib/hts.h>
#include <htslib/kseq.h>
#include <htslib/kstring.h>
#include <htslib/sam.h>
#include <htslib/thread_pool.h>
/* Float precision
The number of significant decimal digits when writing to output
see https://en.wikipedia.org/wiki/Double-precision_floating-point_format#IEEE_754_double-precision_binary_floating-point_format:_binary64 */
#define PHENIQS_FLOAT_PRECISION 15
/* this should allow pheniqs to build against earlier htslib */
typedef bam_hdr_t sam_hdr_t;
#endif /* PHENIQS_INCLUDE_H */