本文整理汇总了C++中BaseMolecule::possibleAtomIsotope方法的典型用法代码示例。如果您正苦于以下问题:C++ BaseMolecule::possibleAtomIsotope方法的具体用法?C++ BaseMolecule::possibleAtomIsotope怎么用?C++ BaseMolecule::possibleAtomIsotope使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseMolecule
的用法示例。
在下文中一共展示了BaseMolecule::possibleAtomIsotope方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: markIgnoredHydrogens
void MoleculeSubstructureMatcher::markIgnoredHydrogens (BaseMolecule &mol, int *arr, int value_keep, int value_ignore)
{
int i;
for (i = mol.vertexBegin(); i != mol.vertexEnd(); i = mol.vertexNext(i))
arr[i] = value_keep;
for (i = mol.vertexBegin(); i != mol.vertexEnd(); i = mol.vertexNext(i))
{
if (mol.getAtomNumber(i) != ELEM_H)
continue;
if (!mol.possibleAtomIsotope(i, 0))
continue;
if (mol.isQueryMolecule())
{
// Check if atom has fragment constraint.
// For example [$([#1][N])] should be ignored
if (mol.asQueryMolecule().getAtom(i).hasConstraint(QueryMolecule::ATOM_FRAGMENT))
continue;
}
const Vertex &vertex = mol.getVertex(i);
if (vertex.degree() == 1)
{
int nei_idx = vertex.neiVertex(vertex.neiBegin());
if (mol.getAtomNumber(nei_idx) == ELEM_H && mol.possibleAtomIsotope(nei_idx, 0))
continue; // do not ignore rare H-H fragment
// Check if hydrogen forms a cis-trans bond or stereocenter
int nei_vertex_idx = vertex.neiVertex(vertex.neiBegin());
if (mol.stereocenters.exists(nei_vertex_idx))
continue;
// For example for this query hydrogens should be unfolded: [H]\\C=C/C
const Vertex &nei_vertex = mol.getVertex(nei_vertex_idx);
bool not_ignore = false;
for (int nei = nei_vertex.neiBegin(); nei != nei_vertex.neiEnd(); nei = nei_vertex.neiNext(nei))
{
int edge = nei_vertex.neiEdge(nei);
if (mol.cis_trans.getParity(edge) != 0)
{
not_ignore = true;
break;
}
}
if (not_ignore)
continue;
arr[i] = value_ignore;
}
}
}
示例2: matchAtomsTau
bool TautomerMatcher::matchAtomsTau (BaseMolecule &g1, BaseMolecule &g2, int n1, int n2)
{
if (g1.isPseudoAtom(n1) || g2.isPseudoAtom(n2))
return false;
if (g1.isRSite(n1) || g2.isRSite(n2))
return false;
return g1.getAtomNumber(n1) == g2.getAtomNumber(n2) &&
g1.possibleAtomIsotope(n1, g2.getAtomIsotope(n2));
}