// GaussianAlphabet.h // 18 Nov 2008 // This file contains the definition of the GaussianAlphabet class; // This is derived from the alphabet class, but supports additional // name/value pairs for describing Bystroff and deBrevern protein blocks. #ifndef GAUSSIANALPHABET #define GAUSSIANALPHABET #include "Alphabet/Alphabet.h" namespace Gauss { const double GAUSSIAN_WILDCARD = 1e10; struct GaussianDefinition { string feature; // the type of feature vector val; // the measures for each feature int idx; // the residue index relative to the current residue }; } class GaussianAlphabet : public Alphabet { private: // required stuff for things derived from NamedClass static IdObject ID; static void init_is_a(IdObject *self) { self->add_is_a(Alphabet::classID()); } virtual int read_knowing_type(std::istream &in); virtual void write_knowing_type(std::ostream &out) const; // called to initialize the Gaussian command table used by // read_knowing_type void init_command_table(void); // command table for reading Gaussian alphabets static NameToPtr *CommandTable; int Dimensions; std::vector Centers; protected: // read commands for each command static int ReadDimensions(std::istream &in, Alphabet *change, AlphabetInputCommand *self); static int ReadDefinition(std::istream &in, Alphabet *change, AlphabetInputCommand *self); static int ReadCenter(std::istream &in, Alphabet *change, AlphabetInputCommand *self); // print commands for each command void print_dimensions(std::ostream &out) const; void print_definition(std::ostream &out) const; void print_centers(std::ostream &out) const; public: // local data // required stuff for things derived from NamedClass static IdObject *classID(void) { return &GaussianAlphabet::ID; } virtual IdObject *type(void) const { return &GaussianAlphabet::ID; } GaussianAlphabet() : Dimensions(2) { } Base first_all_match_wildcard(void) const; // accessors for all of the relavant members inline int dimensions(void) const { return Dimensions; } inline const std::vector ¢ers(void) const { return Centers; } }; #endif // GAUSSIANALPHABET