NCBI C++ ToolKit
chemical_graph.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: chemical_graph.hpp 33815 2007-05-04 17:18:18Z kazimird $
2 * ===========================================================================
3 *
4 * PUBLIC DOMAIN NOTICE
5 * National Center for Biotechnology Information
6 *
7 * This software/database is a "United States Government Work" under the
8 * terms of the United States Copyright Act. It was written as part of
9 * the author's official duties as a United States Government employee and
10 * thus cannot be copyrighted. This software/database is freely available
11 * to the public for use. The National Library of Medicine and the U.S.
12 * Government have not placed any restriction on its use or reproduction.
13 *
14 * Although all reasonable efforts have been taken to ensure the accuracy
15 * and reliability of the software and data, the NLM and the U.S.
16 * Government do not and cannot warrant the performance or results that
17 * may be obtained by using this software or data. The NLM and the U.S.
18 * Government disclaim all warranties, express or implied, including
19 * warranties of performance, merchantability or fitness for any particular
20 * purpose.
21 *
22 * Please cite the author in any work or product based on this material.
23 *
24 * ===========================================================================
25 *
26 * Authors: Paul Thiessen
27 *
28 * File Description:
29 * Classes to hold the graph of chemical bonds
30 *
31 * ===========================================================================
32 */
33 
34 #ifndef CN3D_CHEMICALGRAPH__HPP
35 #define CN3D_CHEMICALGRAPH__HPP
36 
37 #include <corelib/ncbistl.hpp>
38 
39 #include <map>
40 #include <string>
41 
45 
46 #include "structure_base.hpp"
47 #include "molecule.hpp"
48 #include "residue.hpp"
49 
50 BEGIN_SCOPE(Cn3D)
51 
52 // to create and delete dictionary - should be called on program init/exit
53 void LoadStandardDictionary(const char *filename);
54 void DeleteStandardDictionary(void);
55 
56 
57 // The ChemicalGraph is the set of bonds that link the atoms (from CoordSets).
58 // The graph is divided into essentially physically separate molecules (e.g.,
59 // protein chains, hets, solvents), occasionally joined by inter-molecule
60 // bonds ("connections" in Cn3D jargon).
61 
62 class Bond;
63 class AtomSet;
64 class StructureObject;
65 class Molecule;
66 
67 typedef std::list< ncbi::CRef< ncbi::objects::CBiostruc_feature_set > > FeatureList;
68 
70 {
71 public:
72  ChemicalGraph(StructureBase *parent, const ncbi::objects::CBiostruc_graph& graph,
73  const FeatureList& features);
74 
75  // public data
77  typedef std::map < int, const Molecule * > MoleculeMap;
79  typedef std::list < const Bond * > BondList;
80  BondList interMoleculeBonds; // includes inter-molecular disulfides
81 
82  // public methods
83 
84  void RedrawMolecule(int moleculeID) const;
85  bool DrawAll(const AtomSet *atomSet = NULL) const;
86  const Residue::AtomInfo * GetAtomInfo(const AtomPntr& atom) const
87  {
88  MoleculeMap::const_iterator info=molecules.find(atom.mID);
89  if (info != molecules.end()) return (*info).second->GetAtomInfo(atom.rID, atom.aID);
90  ERR_POST(ncbi::Warning << "Graph: can't find molecule #" << atom.mID);
91  return NULL;
92  }
93 
94  // check if a bond between the given atoms is a disulfide bond; if so, flag Bond as disulfide, and
95  // add new virtual disulfide Bond for these residues to the given bond list. Returns true if
96  // a virtual disulfide was added to the bondList, false otherwise. (*Not* true or false depending
97  // on whether the bond is actually a disulfide!)
98  bool CheckForDisulfide(const Molecule *molecule,
99  const ncbi::objects::CAtom_pntr& atomPtr1,
100  const ncbi::objects::CAtom_pntr& atomPtr2,
101  std::list < const Bond * > *bondList, Bond *bond, StructureBase *parent);
102 
103 private:
104  typedef std::list < std::pair < AtomSet *, const std::string * > > AtomSetList;
106  unsigned int displayListOtherStart;
107 
108  void UnpackDomainFeatures(const ncbi::objects::CBiostruc_feature_set& featureSet);
109  void UnpackSecondaryStructureFeatures(const ncbi::objects::CBiostruc_feature_set& featureSet);
110 };
111 
112 END_SCOPE(Cn3D)
113 
114 #endif // CN3D_CHEMICALGRAPH__HPP
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
void LoadStandardDictionary(const char *filename)
std::list< ncbi::CRef< ncbi::objects::CBiostruc_feature_set > > FeatureList
void DeleteStandardDictionary(void)
Definition: bond.hpp:50
bool CheckForDisulfide(const Molecule *molecule, const ncbi::objects::CAtom_pntr &atomPtr1, const ncbi::objects::CAtom_pntr &atomPtr2, std::list< const Bond * > *bondList, Bond *bond, StructureBase *parent)
std::list< std::pair< AtomSet *, const std::string * > > AtomSetList
std::string name
unsigned int displayListOtherStart
BondList interMoleculeBonds
void RedrawMolecule(int moleculeID) const
const Residue::AtomInfo * GetAtomInfo(const AtomPntr &atom) const
std::list< const Bond * > BondList
MoleculeMap molecules
void UnpackSecondaryStructureFeatures(const ncbi::objects::CBiostruc_feature_set &featureSet)
AtomSetList atomSetList
bool DrawAll(const AtomSet *atomSet=NULL) const
void UnpackDomainFeatures(const ncbi::objects::CBiostruc_feature_set &featureSet)
std::map< int, const Molecule * > MoleculeMap
ChemicalGraph(StructureBase *parent, const ncbi::objects::CBiostruc_graph &graph, const FeatureList &features)
string
Definition: cgiapp.hpp:687
#define NULL
Definition: ncbistd.hpp:225
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
Definition: ncbidiag.hpp:186
void Warning(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1191
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
static MDB_envinfo info
Definition: mdb_load.c:37
The NCBI C++/STL use hints.
Modified on Wed Jun 19 17:06:48 2024 by modify_doxy.py rev. 669887