-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsoftclippedread.h
executable file
·75 lines (56 loc) · 2.4 KB
/
softclippedread.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
#ifndef SOFTCLIPPEDREAD_H
#define SOFTCLIPPEDREAD_H
#include "ChromosomeRegion.h"
#include "ChromoFragment.h"
#include "CallParams.h"
#include "CallResult.h"
// #include "SingleFragAlnResult.h"
#include "DoubleFragsAlnResult.h"
#include "sequencefetcher.h"
const double MIN_PERCENT_IDENTITY = 95.0;
class ISoftClippedRead
{
public:
ISoftClippedRead(const std::string &name,
const ChromosomeRegion& alignedRegion,
const std::string& sequence,
int mapQuality,
int clippedLength,
int smallDelSize,
int smallInsSize)
: name(name),
alignedRegion(alignedRegion),
sequence(sequence),
mapQuality(mapQuality),
clippedLength(clippedLength),
smallDelSize(smallDelSize),
smallInsSize(smallInsSize)
{}
virtual ~ISoftClippedRead() {}
int GetReferenceId() const { return alignedRegion.GetReferenceId(); }
std::string GetReferenceName() const { return alignedRegion.GetReferenceName(); }
std::string GetSequence() const { return sequence; }
// int GetReadLength() const { return sequence.length(); }
ChromosomeRegion GetAlignedRegion() const { return alignedRegion; }
virtual GenomePosition GetClipPosition() = 0;
virtual bool IsAlnResultQualified(DoubleFragsAlnResult *pAlnResult, const CallParams& cParams) = 0;
// virtual ChromosomeRegionWithCi ToRegionWithCi(const AlignmentResult& aResult, int refStartPos) = 0;
// virtual CallResult ToCallResult(int refStartPos, const SingleFragAlnResult& alnResult) = 0;
virtual CallResult *ToCallResult(int refStartPos, DoubleFragsAlnResult *pAlnResult) = 0;
virtual ChromoFragment CutFragment(const ChromoFragment& cFragment) = 0;
virtual ChromoFragment ExtendFragment(const ChromoFragment& cFragment, ISequenceFetcher *pSeqFetcher) = 0;
virtual std::string GetType() = 0;
virtual std::string GetClippedPart() = 0;
protected:
std::string name;
ChromosomeRegion alignedRegion;
std::string sequence;
int mapQuality;
int clippedLength;
int smallDelSize;
int smallInsSize;
};
bool IsQualified(int matchLen, int percentIdent, const CallParams& cParams);
int NumOfLongestCommonPrefix(const std::string& v, const std::string& w);
int NumOfLongestCommonSuffix(const std::string& v, const std::string& w);
#endif // SOFTCLIPPEDREAD_H