MSpin-JCoupling  2.1
molecule.h
1 /***************************************************************************
2  molecule.h - description
3  -------------------
4  author : Armando Navarro-Vazquez
5  email : armando.deus@gmail.com
6  ***************************************************************************/
7 
8 /***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef MAGNES_MOLECULE_H
18 #define MAGNES_MOLECULE_H
19 
20 #include <string>
21 #include <vector>
22 #include <list>
23 
24 
25 
26 #include "atom.h"
27 #include "pdbtools.h"
28 #include "energy.h"
29 #include "mathtools.h"
30 #include "coreexport.h"
31 #include "frame.h"
33 namespace magnes
34 {
35 typedef std::vector<size_t> Ring;
41 class MoleculePrivate;
42 class FramePrivate;
43 
44 class MAGNES_CORE_API Molecule
45 {
46 public:
48  Molecule();
50  Molecule ( const Molecule& mol );
52  Molecule& operator= ( const Molecule& mol );
54  ~Molecule();
56  Molecule At ( size_t frame ) const;
58  const std::vector<Frame>& Frames() const;
60  std::vector<Frame>& Frames();
62  const Frame& CurrentFrame() const;
64  Frame& CurrentFrame();
66  size_t CurrentFrameIndex() const;
68  void SetCurrentFrame ( size_t i ) ;
70  const std::vector<Atom>& Atoms() const;
72  std::vector<Atom>& Atoms() ;
74  const std::vector<Bond>& Bonds() const;
76  std::vector<Bond>& Bonds();
78  size_t NBonds(size_t i, size_t j) const;
80  const std::vector<double>& Populations() const;
82  std::vector<double>& Populations();
84  double Weight() const { return CalculateWeight(); }
86  void MoveToCentroid();
88  std::vector < std::vector<size_t> > Rings ( size_t size=0 ) const;
90  std::vector< std::vector<size_t> > EssentialRings(size_t size=0 ) const;
92  bool IsRingTied(const std::vector<size_t>& ring) const;
94  std::vector<size_t> ShortestPath(size_t i, size_t j) const;
96  std::vector<int> FindAtomByName ( const std::string& name ) const;
98  double CalculateWeight() const;
100  Atom::hybridization Hybridization ( size_t atom ) const;
102  void SetBonds ( bool eachframe=false );
104  const std::vector<PDBResidue*>& Residues() const;
106  std::vector<PDBResidue*>& Residues();
108  std::list<int> Elements() const;
110  std::list<std::string> ElementSymbols() const;
112  std::vector<size_t> Neighbours ( size_t i ) const;
114  size_t IndexFromPDB(const std::string& pdbname,const std::string& resname,const std::string& resindex) const;
119  std::vector< std::vector<double> > SuperImposeMackay(size_t reframe, const std::vector<size_t>& atoms);
124  std::vector< std::vector<double> > SuperImpose(size_t reframe, const std::vector<size_t>& atoms, bool massweighted=false);
127  std::vector< std::vector< double > > EckartTransform(size_t reframe, const std::vector<size_t>& atoms);
129  bool CheckConformersSanity() const;
131  void ReparentFrames();
133  const std::string& FileName() const;
135  void SetFileName(const std::string& filename);
136 private:
137  bool FindInShell(std::vector<size_t>& searched,size_t j) const;
138 private:
139  MoleculePrivate* m_private;
140 
141 };
142 
144 MAGNES_CORE_API std::ostream& operator << ( std::ostream& s,const magnes::Molecule& m );
145 MAGNES_CORE_API bool CompareMolecules(const magnes::Molecule& mol1,const magnes::Molecule& mol2);
146 
147 }
148 
149 
150 #endif // MAGNES_MOLECULE_H
MAGNES_CORE_API std::ostream & operator<<(std::ostream &s, const Coordinate &c)
Definition: coordinate.h:269
the global magnes namespace
Definition: ccchequation.h:38
hybridization
Definition: atom.h:115
Definition: molecule.h:44
double Weight() const
Definition: molecule.h:84
Representation of a conformer.
Definition: frame.h:33