本文整理汇总了C++中OBMol::HasAromaticPerceived方法的典型用法代码示例。如果您正苦于以下问题:C++ OBMol::HasAromaticPerceived方法的具体用法?C++ OBMol::HasAromaticPerceived怎么用?C++ OBMol::HasAromaticPerceived使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OBMol
的用法示例。
在下文中一共展示了OBMol::HasAromaticPerceived方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsAromatic
bool OBBond::IsAromatic() const
{
OBMol *mol = ((OBBond*)this)->GetParent();
if (!mol->HasAromaticPerceived())
aromtyper.AssignAromaticFlags(*mol);
if (this->HasFlag(OB_AROMATIC_BOND))
return true;
return false;
}
示例2: IsAromatic
bool OBBond::IsAromatic() const
{
if (((OBBond*)this)->HasFlag(OB_AROMATIC_BOND))
return(true);
OBMol *mol = (OBMol*)((OBBond*)this)->GetParent();
if (!mol->HasAromaticPerceived())
{
aromtyper.AssignAromaticFlags(*mol);
if (((OBBond*)this)->HasFlag(OB_AROMATIC_BOND))
return(true);
}
return(false);
}
示例3: AssignAromaticFlags
void OBAromaticTyper::AssignAromaticFlags(OBMol &mol)
{
if (!_init)
Init();
if (mol.HasAromaticPerceived())
return;
mol.SetAromaticPerceived();
obErrorLog.ThrowError(__FUNCTION__,
"Ran OpenBabel::AssignAromaticFlags", obAuditMsg);
_vpa.clear();
_vpa.resize(mol.NumAtoms()+1);
_velec.clear();
_velec.resize(mol.NumAtoms()+1);
_root.clear();
_root.resize(mol.NumAtoms()+1);
OBBond *bond;
OBAtom *atom;
vector<OBAtom*>::iterator i;
vector<OBBond*>::iterator j;
//unset all aromatic flags
for (atom = mol.BeginAtom(i);atom;atom = mol.NextAtom(i))
atom->UnsetAromatic();
for (bond = mol.BeginBond(j);bond;bond = mol.NextBond(j))
bond->UnsetAromatic();
int idx;
vector<vector<int> >::iterator m;
vector<OBSmartsPattern*>::iterator k;
//mark atoms as potentially aromatic
for (idx=0,k = _vsp.begin();k != _vsp.end();++k,++idx)
if ((*k)->Match(mol))
{
_mlist = (*k)->GetMapList();
for (m = _mlist.begin();m != _mlist.end();++m)
{
_vpa[(*m)[0]] = true;
_velec[(*m)[0]] = _verange[idx];
}
}
//sanity check - exclude all 4 substituted atoms and sp centers
for (atom = mol.BeginAtom(i);atom;atom = mol.NextAtom(i))
{
if (atom->GetImplicitValence() > 3)
{
_vpa[atom->GetIdx()] = false;
continue;
}
switch(atom->GetAtomicNum())
{
//phosphorus and sulfur may be initially typed as sp3
case 6:
case 7:
case 8:
if (atom->GetHyb() != 2)
_vpa[atom->GetIdx()] = false;
break;
}
}
//propagate potentially aromatic atoms
for (atom = mol.BeginAtom(i);atom;atom = mol.NextAtom(i))
if (_vpa[atom->GetIdx()])
PropagatePotentialAromatic(atom);
//select root atoms
SelectRootAtoms(mol);
ExcludeSmallRing(mol); //remove 3 membered rings from consideration
//loop over root atoms and look for aromatic rings
_visit.clear();
_visit.resize(mol.NumAtoms()+1);
for (atom = mol.BeginAtom(i);atom;atom = mol.NextAtom(i))
if (_root[atom->GetIdx()])
CheckAromaticity(atom,14);
//for (atom = mol.BeginAtom(i);atom;atom = mol.NextAtom(i))
// if (atom->IsAromatic())
// cerr << "aro = " <<atom->GetIdx() << endl;
//for (bond = mol.BeginBond(j);bond;bond = mol.NextBond(j))
//if (bond->IsAromatic())
//cerr << bond->GetIdx() << ' ' << bond->IsAromatic() << endl;
}