Loading...
Searching...
No Matches
MonomerInfo.h
Go to the documentation of this file.
//
// Copyright (C) 2013-2024 Greg Landrum and other RDKit contributors
//
// @@ 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
*/
#include <RDGeneral/export.h>
#ifndef RD_MONOMERINFO_H
#define RD_MONOMERINFO_H
#include <string>
#include <utility>
#include <boost/shared_ptr.hpp>
namespace RDKit {
//! The abstract base class for atom-level monomer info
class RDKIT_GRAPHMOL_EXPORT AtomMonomerInfo {
public:
typedef enum { UNKNOWN = 0, PDBRESIDUE, OTHER } AtomMonomerType;
virtual ~AtomMonomerInfo() {}
AtomMonomerInfo() = default;
/**
* \param typ the 'type' of monomer this represents:
* * UNKNOWN default for base class
* * PDBRESIDUE set when AtomPDBResidueInfo is instantiated
* * OTHER
* \param nm the atom name (e.g. "CA" using PDB atom naming)
* \param residueName the residue name (e.g. "ALA")
* \param resNum the residue number (e.g. 12)
* \param chainId the chain identifier (e.g. "A", "Heavy", "PEPTIDE1")
* \param monomerClass further classification of the monomer (e.g, "LGRP", "LINK")
*/
AtomMonomerInfo(AtomMonomerType typ, std::string nm = "", std::string residueName = "",
int resNum = 0, std::string chainId = "", std::string monomerClass = "")
: d_monomerType(typ), d_name(std::move(nm)), d_residueNumber(resNum),
d_chainId(std::move(chainId)), d_monomerClass(std::move(monomerClass)),
d_residueName(std::move(residueName)) {}
AtomMonomerInfo(const AtomMonomerInfo &other) = default;
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; }
const std::string &getChainId() const { return d_chainId; }
void setChainId(const std::string &val) { d_chainId = val; }
int getResidueNumber() const { return d_residueNumber; }
void setResidueNumber(int val) { d_residueNumber = val; }
const std::string &getResidueName() const { return d_residueName; }
void setResidueName(const std::string &val) { d_residueName = val; }
const std::string &getMonomerClass() const { return d_monomerClass; }
void setMonomerClass(const std::string &val) { d_monomerClass = val; }
virtual AtomMonomerInfo *copy() const { return new AtomMonomerInfo(*this); }
private:
AtomMonomerType d_monomerType{UNKNOWN};
std::string d_name{""};
int d_residueNumber = 0;
std::string d_chainId = "";
std::string d_monomerClass = "";
std::string d_residueName = "";
};
//! Captures atom-level information about peptide residues
class RDKIT_GRAPHMOL_EXPORT AtomPDBResidueInfo : public AtomMonomerInfo {
public:
AtomPDBResidueInfo() : AtomMonomerInfo(PDBRESIDUE) {}
AtomPDBResidueInfo(const AtomPDBResidueInfo &other) = default;
AtomPDBResidueInfo(const 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,
std::string monomerClass = "")
: AtomMonomerInfo(PDBRESIDUE, atomName, residueName, residueNumber, chainId,
monomerClass),
d_serialNumber(serialNumber),
d_altLoc(std::move(altLoc)),
d_insertionCode(std::move(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 &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 override {
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 = 0;
std::string d_altLoc = "";
std::string d_insertionCode = "";
double d_occupancy = 1.0;
double d_tempFactor = 0.0;
// additional, non-PDB fields:
bool df_heteroAtom = false; // is this from a HETATM record?
unsigned int d_secondaryStructure = 0;
unsigned int d_segmentNumber = 0;
};
}; // namespace RDKit
//! allows AtomPDBResidueInfo objects to be dumped to streams
RDKIT_GRAPHMOL_EXPORT std::ostream &operator<<(
std::ostream &target, const RDKit::AtomPDBResidueInfo &apri);
#endif
operator<<
RDKIT_GRAPHMOL_EXPORT std::ostream & operator<<(std::ostream &target, const RDKit::AtomPDBResidueInfo &apri)
allows AtomPDBResidueInfo objects to be dumped to streams
RDKit::AtomMonomerInfo::AtomMonomerInfo
AtomMonomerInfo(AtomMonomerType typ, std::string nm="", std::string residueName="", int resNum=0, std::string chainId="", std::string monomerClass="")
Definition MonomerInfo.h:45
RDKit::AtomMonomerInfo::setName
void setName(const std::string &nm)
Definition MonomerInfo.h:53
RDKit::AtomMonomerInfo::getResidueNumber
int getResidueNumber() const
Definition MonomerInfo.h:58
RDKit::AtomMonomerInfo::~AtomMonomerInfo
virtual ~AtomMonomerInfo()
Definition MonomerInfo.h:30
RDKit::AtomMonomerInfo::AtomMonomerType
AtomMonomerType
Definition MonomerInfo.h:28
RDKit::AtomMonomerInfo::UNKNOWN
@ UNKNOWN
Definition MonomerInfo.h:28
RDKit::AtomMonomerInfo::PDBRESIDUE
@ PDBRESIDUE
Definition MonomerInfo.h:28
RDKit::AtomMonomerInfo::OTHER
@ OTHER
Definition MonomerInfo.h:28
RDKit::AtomMonomerInfo::getName
const std::string & getName() const
Definition MonomerInfo.h:52
RDKit::AtomMonomerInfo::setResidueName
void setResidueName(const std::string &val)
Definition MonomerInfo.h:61
RDKit::AtomMonomerInfo::getChainId
const std::string & getChainId() const
Definition MonomerInfo.h:56
RDKit::AtomMonomerInfo::AtomMonomerInfo
AtomMonomerInfo(const AtomMonomerInfo &other)=default
RDKit::AtomMonomerInfo::setChainId
void setChainId(const std::string &val)
Definition MonomerInfo.h:57
RDKit::AtomMonomerInfo::copy
virtual AtomMonomerInfo * copy() const
Definition MonomerInfo.h:65
RDKit::AtomMonomerInfo::getMonomerClass
const std::string & getMonomerClass() const
Definition MonomerInfo.h:62
RDKit::AtomMonomerInfo::setMonomerType
void setMonomerType(AtomMonomerType typ)
Definition MonomerInfo.h:55
RDKit::AtomMonomerInfo::setResidueNumber
void setResidueNumber(int val)
Definition MonomerInfo.h:59
RDKit::AtomMonomerInfo::getResidueName
const std::string & getResidueName() const
Definition MonomerInfo.h:60
RDKit::AtomMonomerInfo::AtomMonomerInfo
AtomMonomerInfo()=default
RDKit::AtomMonomerInfo::getMonomerType
AtomMonomerType getMonomerType() const
Definition MonomerInfo.h:54
RDKit::AtomMonomerInfo::setMonomerClass
void setMonomerClass(const std::string &val)
Definition MonomerInfo.h:63
RDKit::AtomPDBResidueInfo
Captures atom-level information about peptide residues.
Definition MonomerInfo.h:77
RDKit::AtomPDBResidueInfo::setIsHeteroAtom
void setIsHeteroAtom(bool val)
Definition MonomerInfo.h:112
RDKit::AtomPDBResidueInfo::AtomPDBResidueInfo
AtomPDBResidueInfo(const AtomPDBResidueInfo &other)=default
RDKit::AtomPDBResidueInfo::getTempFactor
double getTempFactor() const
Definition MonomerInfo.h:109
RDKit::AtomPDBResidueInfo::setOccupancy
void setOccupancy(double val)
Definition MonomerInfo.h:108
RDKit::AtomPDBResidueInfo::copy
AtomMonomerInfo * copy() const override
Definition MonomerInfo.h:118
RDKit::AtomPDBResidueInfo::setSecondaryStructure
void setSecondaryStructure(unsigned int val)
Definition MonomerInfo.h:114
RDKit::AtomPDBResidueInfo::getOccupancy
double getOccupancy() const
Definition MonomerInfo.h:107
RDKit::AtomPDBResidueInfo::setInsertionCode
void setInsertionCode(const std::string &val)
Definition MonomerInfo.h:106
RDKit::AtomPDBResidueInfo::getIsHeteroAtom
bool getIsHeteroAtom() const
Definition MonomerInfo.h:111
RDKit::AtomPDBResidueInfo::AtomPDBResidueInfo
AtomPDBResidueInfo()
Definition MonomerInfo.h:79
RDKit::AtomPDBResidueInfo::setAltLoc
void setAltLoc(const std::string &val)
Definition MonomerInfo.h:104
RDKit::AtomPDBResidueInfo::getInsertionCode
const std::string & getInsertionCode() const
Definition MonomerInfo.h:105
RDKit::AtomPDBResidueInfo::setSerialNumber
void setSerialNumber(int val)
Definition MonomerInfo.h:102
RDKit::AtomPDBResidueInfo::getSegmentNumber
unsigned int getSegmentNumber() const
Definition MonomerInfo.h:115
RDKit::AtomPDBResidueInfo::getSerialNumber
int getSerialNumber() const
Definition MonomerInfo.h:101
RDKit::AtomPDBResidueInfo::getSecondaryStructure
unsigned int getSecondaryStructure() const
Definition MonomerInfo.h:113
RDKit::AtomPDBResidueInfo::setSegmentNumber
void setSegmentNumber(unsigned int val)
Definition MonomerInfo.h:116
RDKit::AtomPDBResidueInfo::getAltLoc
const std::string & getAltLoc() const
Definition MonomerInfo.h:103
RDKit::AtomPDBResidueInfo::setTempFactor
void setTempFactor(double val)
Definition MonomerInfo.h:110
RDKit::AtomPDBResidueInfo::AtomPDBResidueInfo
AtomPDBResidueInfo(const 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, std::string monomerClass="")
Definition MonomerInfo.h:82
export.h
RDKIT_GRAPHMOL_EXPORT
#define RDKIT_GRAPHMOL_EXPORT
Definition export.h:257
RDKit
Std stuff.
Definition Abbreviations.h:19