+++ /dev/null
-#ifndef Seq_h\r
-#define Seq_h\r
-\r
-#include <vector>\r
-\r
-class TextFile;\r
-class MSA;\r
-\r
-typedef std::vector<char> CharVect;\r
-\r
-class Seq : public CharVect\r
- {\r
-public:\r
- Seq()\r
- {\r
- m_ptrName = 0;\r
- // Start with moderate size to avoid\r
- // thrashing the heap.\r
- reserve(200);\r
- }\r
- virtual ~Seq()\r
- {\r
- delete[] m_ptrName;\r
- }\r
-\r
-private:\r
-// Not implemented; prevent use of copy c'tor and assignment.\r
- Seq(const Seq &);\r
- Seq &operator=(const Seq &);\r
-\r
-public:\r
- void Clear()\r
- {\r
- clear();\r
- delete[] m_ptrName;\r
- m_ptrName = 0;\r
- m_uId = uInsane;\r
- }\r
- const char *GetName() const\r
- {\r
- return m_ptrName;\r
- }\r
- unsigned GetId() const\r
- {\r
- if (uInsane == m_uId)\r
- Quit("Seq::GetId, id not set");\r
- return m_uId;\r
- }\r
- void SetId(unsigned uId) { m_uId = uId; }\r
-\r
- bool FromFASTAFile(TextFile &File);\r
- void ToFASTAFile(TextFile &File) const;\r
- void ExtractUngapped(MSA &msa) const;\r
-\r
- void FromString(const char *pstrSeq, const char *pstrName);\r
- void Copy(const Seq &rhs);\r
- void CopyReversed(const Seq &rhs);\r
- void StripGaps();\r
- void StripGapsAndWhitespace();\r
- void ToUpper();\r
- void SetName(const char *ptrName);\r
- unsigned GetLetter(unsigned uIndex) const;\r
- unsigned Length() const { return (unsigned) size(); }\r
- bool Eq(const Seq &s) const;\r
- bool EqIgnoreCase(const Seq &s) const;\r
- bool EqIgnoreCaseAndGaps(const Seq &s) const;\r
- bool HasGap() const;\r
- unsigned GetUngappedLength() const;\r
- void LogMe() const;\r
- char GetChar(unsigned uIndex) const { return operator[](uIndex); }\r
- void SetChar(unsigned uIndex, char c) { operator[](uIndex) = c; }\r
- void AppendChar(char c) { push_back(c); }\r
- void FixAlpha();\r
-\r
-#ifndef _WIN32\r
- reference at(size_type i) { return operator[](i); }\r
- const_reference at(size_type i) const { return operator[](i); }\r
-#endif\r
-\r
-private:\r
- char *m_ptrName;\r
- unsigned m_uId;\r
- };\r
-\r
-#endif // Seq.h\r