RDKit
Open-source cheminformatics and machine learning.
MonomerInfo.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2013 Greg Landrum
3 //
4 // @@ All Rights Reserved @@
5 // This file is part of the RDKit.
6 // The contents are covered by the terms of the BSD license
7 // which is included in the file license.txt, found at the root
8 // of the RDKit source tree.
9 //
10 /*! \file MonomerInfo.h
11 
12  \brief Defines Monomer information classes
13 
14 */
15 #ifndef _RD_MONOMERINFO_H
16 #define _RD_MONOMERINFO_H
17 
18 #include <string>
19 #include <boost/shared_ptr.hpp>
20 
21 namespace RDKit{
22 
23  //! The abstract base class for atom-level monomer info
25  public:
26  typedef enum {
31 
32  virtual ~AtomMonomerInfo() {};
33 
34  AtomMonomerInfo() : d_monomerType(UNKNOWN), d_name("") {};
35  AtomMonomerInfo(AtomMonomerType typ,const std::string &nm="") : d_monomerType(typ), d_name(nm) {};
36  AtomMonomerInfo(const AtomMonomerInfo &other) : d_monomerType(other.d_monomerType),d_name(other.d_name) {};
37 
38  const std::string & getName() const { return d_name; };
39  void setName(const std::string &nm) { d_name=nm; };
40  AtomMonomerType getMonomerType() const { return d_monomerType; };
41  void setMonomerType(AtomMonomerType typ) { d_monomerType=typ; };
42 
43  virtual AtomMonomerInfo *copy() const {
44  return new AtomMonomerInfo(*this);
45  }
46  private:
47  AtomMonomerType d_monomerType;
48  std::string d_name;
49  };
50 
51  //! Captures atom-level information about peptide residues
53  public:
56  d_serialNumber(other.d_serialNumber),
57  d_altLoc(other.d_altLoc),
58  d_residueName(other.d_residueName),
59  d_residueNumber(other.d_residueNumber),
60  d_chainId(other.d_chainId),
61  d_insertionCode(other.d_insertionCode),
62  d_occupancy(other.d_occupancy),
63  d_tempFactor(other.d_tempFactor),
64  df_heteroAtom(other.df_heteroAtom),
65  d_secondaryStructure(other.d_secondaryStructure),
66  d_segmentNumber(other.d_segmentNumber){};
67 
68  AtomPDBResidueInfo(std::string atomName,
69  int serialNumber=0,
70  std::string altLoc="",
71  std::string residueName="",
72  int residueNumber=0,
73  std::string chainId="",
74  std::string insertionCode="",
75  double occupancy=1.0,
76  double tempFactor=0.0,
77  bool isHeteroAtom=false,
78  unsigned int secondaryStructure=0,
79  unsigned int segmentNumber=0 ) : AtomMonomerInfo(PDBRESIDUE,atomName),
80  d_serialNumber(serialNumber),
81  d_altLoc(altLoc),
82  d_residueName(residueName),
83  d_residueNumber(residueNumber),
84  d_chainId(chainId),
85  d_insertionCode(insertionCode),
86  d_occupancy(occupancy),
87  d_tempFactor(tempFactor),
88  df_heteroAtom(isHeteroAtom),
89  d_secondaryStructure(secondaryStructure),
90  d_segmentNumber(segmentNumber) {};
91 
92  int getSerialNumber() const { return d_serialNumber; };
93  void setSerialNumber(int val) { d_serialNumber=val; };
94  const std::string &getAltLoc() const { return d_altLoc; };
95  void setAltLoc(const std::string &val) { d_altLoc=val; };
96  const std::string &getResidueName() const { return d_residueName; };
97  void setResidueName(const std::string &val) { d_residueName=val; };
98  int getResidueNumber() const { return d_residueNumber; };
99  void setResidueNumber(int val) { d_residueNumber=val; };
100  const std::string &getChainId() const { return d_chainId; };
101  void setChainId(const std::string &val) { d_chainId=val; };
102  const std::string &getInsertionCode() const { return d_insertionCode; };
103  void setInsertionCode(const std::string &val) { d_insertionCode=val; };
104  double getOccupancy() const { return d_occupancy; };
105  void setOccupancy(double val) { d_occupancy=val; };
106  double getTempFactor() const { return d_tempFactor; };
107  void setTempFactor(double val) { d_tempFactor=val; };
108  bool getIsHeteroAtom() const { return df_heteroAtom; };
109  void setIsHeteroAtom(bool val) { df_heteroAtom=val; };
110  unsigned int getSecondaryStructure() const {return d_secondaryStructure;};
111  void setSecondaryStructure(unsigned int val) { d_secondaryStructure=val; };
112  unsigned int getSegmentNumber() const {return d_segmentNumber;};
113  void setSegmentNumber(unsigned int val) { d_segmentNumber=val; };
114 
115 
117  return static_cast<AtomMonomerInfo *>(new AtomPDBResidueInfo(*this));
118  }
119 
120  private:
121  // the fields here are from the PDB definition
122  // (http://www.wwpdb.org/documentation/format33/sect9.html#ATOM) [9 Aug, 2013]
123  // element and charge are not present since the atom itself stores that information
124  unsigned int d_serialNumber;
125  std::string d_altLoc;
126  std::string d_residueName;
127  int d_residueNumber;
128  std::string d_chainId;
129  std::string d_insertionCode;
130  double d_occupancy;
131  double d_tempFactor;
132  // additional, non-PDB fields:
133  bool df_heteroAtom; // is this from a HETATM record?
134  unsigned int d_secondaryStructure;
135  unsigned int d_segmentNumber;
136 
137  };
138 
139 };
140 //! allows AtomPDBResidueInfo objects to be dumped to streams
141 std::ostream & operator<<(std::ostream& target, const RDKit::AtomPDBResidueInfo &apri);
142 
143 #endif
AtomMonomerType getMonomerType() const
Definition: MonomerInfo.h:40
const std::string & getResidueName() const
Definition: MonomerInfo.h:96
AtomMonomerInfo(const AtomMonomerInfo &other)
Definition: MonomerInfo.h:36
void setName(const std::string &nm)
Definition: MonomerInfo.h:39
std::ostream & operator<<(std::ostream &target, const RDKit::AtomPDBResidueInfo &apri)
allows AtomPDBResidueInfo objects to be dumped to streams
void setSerialNumber(int val)
Definition: MonomerInfo.h:93
The abstract base class for atom-level monomer info.
Definition: MonomerInfo.h:24
void setResidueNumber(int val)
Definition: MonomerInfo.h:99
void setInsertionCode(const std::string &val)
Definition: MonomerInfo.h:103
void setAltLoc(const std::string &val)
Definition: MonomerInfo.h:95
unsigned int getSecondaryStructure() const
Definition: MonomerInfo.h:110
double getTempFactor() const
Definition: MonomerInfo.h:106
const std::string & getAltLoc() const
Definition: MonomerInfo.h:94
void setMonomerType(AtomMonomerType typ)
Definition: MonomerInfo.h:41
void setChainId(const std::string &val)
Definition: MonomerInfo.h:101
double getOccupancy() const
Definition: MonomerInfo.h:104
AtomMonomerInfo * copy() const
Definition: MonomerInfo.h:116
const std::string & getInsertionCode() const
Definition: MonomerInfo.h:102
void setSegmentNumber(unsigned int val)
Definition: MonomerInfo.h:113
Includes a bunch of functionality for handling Atom and Bond queries.
Definition: Atom.h:28
AtomPDBResidueInfo(const AtomPDBResidueInfo &other)
Definition: MonomerInfo.h:55
void setOccupancy(double val)
Definition: MonomerInfo.h:105
void setIsHeteroAtom(bool val)
Definition: MonomerInfo.h:109
void setSecondaryStructure(unsigned int val)
Definition: MonomerInfo.h:111
const std::string & getChainId() const
Definition: MonomerInfo.h:100
virtual AtomMonomerInfo * copy() const
Definition: MonomerInfo.h:43
int getResidueNumber() const
Definition: MonomerInfo.h:98
virtual ~AtomMonomerInfo()
Definition: MonomerInfo.h:32
const std::string & getName() const
Definition: MonomerInfo.h:38
bool getIsHeteroAtom() const
Definition: MonomerInfo.h:108
Captures atom-level information about peptide residues.
Definition: MonomerInfo.h:52
AtomPDBResidueInfo(std::string atomName, int serialNumber=0, std::string altLoc="", std::string residueName="", int residueNumber=0, std::string chainId="", std::string insertionCode="", double occupancy=1.0, double tempFactor=0.0, bool isHeteroAtom=false, unsigned int secondaryStructure=0, unsigned int segmentNumber=0)
Definition: MonomerInfo.h:68
AtomMonomerInfo(AtomMonomerType typ, const std::string &nm="")
Definition: MonomerInfo.h:35
int getSerialNumber() const
Definition: MonomerInfo.h:92
void setTempFactor(double val)
Definition: MonomerInfo.h:107
unsigned int getSegmentNumber() const
Definition: MonomerInfo.h:112
void setResidueName(const std::string &val)
Definition: MonomerInfo.h:97