00001
00002
00003
00004
00005 #ifndef BALL_STRUCTURE_PEPTIDES_H
00006 #define BALL_STRUCTURE_PEPTIDES_H
00007
00008 #ifndef BALL_COMMON_H
00009 # include <BALL/common.h>
00010 #endif
00011
00012 #ifndef BALL_KERNEL_PROTEIN_H
00013 # include <BALL/KERNEL/protein.h>
00014 #endif
00015
00016 #ifndef BALL_DATATYPE_OPTIONS_H
00017 # include <BALL/DATATYPE/options.h>
00018 #endif
00019
00020 #ifndef BALL_CONCEPT_EMBEDDABLE_H
00021 # include <BALL/CONCEPT/embeddable.h>
00022 #endif
00023
00024 namespace BALL
00025 {
00026
00027 namespace Peptides
00028 {
00033
00035 typedef std::list<String> ThreeLetterAASequence;
00036
00038 typedef String OneLetterAASequence;
00040
00045
00050 BALL_EXPORT char OneLetterCode(const String& aa);
00051
00057 BALL_EXPORT String ThreeLetterCode(char aa);
00058
00064 BALL_EXPORT bool IsOneLetterCode(char aa);
00065
00071 BALL_EXPORT bool IsThreeLetterCode(const String& aa);
00072
00076 BALL_EXPORT OneLetterAASequence ThreeLetterToOneLetter(const ThreeLetterAASequence& sequence);
00077
00081 BALL_EXPORT ThreeLetterAASequence OneLetterToThreeLetter(const OneLetterAASequence& sequence);
00082
00088 BALL_EXPORT OneLetterAASequence GetSequence(const Protein& protein);
00089
00095 BALL_EXPORT OneLetterAASequence GetSequence(const Chain& chain);
00096
00102 BALL_EXPORT OneLetterAASequence GetSequence(ResidueConstIterator it);
00104
00106
00108
00150 class BALL_EXPORT NameConverter
00151 : public Embeddable
00152 {
00153 public:
00154 BALL_EMBEDDABLE(NameConverter, Embeddable)
00155
00156
00159
00160 static const String VALUE_NA;
00161
00163 struct BALL_EXPORT Option
00164 {
00167 static const char* INIFile;
00168
00171 static const char* PSEUDO_ATOMS_INIFile;
00172
00173 };
00174
00176 struct BALL_EXPORT Default
00177 {
00178 static const String INIFile;
00179 static const String PSEUDO_ATOMS_INIFile;
00180 };
00181
00184 NameConverter();
00185
00187 virtual ~NameConverter() {}
00188
00191 void setDefaultOptions();
00192
00198 bool supportsNamingScheme(const String& scheme_name) const;
00199
00205 bool supportsPseudoAtomNamingScheme(const String& scheme_name) const;
00206
00214 String convertName(const String& amino_acid, const String& old_atom_name,
00215 const String& old_naming_scheme, const String& new_naming_scheme) const;
00216
00226 bool matches(const String& amino_acid, const String& old_atom_name,
00227 const String& old_naming_scheme, const String& new_atom_name,
00228 const String& new_naming_scheme) const;
00229
00241 std::vector<String> resolvePseudoAtoms(const String& amino_acid, const String& atom_name,
00242 const String& old_naming_scheme, const String& new_naming_scheme) const;
00243
00247
00248 Options options;
00250
00251 protected:
00252
00255 void readConversionTable_()
00256 throw (Exception::FileNotFound());
00257
00260 void readPseudoAtomsConversionTable_()
00261 throw (Exception::FileNotFound());
00262
00263 std::vector<String> conventions_;
00264 std::vector< std::vector <String> > conversion_table_;
00265
00266 std::vector<String> pseudo_conventions_;
00267 std::vector< std::vector <std::vector <String> > > pseudo_conversion_table_;
00268
00269
00270 };
00271
00272 }
00273
00274 }
00275
00276 #endif // BALL_STRUCTURE_PEPTIDES_H_
00277
00278