00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef GCU_RESIDUE_H
00026 #define GCU_RESIDUE_H
00027
00028 #include "macros.h"
00029 #include <libxml/parser.h>
00030 #include <map>
00031 #include <set>
00032 #include <string>
00033
00034 using namespace std;
00035
00036 namespace gcu {
00037
00038 class Residue;
00039
00040
00041 typedef struct {
00042 Residue *res;
00043 bool ambiguous;
00044 } SymbolResidue;
00045
00046 typedef std::map<std::string, SymbolResidue>::iterator ResidueIterator;
00047
00048 class Residue
00049 {
00050 public:
00051 Residue ();
00052 Residue (char const *name);
00053 virtual ~Residue ();
00054
00055 std::map<int,int> const &GetRawFormula () {return m_Raw;}
00056 std::set<std::string> const &GetSymbols () {return m_Symbols;}
00057 void SetName (char const *name);
00058 void AddSymbol (char const *symbol);
00059 void RemoveSymbol (char const *symbol);
00060 virtual void Load (xmlNodePtr node);
00061 static Residue const *GetResidue (char const *symbol, bool *ambiguous = NULL);
00062 static Residue const *GetResiduebyName (char const *name);
00063 static std::string const *GetFirstResidueSymbol (ResidueIterator &i);
00064 static std::string const *GetNextResidueSymbol (ResidueIterator &i);
00065
00066 private:
00067 std::map<int,int> m_Raw;
00068 std::set<std::string> m_Symbols;
00069
00070 GCU_RO_PROP (char const *, Name)
00071 GCU_PROP (bool, Generic)
00072 GCU_RO_PROP (bool, Ambiguous);
00073 };
00074
00075 }
00076
00077 #endif // GCU_RESIDUE_H