--- /dev/null
+#ifndef PWPath_h\r
+#define PWPath_h\r
+\r
+/***\r
+Each PWEdge in a PWPath specifies a column in a pair-wise (PW) alignment.\r
+"Path" is by analogy with the path through an HMM.\r
+Edge types are:\r
+\r
+ 'M' LetterA + LetterB\r
+ 'D' LetterA + GapB\r
+ 'I' GapB + LetterA\r
+\r
+The mnemomic is Match, Delete, Insert (with respect to A).\r
+Here is a global alignment of sequences A and B.\r
+\r
+ A: AMQT-F\r
+ B: -M-TIF\r
+\r
+The path for this example is:\r
+\r
+ Edge cType uPrefixLengthA uPrefixLengthB\r
+ 0 D 1 0\r
+ 1 M 2 1\r
+ 2 D 3 1\r
+ 3 M 4 2\r
+ 4 I 4 3\r
+ 5 M 5 4\r
+\r
+Given the starting positions in each alignment (e.g., column zero for\r
+a global alignment), the prefix length fields are redundant; they are\r
+included only for convenience and as a sanity check, we are not trying\r
+to optimize for speed or space here. We use prefix lengths rather than\r
+column indexes because of the problem of representing the special case\r
+of a gap in the first position.\r
+***/\r
+\r
+class Seq;\r
+class MSA;\r
+class SatchmoParams;\r
+class PW;\r
+class TextFile;\r
+class PWScore;\r
+\r
+class PWEdge\r
+ {\r
+public:\r
+ char cType;\r
+ unsigned uPrefixLengthA;\r
+ unsigned uPrefixLengthB;\r
+\r
+ bool Equal(const PWEdge &e) const\r
+ {\r
+ return uPrefixLengthA == e.uPrefixLengthA &&\r
+ uPrefixLengthB == e.uPrefixLengthB &&\r
+ cType == e.cType;\r
+ }\r
+ };\r
+\r
+class PWPath\r
+ {\r
+// Disable compiler defaults\r
+private:\r
+ PWPath &operator=(const PWPath &rhs);\r
+ PWPath(const PWPath &rhs);\r
+\r
+public:\r
+ PWPath();\r
+ virtual ~PWPath();\r
+\r
+public:\r
+ void Clear();\r
+ void FromStr(const char Str[]);\r
+ void Copy(const PWPath &Path);\r
+ void AppendEdge(const PWEdge &Edge);\r
+ void AppendEdge(char cType, unsigned uPrefixLengthA, unsigned uPrefixLengthB);\r
+ void PrependEdge(const PWEdge &Edge);\r
+ unsigned GetEdgeCount() const { return m_uEdgeCount; }\r
+ const PWEdge &GetEdge(unsigned uEdgeIndex) const;\r
+ void Validate(const PWScore &PWS) const;\r
+ void Validate() const;\r
+ void LogMe() const;\r
+ void FromFile(TextFile &File);\r
+ void ToFile(TextFile &File) const;\r
+ void FromMSAPair(const MSA &msaA, const MSA &msaB);\r
+ void AssertEqual(const PWPath &Path) const;\r
+ bool Equal(const PWPath &Path) const;\r
+ unsigned GetMatchCount() const;\r
+ unsigned GetDeleteCount() const;\r
+ unsigned GetInsertCount() const;\r
+\r
+private:\r
+ void ExpandPath(unsigned uAdditionalEdgeCount);\r
+\r
+private:\r
+ unsigned m_uEdgeCount;\r
+ unsigned m_uArraySize;\r
+ PWEdge *m_Edges;\r
+ };\r
+\r
+#endif // PWPath_h\r