XT-neighbor
src
xtn.h
Go to the documentation of this file.
1
#include <vector>
8
const
int
MAX_COMPRESSED_LENGTH
= 18;
10
int
verboseGlobal
= 0;
12
const
char
LEVENSHTEIN
= 0;
14
const
char
HAMMING
= 1;
15
19
struct
Int3
{
20
unsigned
int
entry
[3] = {0, 0, 0};
21
__device__ __host__
22
bool
operator==
(
const
Int3
& t)
const
{
23
return
(entry[0] == t.
entry
[0]) && (entry[1] == t.
entry
[1]) && (entry[2] == t.
entry
[2]);
24
}
25
};
26
30
struct
Int2
{
31
int
x = 0, y = 0;
32
__device__ __host__
33
bool
operator==
(
const
Int2
& t)
const
{
34
return
(x == t.
x
) && (y == t.
y
);
35
}
36
};
37
41
struct
SeqInfo
{
42
int
frequency,
repertoire
, originalIndex;
43
__device__
44
bool
operator==
(
const
SeqInfo
& t)
const
;
45
};
46
50
struct
XTNArgs
{
51
int
distance = 1;
52
int
verbose = 0;
53
char
* seqPath = NULL;
54
int
seqLen = 0;
55
char
* outputPath = NULL;
56
char
measure =
LEVENSHTEIN
;
57
char
* infoPath = NULL;
58
int
infoLen = 0;
59
int
airr = 0;
60
};
61
65
struct
MemoryContext
{
66
size_t
gpuSize = 0;
67
size_t
ramSize = 0;
68
int
bandwidth1 = 0;
69
int
bandwidth2 = 0;
70
int
chunkSize = 0;
71
#ifdef TEST_ENV
72
int
histogramSize = 16;
73
int
maxThroughputExponent = 7;
74
#else
75
int
histogramSize = 65536;
76
int
maxThroughputExponent = 0;
77
#endif
78
};
79
83
struct
XTNOutput
{
84
Int2
* indexPairs = NULL;
85
char
* pairwiseDistances = NULL;
86
size_t
* pairwiseFrequencies = NULL;
87
int
len = 0;
88
};
89
93
enum
ReturnCode
{
SUCCESS
,
ERROR
,
EXIT
};
94
95
class
SeqArray
{
96
private
:
97
unsigned
int
*offsets, *offsets_d = NULL;
98
std::vector<char> seqs;
99
char
* seqs_d = NULL;
100
int
size = 0;
101
int
maxSize = 0;
102
103
public
:
104
SeqArray
(
int
seqLen);
105
int
append(
char
* inputStr);
106
__device__
107
int
getItem(
int
index,
char
* &result);
108
int
getItemCPU(
int
index,
char
* &result);
109
void
toDevice();
110
void
destroy();
111
int
getSize();
112
char
* getSeqs_d();
113
unsigned
int
* getOffsets_d();
114
};
115
124
void
xtn_perform
(
XTNArgs
args,
SeqArray
seqArr,
SeqInfo
* seqInfo,
void
callback (
XTNOutput
));
EXIT
Definition:
xtn.h:93
MAX_COMPRESSED_LENGTH
const int MAX_COMPRESSED_LENGTH
CDR3 length limit for compression.
Definition:
xtn.h:8
Int2::operator==
__device__ __host__ bool operator==(const Int2 &t) const
Definition:
xtn.h:33
verboseGlobal
int verboseGlobal
control printing of each method
Definition:
xtn.h:10
Int2::x
int x
Definition:
xtn.h:31
Int3::operator==
__device__ __host__ bool operator==(const Int3 &t) const
Definition:
xtn.h:22
SeqArray
Definition:
xtn.h:95
Int3
12-byte integer representation for CDR3 string.
Definition:
xtn.h:19
SeqInfo::repertoire
int repertoire
Definition:
xtn.h:42
Int2
8-byte integer representation for pair of sequence index.
Definition:
xtn.h:30
xtn_perform
void xtn_perform(XTNArgs args, SeqArray seqArr, SeqInfo *seqInfo, void callback(XTNOutput))
the algorithm's API.
HAMMING
const char HAMMING
enum for distant type
Definition:
xtn.h:14
XTNOutput
bundled representation for algorithm's output.
Definition:
xtn.h:83
ReturnCode
ReturnCode
control-flow representation.
Definition:
xtn.h:93
SeqInfo
Information related to a sequence.
Definition:
xtn.h:41
Int3::entry
unsigned int entry[3]
Definition:
xtn.h:20
LEVENSHTEIN
const char LEVENSHTEIN
enum for distant type
Definition:
xtn.h:12
MemoryContext
bundled representation for memory constraints and info.
Definition:
xtn.h:65
ERROR
Definition:
xtn.h:93
Int2::y
int y
Definition:
xtn.h:31
SUCCESS
Definition:
xtn.h:93
XTNArgs
bundled representation for command line arguments.
Definition:
xtn.h:50
Generated by
1.8.13