-
Notifications
You must be signed in to change notification settings - Fork 67
/
Aligner.h
103 lines (74 loc) · 2.75 KB
/
Aligner.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
/*++
Module Name:
Aligner.h
Abstract:
Header for SNAP genome aligner
Authors:
Bill Bolosky, August, 2011
Environment:
User mode service.
This class is NOT thread safe. It's the caller's responsibility to ensure that
at most one thread uses an instance at any time.
Revision History:
Adapted from Matei Zaharia's Scala implementation.
--*/
#pragma once
#include "options.h"
#include "Genome.h"
#include "GenomeIndex.h"
#include "Histogram.h"
#include "Read.h"
#include "Seed.h"
enum AlignmentResult {NotFound, CertainHit, SingleHit, MultipleHits, UnknownAlignment}; // BB: Changed Unknown to UnknownAlignment because of a conflict w/Windows headers
inline const char *AlignmentResultToString(AlignmentResult result) {
switch (result) {
case NotFound: return "NotFound";
case CertainHit: return "SingleHit"; // Just for now
case SingleHit: return "SingleHit";
case MultipleHits: return "MultipleHits";
case UnknownAlignment: return "Unknown";
default: return "Unknown alignment result type";
}
}
// Does an AlignmentResult represent a single location?
inline bool isOneLocation(AlignmentResult result) {
return result == SingleHit || result == CertainHit;
}
extern bool doAlignerPrefetch;
class Aligner {
public:
virtual ~Aligner() {}
virtual AlignmentResult
AlignRead(
Read *read,
unsigned *genomeLocation,
bool *hitIsRC,
int *finalScore = NULL,
int *mapq = NULL) = 0;
virtual void
ComputeHitDistribution(
Read *read,
unsigned correctGenomeLocation,
bool correctHitIsRC,
unsigned *hitCountBySeed,
unsigned *rcHitCountBySeed,
unsigned &nSeedsApplied,
unsigned &nRCSeedsApplied,
unsigned *hitsCountsContainingCorrectLocation) = 0;
virtual _int64 getNHashTableLookups() const = 0;
virtual _int64 getLocationsScored() const = 0;
virtual _int64 getNHitsIgnoredBecauseOfTooHighPopularity() const = 0;
virtual _int64 getNReadsIgnoredBecauseOfTooManyNs() const = 0;
virtual _int64 getNIndelsMerged() const = 0;
virtual void addIgnoredReads(_int64 newlyIgnoredReads) = 0;
#if MAINTAIN_HISTOGRAMS
virtual const Histogram *getLVHistogram() const = 0;
virtual const Histogram *getLookupHistogram() const = 0;
virtual const Histogram *getLVHistogramForMulti() const = 0;
virtual const Histogram *getLVHistogramWhenBestFound() const = 0;
#endif // MAINTAIN_HISTOGRAMS
virtual const char *getRCTranslationTable() const = 0;
virtual int getMaxK() const = 0;
virtual int getConfDiff() const = 0;
virtual const char *getName() const = 0;
};