Chemical Data Processing Library C++ API - Version 1.4.0
Biomol/AtomFunctions.hpp
Go to the documentation of this file.
1 /*
2  * AtomFunctions.hpp
3  *
4  * This file is part of the Chemical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
29 #ifndef CDPL_BIOMOL_ATOMFUNCTIONS_HPP
30 #define CDPL_BIOMOL_ATOMFUNCTIONS_HPP
31 
32 #include <cstddef>
33 #include <string>
34 
38 
39 
40 namespace CDPL
41 {
42 
43  namespace Chem
44  {
45 
46  class Atom;
47  class MolecularGraph;
48  class Fragment;
49  } // namespace Chem
50 
51  namespace Biomol
52  {
53 
59  CDPL_BIOMOL_API const std::string& getResidueAtomName(const Chem::Atom& atom);
60 
66  CDPL_BIOMOL_API void setResidueAtomName(Chem::Atom& atom, const std::string& name);
67 
73 
80 
81 
87  CDPL_BIOMOL_API const std::string& getResidueAltAtomName(const Chem::Atom& atom);
88 
94  CDPL_BIOMOL_API void setResidueAltAtomName(Chem::Atom& atom, const std::string& name);
95 
101 
108 
109 
116 
123 
129 
136 
137 
144 
151 
157 
164 
165 
171  CDPL_BIOMOL_API const std::string& getResidueCode(const Chem::Atom& atom);
172 
178  CDPL_BIOMOL_API void setResidueCode(Chem::Atom& atom, const std::string& code);
179 
185 
192 
193 
200 
207 
213 
220 
221 
228 
235 
241 
248 
249 
256 
262  CDPL_BIOMOL_API void setHeteroAtomFlag(Chem::Atom& atom, bool is_het);
263 
269 
276 
277 
283  CDPL_BIOMOL_API const std::string& getChainID(const Chem::Atom& atom);
284 
290  CDPL_BIOMOL_API void setChainID(Chem::Atom& atom, const std::string& id);
291 
297 
304 
305 
312 
319 
325 
332 
339  CDPL_BIOMOL_API const std::string& getEntityID(const Chem::Atom& atom);
340 
346  CDPL_BIOMOL_API void setEntityID(Chem::Atom& atom, const std::string& id);
347 
353 
360 
361 
367  CDPL_BIOMOL_API std::size_t getModelNumber(const Chem::Atom& atom);
368 
374  CDPL_BIOMOL_API void setModelNumber(Chem::Atom& atom, std::size_t model_no);
375 
381 
388 
389 
396 
402  CDPL_BIOMOL_API void setSerialNumber(Chem::Atom& atom, long serial_no);
403 
409 
416 
417 
424 
430  CDPL_BIOMOL_API void setOccupancy(Chem::Atom& atom, double occupancy);
431 
437 
444 
445 
451  CDPL_BIOMOL_API double getBFactor(const Chem::Atom& atom);
452 
458  CDPL_BIOMOL_API void setBFactor(Chem::Atom& atom, double factor);
459 
465 
472 
473 
480 
497  CDPL_BIOMOL_API bool matchesResidueInfo(const Chem::Atom& atom, const char* res_code = 0, const char* chain_id = 0, long res_seq_no = IGNORE_SEQUENCE_NO,
498  char ins_code = 0, std::size_t model_no = 0, const char* atom_name = 0, long serial_no = IGNORE_SERIAL_NO);
499 
507  CDPL_BIOMOL_API bool areInSameResidue(const Chem::Atom& atom1, const Chem::Atom& atom2, unsigned int flags = AtomPropertyFlag::DEFAULT);
508 
519  bool cnctd_only = false, unsigned int flags = AtomPropertyFlag::DEFAULT, bool append = false);
520  } // namespace Biomol
521 } // namespace CDPL
522 
523 #endif // CDPL_BIOMOL_ATOMFUNCTIONS_HPP
Definition of the preprocessor macro CDPL_BIOMOL_API.
#define CDPL_BIOMOL_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of constants in namespace CDPL::Biomol::AtomPropertyFlag.
Definition of flags for serial and residue sequence number processing.
Abstract base class representing a chemical atom and its bonded neighborhood.
Definition: Atom.hpp:57
Concrete Chem::MolecularGraph implementation that stores references to a selectable subset of atoms a...
Definition: Fragment.hpp:57
Abstract base class for representations of a chemical structure as a graph of bonded atoms.
Definition: MolecularGraph.hpp:57
constexpr unsigned int DEFAULT
Represents the default set of atom properties.
Definition: Biomol/AtomPropertyFlag.hpp:53
CDPL_BIOMOL_API void setResidueLeavingAtomFlag(Chem::Atom &atom, bool leaving)
Sets the value of the Biomol::AtomProperty::RESIDUE_LEAVING_ATOM_FLAG property of atom to leaving.
CDPL_BIOMOL_API const std::string & getResidueAtomName(const Chem::Atom &atom)
Returns the value of the Biomol::AtomProperty::RESIDUE_ATOM_NAME property of atom.
CDPL_BIOMOL_API bool hasResidueLeavingAtomFlag(const Chem::Atom &atom)
Tells whether atom carries an explicit Biomol::AtomProperty::RESIDUE_LEAVING_ATOM_FLAG property.
const long IGNORE_SEQUENCE_NO
Sentinel value indicating that the residue sequence number should be ignored when matching residues.
Definition: ProcessingFlags.hpp:44
CDPL_BIOMOL_API void setModelNumber(Chem::Atom &atom, std::size_t model_no)
Sets the value of the Biomol::AtomProperty::MODEL_NUMBER property of atom to model_no.
CDPL_BIOMOL_API void setSerialNumber(Chem::Atom &atom, long serial_no)
Sets the value of the Biomol::AtomProperty::SERIAL_NUMBER property of atom to serial_no.
CDPL_BIOMOL_API void clearResidueLinkingAtomFlag(Chem::Atom &atom)
Removes the Biomol::AtomProperty::RESIDUE_LINKING_ATOM_FLAG property from atom.
CDPL_BIOMOL_API bool hasHeteroAtomFlag(const Chem::Atom &atom)
Tells whether atom carries an explicit Biomol::AtomProperty::HETERO_ATOM_FLAG property.
CDPL_BIOMOL_API const std::string & getEntityID(const Chem::Atom &atom)
Returns the value of the Biomol::AtomProperty::ENTITY_ID property of atom.
CDPL_BIOMOL_API char getResidueInsertionCode(const Chem::Atom &atom)
Returns the value of the Biomol::AtomProperty::RESIDUE_INSERTION_CODE property of atom.
CDPL_BIOMOL_API bool getResidueLeavingAtomFlag(const Chem::Atom &atom)
Returns the value of the Biomol::AtomProperty::RESIDUE_LEAVING_ATOM_FLAG property of atom.
CDPL_BIOMOL_API std::size_t getModelNumber(const Chem::Atom &atom)
Returns the value of the Biomol::AtomProperty::MODEL_NUMBER property of atom.
CDPL_BIOMOL_API void clearModelNumber(Chem::Atom &atom)
Removes the Biomol::AtomProperty::MODEL_NUMBER property from atom.
CDPL_BIOMOL_API void setResidueInsertionCode(Chem::Atom &atom, char code)
Sets the value of the Biomol::AtomProperty::RESIDUE_INSERTION_CODE property of atom to code.
CDPL_BIOMOL_API void extractResidueSubstructure(const Chem::Atom &atom, const Chem::MolecularGraph &molgraph, Chem::Fragment &res_substruct, bool cnctd_only=false, unsigned int flags=AtomPropertyFlag::DEFAULT, bool append=false)
Extracts the substructure of the residue atom belongs to into res_substruct.
CDPL_BIOMOL_API bool hasChainID(const Chem::Atom &atom)
Tells whether atom carries an explicit Biomol::AtomProperty::CHAIN_ID property.
CDPL_BIOMOL_API bool hasEntityID(const Chem::Atom &atom)
Tells whether atom carries an explicit Biomol::AtomProperty::ENTITY_ID property.
CDPL_BIOMOL_API bool getHeteroAtomFlag(const Chem::Atom &atom)
Returns the value of the Biomol::AtomProperty::HETERO_ATOM_FLAG property of atom.
CDPL_BIOMOL_API void clearChainID(Chem::Atom &atom)
Removes the Biomol::AtomProperty::CHAIN_ID property from atom.
CDPL_BIOMOL_API void setOccupancy(Chem::Atom &atom, double occupancy)
Sets the value of the Biomol::AtomProperty::OCCUPANCY property of atom to occupancy.
CDPL_BIOMOL_API char getAltLocationID(const Chem::Atom &atom)
Returns the value of the Biomol::AtomProperty::ALT_LOCATION_ID property of atom.
CDPL_BIOMOL_API bool hasResidueAltAtomName(const Chem::Atom &atom)
Tells whether atom carries an explicit Biomol::AtomProperty::RESIDUE_ALT_ATOM_NAME property.
CDPL_BIOMOL_API bool areInSameResidue(const Chem::Atom &atom1, const Chem::Atom &atom2, unsigned int flags=AtomPropertyFlag::DEFAULT)
Tells whether atom1 and atom2 belong to the same residue, comparing the atom properties selected by f...
CDPL_BIOMOL_API void clearResidueInsertionCode(Chem::Atom &atom)
Removes the Biomol::AtomProperty::RESIDUE_INSERTION_CODE property from atom.
CDPL_BIOMOL_API void setEntityID(Chem::Atom &atom, const std::string &id)
Sets the value of the Biomol::AtomProperty::ENTITY_ID property of atom to id.
CDPL_BIOMOL_API void clearResidueSequenceNumber(Chem::Atom &atom)
Removes the Biomol::AtomProperty::RESIDUE_SEQUENCE_NUMBER property from atom.
CDPL_BIOMOL_API long getResidueSequenceNumber(const Chem::Atom &atom)
Returns the value of the Biomol::AtomProperty::RESIDUE_SEQUENCE_NUMBER property of atom.
CDPL_BIOMOL_API bool matchesResidueInfo(const Chem::Atom &atom, const char *res_code=0, const char *chain_id=0, long res_seq_no=IGNORE_SEQUENCE_NO, char ins_code=0, std::size_t model_no=0, const char *atom_name=0, long serial_no=IGNORE_SERIAL_NO)
Tells whether the residue-identity attributes of atom match the given filter values.
CDPL_BIOMOL_API bool hasResidueCode(const Chem::Atom &atom)
Tells whether atom carries an explicit Biomol::AtomProperty::RESIDUE_CODE property.
CDPL_BIOMOL_API void clearResidueAtomName(Chem::Atom &atom)
Removes the Biomol::AtomProperty::RESIDUE_ATOM_NAME property from atom.
CDPL_BIOMOL_API void clearResidueLeavingAtomFlag(Chem::Atom &atom)
Removes the Biomol::AtomProperty::RESIDUE_LEAVING_ATOM_FLAG property from atom.
CDPL_BIOMOL_API void setAltLocationID(Chem::Atom &atom, char id)
Sets the value of the Biomol::AtomProperty::ALT_LOCATION_ID property of atom to id.
CDPL_BIOMOL_API void setResidueCode(Chem::Atom &atom, const std::string &code)
Sets the value of the Biomol::AtomProperty::RESIDUE_CODE property of atom to code.
CDPL_BIOMOL_API bool hasModelNumber(const Chem::Atom &atom)
Tells whether atom carries an explicit Biomol::AtomProperty::MODEL_NUMBER property.
CDPL_BIOMOL_API void setResidueAltAtomName(Chem::Atom &atom, const std::string &name)
Sets the value of the Biomol::AtomProperty::RESIDUE_ALT_ATOM_NAME property of atom to name.
CDPL_BIOMOL_API bool hasBFactor(const Chem::Atom &atom)
Tells whether atom carries an explicit Biomol::AtomProperty::B_FACTOR property.
CDPL_BIOMOL_API double getBFactor(const Chem::Atom &atom)
Returns the value of the Biomol::AtomProperty::B_FACTOR property of atom.
CDPL_BIOMOL_API const std::string & getChainID(const Chem::Atom &atom)
Returns the value of the Biomol::AtomProperty::CHAIN_ID property of atom.
CDPL_BIOMOL_API void setBFactor(Chem::Atom &atom, double factor)
Sets the value of the Biomol::AtomProperty::B_FACTOR property of atom to factor.
CDPL_BIOMOL_API void clearSerialNumber(Chem::Atom &atom)
Removes the Biomol::AtomProperty::SERIAL_NUMBER property from atom.
CDPL_BIOMOL_API const std::string & getResidueAltAtomName(const Chem::Atom &atom)
Returns the value of the Biomol::AtomProperty::RESIDUE_ALT_ATOM_NAME property of atom.
CDPL_BIOMOL_API void clearResidueCode(Chem::Atom &atom)
Removes the Biomol::AtomProperty::RESIDUE_CODE property from atom.
CDPL_BIOMOL_API bool hasSerialNumber(const Chem::Atom &atom)
Tells whether atom carries an explicit Biomol::AtomProperty::SERIAL_NUMBER property.
CDPL_BIOMOL_API bool isPDBBackboneAtom(const Chem::Atom &atom)
Tells whether atom is a backbone atom of a PDB-style amino-acid or nucleotide residue.
CDPL_BIOMOL_API bool hasAltLocationID(const Chem::Atom &atom)
Tells whether atom carries an explicit Biomol::AtomProperty::ALT_LOCATION_ID property.
CDPL_BIOMOL_API bool hasResidueInsertionCode(const Chem::Atom &atom)
Tells whether atom carries an explicit Biomol::AtomProperty::RESIDUE_INSERTION_CODE property.
CDPL_BIOMOL_API void clearEntityID(Chem::Atom &atom)
Removes the Biomol::AtomProperty::ENTITY_ID property from atom.
CDPL_BIOMOL_API void setResidueSequenceNumber(Chem::Atom &atom, long seq_no)
Sets the value of the Biomol::AtomProperty::RESIDUE_SEQUENCE_NUMBER property of atom to seq_no.
CDPL_BIOMOL_API bool getResidueLinkingAtomFlag(const Chem::Atom &atom)
Returns the value of the Biomol::AtomProperty::RESIDUE_LINKING_ATOM_FLAG property of atom.
CDPL_BIOMOL_API void clearHeteroAtomFlag(Chem::Atom &atom)
Removes the Biomol::AtomProperty::HETERO_ATOM_FLAG property from atom.
CDPL_BIOMOL_API bool hasResidueSequenceNumber(const Chem::Atom &atom)
Tells whether atom carries an explicit Biomol::AtomProperty::RESIDUE_SEQUENCE_NUMBER property.
const long IGNORE_SERIAL_NO
Sentinel value indicating that the atom serial number should be ignored when matching atoms.
Definition: ProcessingFlags.hpp:49
CDPL_BIOMOL_API bool hasResidueAtomName(const Chem::Atom &atom)
Tells whether atom carries an explicit Biomol::AtomProperty::RESIDUE_ATOM_NAME property.
CDPL_BIOMOL_API void clearOccupancy(Chem::Atom &atom)
Removes the Biomol::AtomProperty::OCCUPANCY property from atom.
CDPL_BIOMOL_API void setResidueAtomName(Chem::Atom &atom, const std::string &name)
Sets the value of the Biomol::AtomProperty::RESIDUE_ATOM_NAME property of atom to name.
CDPL_BIOMOL_API void setHeteroAtomFlag(Chem::Atom &atom, bool is_het)
Sets the value of the Biomol::AtomProperty::HETERO_ATOM_FLAG property of atom to is_het.
CDPL_BIOMOL_API double getOccupancy(const Chem::Atom &atom)
Returns the value of the Biomol::AtomProperty::OCCUPANCY property of atom.
CDPL_BIOMOL_API bool hasResidueLinkingAtomFlag(const Chem::Atom &atom)
Tells whether atom carries an explicit Biomol::AtomProperty::RESIDUE_LINKING_ATOM_FLAG property.
CDPL_BIOMOL_API void setResidueLinkingAtomFlag(Chem::Atom &atom, bool linking)
Sets the value of the Biomol::AtomProperty::RESIDUE_LINKING_ATOM_FLAG property of atom to linking.
CDPL_BIOMOL_API long getSerialNumber(const Chem::Atom &atom)
Returns the value of the Biomol::AtomProperty::SERIAL_NUMBER property of atom.
CDPL_BIOMOL_API void clearBFactor(Chem::Atom &atom)
Removes the Biomol::AtomProperty::B_FACTOR property from atom.
CDPL_BIOMOL_API void clearAltLocationID(Chem::Atom &atom)
Removes the Biomol::AtomProperty::ALT_LOCATION_ID property from atom.
CDPL_BIOMOL_API void setChainID(Chem::Atom &atom, const std::string &id)
Sets the value of the Biomol::AtomProperty::CHAIN_ID property of atom to id.
CDPL_BIOMOL_API const std::string & getResidueCode(const Chem::Atom &atom)
Returns the value of the Biomol::AtomProperty::RESIDUE_CODE property of atom.
CDPL_BIOMOL_API bool hasOccupancy(const Chem::Atom &atom)
Tells whether atom carries an explicit Biomol::AtomProperty::OCCUPANCY property.
CDPL_BIOMOL_API void clearResidueAltAtomName(Chem::Atom &atom)
Removes the Biomol::AtomProperty::RESIDUE_ALT_ATOM_NAME property from atom.
The namespace of the Chemical Data Processing Library.