📄 aligner.h
字号:
/*
*
* All Contents Copyright 2000 by Jared Samet. All Rights Reserved.
*
*/
#ifndef _ALIGNER_H
#define _ALIGNER_H
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
typedef enum {C3D_WEST, C3D_NORTHWEST, C3D_NORTH, C3D_INVALID_DIR} C3D_DIRECTION;
typedef enum {C3D_A, C3D_B, C3D_C, C3D_INVALID_AR} C3D_ARRAY;
struct SArrayEntry
{
int iScore;
C3D_DIRECTION dirPrev;
C3D_ARRAY arPrev;
};
struct SDPBox
{
SArrayEntry A, B, C;
};
template<class T>
class CSteppedArray;
class CAligner
{
public:
typedef int (*MATCH) (unsigned int left, unsigned int right); // fn that returns the score if these two letters are matched
CAligner(int iGapStart, int iGapContinue, MATCH Match, int iMinDisp, int iMaxDisp);
virtual ~CAligner(); // bye-bye
void Align(void); // line 'em up! when it's done, check member fn's for results
int AlignmentCount(void); // how many alignments did it find?
bool SetSequences(CSequence* pSeq1, // change the sequences being aligned
CSequence* pSeq2);
bool isAligned(void); // have these been aligned yet?
void DumpTable(void);
void GetAlignment(int nAlignment, // which one to get
CSequence** ppSeq1, // (OUT) place to store * to the first sequence
CSequence** ppSeq2); // (OUT) place to store * to the second seq
protected:
bool isValid(C3D_ARRAY arPrev, int iRow, int iCol);
int m_iGapStart, m_iGapContinue, m_iMinDisp, m_iMaxDisp;
int m_iLeftLen, m_iRightLen;
MATCH m_Match;
bool m_fAligned, m_fHaveSeqs;
CSteppedArray<SDPBox> *m_pTable;
CSequence *m_pSeqLeft, *m_pSeqRight;
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -