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
00072 BALL_EXPORT bool IsThreeLetterCode(const String& aa);
00073
00077 BALL_EXPORT OneLetterAASequence ThreeLetterToOneLetter(const ThreeLetterAASequence& sequence);
00078
00082 BALL_EXPORT ThreeLetterAASequence OneLetterToThreeLetter(const OneLetterAASequence& sequence);
00083
00089 BALL_EXPORT OneLetterAASequence GetSequence(const Protein& protein);
00090
00096 BALL_EXPORT OneLetterAASequence GetSequence(const Chain& chain);
00097
00103 BALL_EXPORT OneLetterAASequence GetSequence(ResidueConstIterator it);
00105
00107
00109
00151 class BALL_EXPORT NameConverter
00152 : public Embeddable
00153 {
00154 public:
00155 BALL_EMBEDDABLE(NameConverter, Embeddable)
00156
00157
00160
00161 static const String VALUE_NA;
00162
00164 struct BALL_EXPORT Option
00165 {
00168 static const char* INIFile;
00169
00172 static const char* PSEUDO_ATOMS_INIFile;
00173
00174 };
00175
00177 struct BALL_EXPORT Default
00178 {
00179 static const String INIFile;
00180 static const String PSEUDO_ATOMS_INIFile;
00181 };
00182
00185 NameConverter();
00186
00188 virtual ~NameConverter() {}
00189
00192 void setDefaultOptions();
00193
00199 bool supportsNamingScheme(const String& scheme_name) const;
00200
00206 bool supportsPseudoAtomNamingScheme(const String& scheme_name) const;
00207
00215 String convertName(const String& amino_acid, const String& old_atom_name,
00216 const String& old_naming_scheme, const String& new_naming_scheme) const;
00217
00227 bool matches(const String& amino_acid, const String& old_atom_name,
00228 const String& old_naming_scheme, const String& new_atom_name,
00229 const String& new_naming_scheme) const;
00230
00242 std::vector<String> resolvePseudoAtoms(const String& amino_acid, const String& atom_name,
00243 const String& old_naming_scheme, const String& new_naming_scheme) const;
00244
00248
00249 Options options;
00251
00252 protected:
00253
00256 void readConversionTable_()
00257 throw (Exception::FileNotFound());
00258
00261 void readPseudoAtomsConversionTable_()
00262 throw (Exception::FileNotFound());
00263
00264 std::vector<String> conventions_;
00265 std::vector< std::vector <String> > conversion_table_;
00266
00267 std::vector<String> pseudo_conventions_;
00268 std::vector< std::vector <std::vector <String> > > pseudo_conversion_table_;
00269
00270
00271 };
00272
00273 }
00274
00275 }
00276
00277 #endif // BALL_STRUCTURE_PEPTIDES_H_
00278
00279