00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef OST_MOL_COORD_FRAME_HH
00020 #define OST_MOL_COORD_FRAME_HH
00021
00022
00023
00024
00025 #include <ost/mol/module_config.hh>
00026 #include <boost/shared_ptr.hpp>
00027 #include <ost/geom/geom.hh>
00028 #include <ost/mol/module_config.hh>
00029 #include <ost/mol/entity_view.hh>
00030 #include "atom_handle.hh"
00031
00032 namespace ost { namespace mol {
00033
00039
00040
00041
00042
00043
00044
00045
00046 class DLLEXPORT_OST_MOL CoordFrame : public geom::Vec3List{
00047 private:
00048 geom::Vec3 ucell_size_;
00049 geom::Vec3 ucell_angles_;
00050 public:
00051 typedef geom::Vec3List base_type;
00052
00053 CoordFrame() : base_type() {}
00054 CoordFrame(size_t size, const geom::Vec3& value=geom::Vec3()) : base_type(size, value) {}
00055 CoordFrame(base_type::iterator b, base_type::iterator e): base_type(b, e) { }
00056 CoordFrame(const base_type& rhs) : base_type(rhs) { }
00057 CoordFrame(const std::vector<geom::Vec3>& rhs) : base_type(rhs) { }
00058 CoordFrame(const std::vector<geom::Vec3>& rhs,
00059 const geom::Vec3 box_size,
00060 const geom::Vec3 box_angles) : base_type(rhs) {
00061 ucell_size_=box_size;
00062 ucell_angles_=box_angles;
00063 }
00064
00065 void SetCellSize(const geom::Vec3& s) {
00066 ucell_size_=s;
00067 }
00068
00069 geom::Vec3 GetCellSize() const {
00070 return this->ucell_size_;
00071 }
00072
00073 void SetCellAngles(const geom::Vec3& a) {
00074 ucell_angles_=a;
00075 }
00076
00077 geom::Vec3 GetCellAngles() const {
00078 return this->ucell_angles_;
00079 }
00080
00081 geom::Vec3List GetCellVectors() const;
00082
00083 geom::Vec3 GetAtomPos(const AtomHandle& atom) const;
00084 geom::Vec3 GetAtomPos(int atom_index) const;
00085 Real GetDistanceBetwAtoms(const AtomHandle& a1, const AtomHandle& a2) const;
00086 Real GetDistanceBetwAtoms(int atom1_index, int atom2_index) const;
00087
00094 Real GetAngle(const AtomHandle& a1, const AtomHandle& a2, const AtomHandle& a3) const;
00095
00102 Real GetAngle(int atom1_index, int atom2_index, int atom3_index) const;
00103
00105 Real GetDihedralAngle(const AtomHandle& a1, const AtomHandle& a2, const AtomHandle& a3, const AtomHandle& a4) const;
00106
00108 Real GetDihedralAngle(int a1_index, int a2_index, int a3_index, int a4_index) const;
00109
00111 geom::Vec3 GetCenterOfMassPos(const mol::EntityView& sele) const;
00112
00114
00118 geom::Vec3 GetCenterOfMassPos(std::vector<unsigned long>& indices,
00119 std::vector<Real>& masses) const;
00120
00122 Real GetDistanceBetwCenterOfMass(const mol::EntityView& sele1, const mol::EntityView& sele2) const;
00123
00129 Real GetDistanceBetwCenterOfMass(std::vector<unsigned long>& indices1, std::vector<Real>& masses1,
00130 std::vector<unsigned long>& indices2, std::vector<Real>& masses2) const;
00131
00136 Real GetRMSD(const std::vector<geom::Vec3>& ref_pos,
00137 const std::vector<unsigned long>& indices_sele) const;
00138
00145 Real GetRMSD(const mol::EntityView& reference_view,
00146 const mol::EntityView& sele_view) const;
00147
00149
00152 Real GetMinDistance(std::vector<unsigned long>& index_list1,
00153 std::vector<unsigned long>& index_list2) const;
00154
00156 Real GetMinDistance(const mol::EntityView& view1, const mol::EntityView& view2) const;
00157
00163 Real GetMinDistBetwCenterOfMassAndView(std::vector<unsigned long>& indices_cm,
00164 std::vector<Real>& masses_cm,
00165 std::vector<unsigned long>& indices_atoms) const;
00167 Real GetMinDistBetwCenterOfMassAndView(const mol::EntityView& view_cm,
00168 const mol::EntityView& view_atoms) const;
00169
00171 geom::Line3 GetODRLine(std::vector<unsigned long>& indices_ca) const;
00172
00174 geom::Plane GetODRPlane(std::vector<unsigned long>& indices_ca) const;
00175
00177 geom::Line3 GetODRLine(const mol::EntityView& view1) const;
00178 geom::Plane GetODRPlane(const mol::EntityView& view1) const;
00179
00185 std::pair<geom::Line3, Real> FitCylinder(std::vector<unsigned long>& indices_ca) const;
00186
00188 std::pair<geom::Line3, Real> FitCylinder(const mol::EntityView& view1) const;
00189
00197 Real GetAlphaHelixContent(std::vector<unsigned long>& indices_ca,
00198 std::vector<unsigned long>& indices_c,
00199 std::vector<unsigned long>& indices_o,
00200 std::vector<unsigned long>& indices_n) const;
00201
00203 Real GetAlphaHelixContent(const mol::EntityView& segment) const;
00204 };
00205
00206 typedef boost::shared_ptr<CoordFrame> CoordFramePtr;
00207 typedef std::vector<CoordFramePtr> CoordFrameList;
00208
00209
00210
00211
00212 DLLEXPORT_OST_MOL CoordFrame CreateCoordFrame(const geom::Vec3List& atom_pos,
00213 const geom::Vec3& cell_size=geom::Vec3(),
00214 const geom::Vec3& cell_angles=geom::Vec3());
00215
00216
00217
00222 DLLEXPORT_OST_MOL void GetIndices(const EntityView& sele, std::vector<unsigned long>& indices);
00223
00228 DLLEXPORT_OST_MOL void GetMasses(const EntityView& sele, std::vector<Real>& masses);
00229
00231 DLLEXPORT_OST_MOL void GetIndicesAndMasses(const EntityView& sele,
00232 std::vector<unsigned long>& indices,
00233 std::vector<Real>& masses);
00234
00236 DLLEXPORT_OST_MOL void GetPositions(const EntityView& sele, std::vector<geom::Vec3>& ref_pos);
00237
00239 DLLEXPORT_OST_MOL void GetCaIndices(const EntityView& segment, std::vector<unsigned long>& indices_ca);
00240
00242 DLLEXPORT_OST_MOL void GetCaCONIndices(const EntityView& segment,
00243 std::vector<unsigned long>& indices_ca,
00244 std::vector<unsigned long>& indices_c,
00245 std::vector<unsigned long>& indices_o,
00246 std::vector<unsigned long>& indices_n);
00247
00248
00249 }}
00250
00251 #endif