Loading...
Searching...
No Matches
chains.h
Go to the documentation of this file.
/**********************************************************************
chains.h - Parse for macromolecule chains and residues
Copyright (C) 1998-2001 by OpenEye Scientific Software, Inc.
Some portions Copyright (C) 2001-2006 by Geoffrey R. Hutchison
Some portions Copyright (C) 2008 by Tim Vandermeersch
This file is part of the Open Babel project.
For more information, see <http://openbabel.org/>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
***********************************************************************/
#ifndef OB_CHAINS_H
#define OB_CHAINS_H
#define MaxMonoAtom 20
#define MaxMonoBond 20
#include <openbabel/babelconfig.h>
#include <vector>
namespace OpenBabel
{
class OBAtom;
class OBMol;
// implementation in chains.cpp
struct Template;
typedef struct Template Template;
class OBAPI OBChainsParser
{
public:
OBChainsParser(void);
~OBChainsParser(void);
bool PerceiveChains(OBMol &mol, bool nukeSingleResidue = false);
private: // internal methods
bool DetermineHetAtoms(OBMol &);
bool DetermineConnectedChains(OBMol &);
unsigned int RecurseChain(OBMol &mol, unsigned int i, int c);
bool DeterminePeptideBackbone(OBMol &);
void ConstrainBackbone(OBMol &mol, Template *templ, int tmax);
bool MatchConstraint(OBAtom *atom, int mask);
bool Match2Constraints(Template *templ, OBAtom *na, OBAtom *nb);
bool Match3Constraints(Template *templ, OBAtom *na, OBAtom *nb, OBAtom *nc);
bool Match4Constraints(Template *templ, OBAtom *na, OBAtom *nb, OBAtom *nc, OBAtom *nd);
void TracePeptideChain(OBMol &mol, unsigned int i, int r);
bool DeterminePeptideSidechains(OBMol &);
int IdentifyResidue(void *tree, OBMol &mol, unsigned int seed, int resno); // ByteCode *
void AssignResidue(OBMol &mol, int r, int c, int i);
bool DetermineHydrogens(OBMol &);
void SetResidueInformation(OBMol &, bool nukeSingleResidue);
bool DetermineNucleicBackbone(OBMol &);
void TraceNucleicChain(OBMol &, unsigned int i, int r);
bool DetermineNucleicSidechains(OBMol &);
void SetupMol(OBMol &);
void ClearResidueInformation(OBMol &mol);
void CleanupMol();
void DefineMonomer(void **tree, int resid, const char *smiles); // ByteCode **
int IdentifyElement(char *ptr);
const char *ParseSmiles(const char *smiles, int prev);
void DumpState();
void *PDecisionTree;
void *NDecisionTree;
int ResMonoAtom[MaxMonoAtom];
int ResMonoBond[MaxMonoBond];
std::vector<unsigned short> bitmasks;
std::vector<bool> visits;
std::vector<unsigned char> resids;
std::vector<unsigned char> flags;
std::vector<bool> hetflags;
std::vector<int> atomids;
std::vector<short> resnos;
std::vector<short> sernos;
std::vector<char> hcounts;
std::vector<char> chains;
};
OB_EXTERN OBChainsParser chainsparser;
}
#endif // OB_CHAINS_H
OB_EXTERN
#define OB_EXTERN
Definition atom.h:27
MaxMonoAtom
#define MaxMonoAtom
Definition chains.h:24
MaxMonoBond
#define MaxMonoBond
Definition chains.h:25
OpenBabel::OBAtom
Atom class.
Definition atom.h:72
OpenBabel::OBChainsParser
Perceives peptide or nucleotide chains and residues in an OBMol.
Definition chains.h:50
OpenBabel::OBChainsParser::OBChainsParser
OBChainsParser(void)
Definition chains.cpp:763
OpenBabel::OBChainsParser::PerceiveChains
bool PerceiveChains(OBMol &mol, bool nukeSingleResidue=false)
Definition chains.cpp:957
OpenBabel::OBMol
Molecule Class.
Definition mol.h:121
OpenBabel
Global namespace for all Open Babel code.
Definition alias.h:23
OpenBabel::Template
struct Template Template
Structure template for atomic patterns in residues for OBChainsParser.
Definition chains.h:39
OpenBabel::chainsparser
OB_EXTERN OBChainsParser chainsparser
Global OBChainsParser for detecting macromolecular chains and residues.
Definition chains.h:286