00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef OST_RESIDUE_IMPL_HH
00020 #define OST_RESIDUE_IMPL_HH
00021
00022 #include <boost/enable_shared_from_this.hpp>
00023
00024 #include <ost/geom/geom.hh>
00025
00026 #include <ost/mol/residue_prop.hh>
00027 #include <ost/mol/entity_visitor_fw.hh>
00028
00029 #include <ost/mol/impl/residue_impl_fw.hh>
00030 #include <ost/mol/impl/atom_impl_fw.hh>
00031 #include <ost/mol/impl/chain_impl_fw.hh>
00032 #include <ost/mol/impl/entity_impl_fw.hh>
00033 #include <ost/mol/sec_structure.hh>
00034 #include <ost/mol/impl/torsion_impl_fw.hh>
00035 #include <ost/mol/impl/atom_group.hh>
00036 #include <ost/mol/chem_class.hh>
00037
00038 #include <ost/generic_property.hh>
00039 #include <ost/mol/property_id.hh>
00040
00041 namespace ost { namespace mol { namespace impl {
00042
00043
00046 class ResidueImpl: public GenericPropContainerImpl,
00047 public boost::enable_shared_from_this<ResidueImpl>
00048
00049 {
00050 public:
00051 ResidueImpl(const EntityImplPtr& ent, const ChainImplPtr& ch,
00052 const ResNum& num, const ResidueKey& key);
00053
00054 AtomImplPtr InsertAtom(const String& name, const geom::Vec3& pos,
00055 const AtomProp& prop);
00058 AtomImplPtr InsertAtom(const AtomImplPtr& atom);
00059 AtomImplPtr InsertAltAtom(const String& name, const String& alt_group,
00060 const geom::Vec3& pos, const AtomProp& prop);
00061 const ResNum& GetNumber() const {return num_;}
00062 void SetNumber(const ResNum& num) {num_=num;}
00063
00064 const ResidueKey& GetKey() const {
00065 return key_;
00066 }
00067
00068 void SetKey(const ResidueKey& key) {
00069 key_=key;
00070 }
00071
00072 ChainImplPtr GetChain() const;
00073
00074 AtomImplPtr GetCentralAtom() const;
00075
00076 geom::Vec3 GetCentralNormal() const;
00077
00078 char GetOneLetterCode() const;
00079
00080 void SetOneLetterCode(const char olc);
00081
00088 AtomImplPtr FindAtom(const String& aname) const;
00089
00090 void Apply(EntityVisitor& v);
00091
00093 int GetAtomCount() const;
00094
00096 int GetBondCount() const;
00097
00098 EntityImplPtr GetEntity() const;
00099
00104 TorsionImplP GetPhiTorsion() const;
00105
00110 TorsionImplP GetOmegaTorsion() const;
00111
00116 TorsionImplP GetPsiTorsion() const;
00117
00120 SecStructure GetSecStructure() const;
00121
00123 void SetSecStructure(SecStructure ss);
00124
00125 const AtomImplList& GetAtomList() const;
00126
00127 AtomImplList& GetAtomList() {
00128 return atom_list_;
00129 }
00130
00131 Real GetMass() const;
00132 geom::Vec3 GetCenterOfMass() const;
00133 geom::Vec3 GetCenterOfAtoms() const;
00134 geom::Vec3 GetGeometricCenter() const;
00135 geom::Vec3 GetGeometricStart() const;
00136 geom::Vec3 GetGeometricEnd() const;
00137
00138 void DeleteAtom(const AtomImplPtr& atom);
00139 void DeleteAtoms(const String& atom_name);
00140 void DeleteAllAtoms();
00141
00142 void AddTorsion(const TorsionImplP& torsion);
00143
00144 const TorsionImplList& GetTorsionList() const {
00145 return torsion_list_;
00146 }
00148 bool HasAltAtomGroup(const String& group) const;
00149
00150 std::vector<String> GetAltAtomGroupNames() const;
00151
00152 std::vector<String> GetAltAtomGroupNames(const AtomImplPtr& atom) const;
00153 bool HasAltAtoms() const;
00154
00156 Real GetAverageBFactor() const;
00157
00158 bool SwitchAtomPos(const String& group);
00159
00160 void AddAltAtomPos(const String& group,
00161 const AtomImplPtr& atom,
00162 const geom::Vec3& position);
00163 geom::Vec3 GetAltAtomPos(const AtomImplPtr& atom, const String& group) const;
00164
00165
00166 const String& GetCurrentAltGroupName() const {
00167 return curr_group_;
00168 }
00169 int GetIndex() const;
00170
00174 String GetQualifiedName() const;
00175
00177 const String& GetName() const {
00178 return key_;
00179 }
00180
00182 TorsionImplList& GetTorsionList() {
00183 return torsion_list_;
00184 }
00185
00186 void SetChemClass(ChemClass cc) {
00187 chem_class_=cc;
00188 }
00189 ChemClass GetChemClass() const {
00190 return chem_class_;
00191 }
00192
00193 TorsionImplP FindTorsion(const String& torsion_name) const;
00194
00195
00196 String GetStringProperty(Prop::ID prop_id) const;
00197
00198 Real GetFloatProperty(Prop::ID prop_id) const;
00199
00200 int GetIntProperty(Prop::ID prop_id) const;
00201
00202 private:
00203 void AddAltAtom(const String& group, const AtomImplPtr& atom,
00204 const geom::Vec3& position);
00205 void RemoveAltPositionsForAtom(const AtomImplPtr& atom);
00206 String curr_group_;
00207 AtomEntryGroups alt_groups_;
00208 EntityImplW ent_;
00209 ChainImplW chain_;
00210 ResNum num_;
00211 ResidueKey key_;
00212 AtomImplList atom_list_;
00213 TorsionImplList torsion_list_;
00214 SecStructure sec_structure_;
00215 ChemClass chem_class_;
00216 char olc_;
00217 };
00218
00219 }}}
00220
00221 #endif
00222