1 #ifndef KALLISTO_COMMON_H
2 #define KALLISTO_COMMON_H
3
4 #define KALLISTO_VERSION "0.46.1"
5
6 #include <string>
7 #include <vector>
8 #include <iostream>
9
10 #ifdef _WIN64
11 typedef unsigned int uint;
12 #endif
13
14 struct BUSOptionSubstr {
BUSOptionSubstrBUSOptionSubstr15 BUSOptionSubstr() : fileno(-1), start(0), stop(0) {}
BUSOptionSubstrBUSOptionSubstr16 BUSOptionSubstr(int f, int a, int b) : fileno(f), start(a), stop(b) {}
17 int fileno;
18 int start;
19 int stop;
20 };
21
22 struct BUSOptions {
23 int nfiles;
24
25 BUSOptionSubstr umi;
26 std::vector<BUSOptionSubstr> bc;
27 BUSOptionSubstr seq;
28
getBCLengthBUSOptions29 int getBCLength() const {
30 int r =0 ;
31 if (!bc.empty()) {
32 for (auto& b : bc) {
33 if (b.start < 0) {
34 return 0;
35 } else {
36 r += b.stop - b.start;
37 }
38 }
39 }
40 return r;
41 }
42
getUMILengthBUSOptions43 int getUMILength() const {
44 if (umi.start >= 0) {
45 return umi.stop - umi.start;
46 } else {
47 return 0;
48 }
49 }
50 };
51
52 struct ProgramOptions {
53 bool verbose;
54 int threads;
55 std::string index;
56 int k;
57 int iterations;
58 std::string output;
59 int skip;
60 size_t seed;
61 double fld;
62 double sd;
63 int min_range;
64 int bootstrap;
65 std::vector<std::string> transfasta;
66 bool batch_mode;
67 bool bus_mode;
68 BUSOptions busOptions;
69 bool pseudo_quant;
70 bool bam;
71 bool num;
72 std::string batch_file_name;
73 std::vector<std::vector<std::string>> batch_files;
74 std::vector<std::string> batch_ids;
75 std::vector<std::string> files;
76 std::vector<std::string> umi_files;
77 bool plaintext;
78 bool write_index;
79 bool single_end;
80 bool strand_specific;
81 bool peek; // only used for H5Dump
82 bool bias;
83 bool pseudobam;
84 bool genomebam;
85 bool make_unique;
86 bool fusion;
87 enum class StrandType {None, FR, RF};
88 StrandType strand;
89 bool umi;
90 std::string gfa; // used for inspect
91 bool inspect_thorough;
92 bool single_overhang;
93 std::string gtfFile;
94 std::string chromFile;
95 std::string bedFile;
96 std::string technology;
97
ProgramOptionsProgramOptions98 ProgramOptions() :
99 verbose(false),
100 threads(1),
101 k(31),
102 iterations(500),
103 skip(1),
104 seed(42),
105 fld(0.0),
106 sd(0.0),
107 min_range(1),
108 bootstrap(0),
109 batch_mode(false),
110 bus_mode(false),
111 pseudo_quant(false),
112 bam(false),
113 num(false),
114 plaintext(false),
115 write_index(false),
116 single_end(false),
117 strand_specific(false),
118 peek(false),
119 bias(false),
120 pseudobam(false),
121 genomebam(false),
122 make_unique(false),
123 fusion(false),
124 strand(StrandType::None),
125 umi(false),
126 inspect_thorough(false),
127 single_overhang(false)
128 {}
129 };
130
131 std::string pretty_num(size_t num);
132 std::string pretty_num(int64_t num);
133 std::string pretty_num(int num);
134
135
136
137
138 #endif // KALLISTO_COMMON_H
139