MonomerInfo.h
Go to the documentation of this file.
//
// Copyright (C) 2013 Greg Landrum
//
// @@ All Rights Reserved @@
// This file is part of the RDKit.
// The contents are covered by the terms of the BSD license
// which is included in the file license.txt, found at the root
// of the RDKit source tree.
//
/*! \file MonomerInfo.h
\brief Defines Monomer information classes
*/
#ifndef _RD_MONOMERINFO_H
#define _RD_MONOMERINFO_H
#include <string>
#include <boost/shared_ptr.hpp>
namespace RDKit {
//! The abstract base class for atom-level monomer info
class AtomMonomerInfo {
public:
typedef enum { UNKNOWN = 0, PDBRESIDUE, OTHER } AtomMonomerType;
virtual ~AtomMonomerInfo(){};
AtomMonomerInfo() : d_monomerType(UNKNOWN), d_name(""){};
AtomMonomerInfo(AtomMonomerType typ, const std::string &nm = "")
: d_monomerType(typ), d_name(nm){};
AtomMonomerInfo(const AtomMonomerInfo &other)
: d_monomerType(other.d_monomerType), d_name(other.d_name){};
const std::string &getName() const { return d_name; };
void setName(const std::string &nm) { d_name = nm; };
AtomMonomerType getMonomerType() const { return d_monomerType; };
void setMonomerType(AtomMonomerType typ) { d_monomerType = typ; };
virtual AtomMonomerInfo *copy() const { return new AtomMonomerInfo(*this); }
private:
AtomMonomerType d_monomerType;
std::string d_name;
};
//! Captures atom-level information about peptide residues
class AtomPDBResidueInfo : public AtomMonomerInfo {
public:
AtomPDBResidueInfo() : AtomMonomerInfo(PDBRESIDUE){};
AtomPDBResidueInfo(const AtomPDBResidueInfo &other)
: AtomMonomerInfo(other),
d_serialNumber(other.d_serialNumber),
d_altLoc(other.d_altLoc),
d_residueName(other.d_residueName),
d_residueNumber(other.d_residueNumber),
d_chainId(other.d_chainId),
d_insertionCode(other.d_insertionCode),
d_occupancy(other.d_occupancy),
d_tempFactor(other.d_tempFactor),
df_heteroAtom(other.df_heteroAtom),
d_secondaryStructure(other.d_secondaryStructure),
d_segmentNumber(other.d_segmentNumber){};
AtomPDBResidueInfo(const std::string &atomName, int serialNumber = 0,
const std::string &altLoc = "",
const std::string &residueName = "", int residueNumber = 0,
const std::string &chainId = "",
const std::string &insertionCode = "",
double occupancy = 1.0, double tempFactor = 0.0,
bool isHeteroAtom = false,
unsigned int secondaryStructure = 0,
unsigned int segmentNumber = 0)
: AtomMonomerInfo(PDBRESIDUE, atomName),
d_serialNumber(serialNumber),
d_altLoc(altLoc),
d_residueName(residueName),
d_residueNumber(residueNumber),
d_chainId(chainId),
d_insertionCode(insertionCode),
d_occupancy(occupancy),
d_tempFactor(tempFactor),
df_heteroAtom(isHeteroAtom),
d_secondaryStructure(secondaryStructure),
d_segmentNumber(segmentNumber){};
int getSerialNumber() const { return d_serialNumber; };
void setSerialNumber(int val) { d_serialNumber = val; };
const std::string &getAltLoc() const { return d_altLoc; };
void setAltLoc(const std::string &val) { d_altLoc = val; };
const std::string &getResidueName() const { return d_residueName; };
void setResidueName(const std::string &val) { d_residueName = val; };
int getResidueNumber() const { return d_residueNumber; };
void setResidueNumber(int val) { d_residueNumber = val; };
const std::string &getChainId() const { return d_chainId; };
void setChainId(const std::string &val) { d_chainId = val; };
const std::string &getInsertionCode() const { return d_insertionCode; };
void setInsertionCode(const std::string &val) { d_insertionCode = val; };
double getOccupancy() const { return d_occupancy; };
void setOccupancy(double val) { d_occupancy = val; };
double getTempFactor() const { return d_tempFactor; };
void setTempFactor(double val) { d_tempFactor = val; };
bool getIsHeteroAtom() const { return df_heteroAtom; };
void setIsHeteroAtom(bool val) { df_heteroAtom = val; };
unsigned int getSecondaryStructure() const { return d_secondaryStructure; };
void setSecondaryStructure(unsigned int val) { d_secondaryStructure = val; };
unsigned int getSegmentNumber() const { return d_segmentNumber; };
void setSegmentNumber(unsigned int val) { d_segmentNumber = val; };
AtomMonomerInfo *copy() const {
return static_cast<AtomMonomerInfo *>(new AtomPDBResidueInfo(*this));
}
private:
// the fields here are from the PDB definition
// (http://www.wwpdb.org/documentation/format33/sect9.html#ATOM) [9 Aug, 2013]
// element and charge are not present since the atom itself stores that
// information
unsigned int d_serialNumber;
std::string d_altLoc;
std::string d_residueName;
int d_residueNumber;
std::string d_chainId;
std::string d_insertionCode;
double d_occupancy;
double d_tempFactor;
// additional, non-PDB fields:
bool df_heteroAtom; // is this from a HETATM record?
unsigned int d_secondaryStructure;
unsigned int d_segmentNumber;
};
};
//! allows AtomPDBResidueInfo objects to be dumped to streams
std::ostream &operator<<(std::ostream &target,
const RDKit::AtomPDBResidueInfo &apri);
#endif
RDKit::AtomMonomerInfo::getName
const std::string & getName() const
Definition: MonomerInfo.h:36
RDKit::AtomMonomerInfo::AtomMonomerInfo
AtomMonomerInfo(const AtomMonomerInfo &other)
Definition: MonomerInfo.h:33
RDKit::AtomMonomerInfo::setName
void setName(const std::string &nm)
Definition: MonomerInfo.h:37
operator<<
std::ostream & operator<<(std::ostream &target, const RDKit::AtomPDBResidueInfo &apri)
allows AtomPDBResidueInfo objects to be dumped to streams
RDKit::AtomPDBResidueInfo::setSerialNumber
void setSerialNumber(int val)
Definition: MonomerInfo.h:89
RDKit::AtomMonomerInfo
The abstract base class for atom-level monomer info.
Definition: MonomerInfo.h:24
RDKit::AtomPDBResidueInfo::getAltLoc
const std::string & getAltLoc() const
Definition: MonomerInfo.h:90
RDKit::AtomPDBResidueInfo::setResidueNumber
void setResidueNumber(int val)
Definition: MonomerInfo.h:95
RDKit::AtomPDBResidueInfo::setInsertionCode
void setInsertionCode(const std::string &val)
Definition: MonomerInfo.h:99
RDKit::AtomPDBResidueInfo::setAltLoc
void setAltLoc(const std::string &val)
Definition: MonomerInfo.h:91
RDKit::AtomMonomerInfo::OTHER
Definition: MonomerInfo.h:26
RDKit::AtomMonomerInfo::AtomMonomerInfo
AtomMonomerInfo()
Definition: MonomerInfo.h:30
RDKit::AtomPDBResidueInfo::getIsHeteroAtom
bool getIsHeteroAtom() const
Definition: MonomerInfo.h:104
RDKit::AtomPDBResidueInfo::getChainId
const std::string & getChainId() const
Definition: MonomerInfo.h:96
RDKit::AtomMonomerInfo::setMonomerType
void setMonomerType(AtomMonomerType typ)
Definition: MonomerInfo.h:39
RDKit::AtomPDBResidueInfo::getInsertionCode
const std::string & getInsertionCode() const
Definition: MonomerInfo.h:98
RDKit::AtomPDBResidueInfo::setChainId
void setChainId(const std::string &val)
Definition: MonomerInfo.h:97
RDKit::AtomMonomerInfo::getMonomerType
AtomMonomerType getMonomerType() const
Definition: MonomerInfo.h:38
RDKit::AtomMonomerInfo::copy
virtual AtomMonomerInfo * copy() const
Definition: MonomerInfo.h:41
RDKit::AtomPDBResidueInfo::AtomPDBResidueInfo
AtomPDBResidueInfo()
Definition: MonomerInfo.h:51
RDKit::AtomMonomerInfo::AtomMonomerType
AtomMonomerType
Definition: MonomerInfo.h:26
RDKit::AtomPDBResidueInfo::setSegmentNumber
void setSegmentNumber(unsigned int val)
Definition: MonomerInfo.h:109
RDKit::AtomMonomerInfo::PDBRESIDUE
Definition: MonomerInfo.h:26
RDKit::AtomMonomerInfo::UNKNOWN
Definition: MonomerInfo.h:26
RDKit
Includes a bunch of functionality for handling Atom and Bond queries.
Definition: Atom.h:28
RDKit::AtomPDBResidueInfo::AtomPDBResidueInfo
AtomPDBResidueInfo(const AtomPDBResidueInfo &other)
Definition: MonomerInfo.h:52
RDKit::AtomPDBResidueInfo::setOccupancy
void setOccupancy(double val)
Definition: MonomerInfo.h:101
RDKit::AtomPDBResidueInfo::setIsHeteroAtom
void setIsHeteroAtom(bool val)
Definition: MonomerInfo.h:105
RDKit::AtomPDBResidueInfo::getSerialNumber
int getSerialNumber() const
Definition: MonomerInfo.h:88
RDKit::AtomPDBResidueInfo::getTempFactor
double getTempFactor() const
Definition: MonomerInfo.h:102
RDKit::AtomPDBResidueInfo::setSecondaryStructure
void setSecondaryStructure(unsigned int val)
Definition: MonomerInfo.h:107
RDKit::AtomPDBResidueInfo::getResidueName
const std::string & getResidueName() const
Definition: MonomerInfo.h:92
RDKit::AtomPDBResidueInfo::copy
AtomMonomerInfo * copy() const
Definition: MonomerInfo.h:111
RDKit::AtomMonomerInfo::~AtomMonomerInfo
virtual ~AtomMonomerInfo()
Definition: MonomerInfo.h:28
RDKit::AtomPDBResidueInfo::getResidueNumber
int getResidueNumber() const
Definition: MonomerInfo.h:94
RDKit::AtomPDBResidueInfo::getSegmentNumber
unsigned int getSegmentNumber() const
Definition: MonomerInfo.h:108
RDKit::AtomPDBResidueInfo
Captures atom-level information about peptide residues.
Definition: MonomerInfo.h:49
RDKit::AtomPDBResidueInfo::getOccupancy
double getOccupancy() const
Definition: MonomerInfo.h:100
RDKit::AtomMonomerInfo::AtomMonomerInfo
AtomMonomerInfo(AtomMonomerType typ, const std::string &nm="")
Definition: MonomerInfo.h:31
RDKit::AtomPDBResidueInfo::getSecondaryStructure
unsigned int getSecondaryStructure() const
Definition: MonomerInfo.h:106
RDKit::AtomPDBResidueInfo::AtomPDBResidueInfo
AtomPDBResidueInfo(const std::string &atomName, int serialNumber=0, const std::string &altLoc="", const std::string &residueName="", int residueNumber=0, const std::string &chainId="", const 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:66
RDKit::AtomPDBResidueInfo::setTempFactor
void setTempFactor(double val)
Definition: MonomerInfo.h:103
RDKit::AtomPDBResidueInfo::setResidueName
void setResidueName(const std::string &val)
Definition: MonomerInfo.h:93