Skip to content

Commit

Permalink
More changes to htype 51, maybe still needs more work.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmay committed Jan 30, 2019
1 parent 3e7dbb9 commit a59d790
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,8 @@ private int getHAtomType(IAtom ai, List connectedAtoms) {
// first check for alpha carbon:
// -C=X, -C#X and -C:X
if (ai.getSymbol().equals("C") && !ai.getFlag(CDKConstants.ISAROMATIC)) {
boolean noXfirstShell = true;
boolean xInSecondShell = false;
for (int j = 0; j <= ca.size() - 1; j++) {
if (atomContainer.getBond(ai, ((IAtom) ca.get(j))).getOrder() == IBond.Order.SINGLE
&& ((IAtom) ca.get(j)).getSymbol().equals("C")) { // single bonded
Expand All @@ -1042,8 +1044,13 @@ private int getHAtomType(IAtom ai, List connectedAtoms) {
if (isHetero(nbor) && (bond.isAromatic() || bond.getOrder() != IBond.Order.SINGLE))
xInSecondShell = true;
}
} // end if (atomContainer.getBond(ai, ((IAtom)ca.get(j))).getOrder() == IBond.Order.SINGLE) {
}// end j loop
} else {
if (isHetero(ca.get(j)))
noXfirstShell = false;
}
}
if (noXfirstShell && xInSecondShell)
return 51;
} // end if(ai.getSymbol().equals("C") && !ai.getFlag(CDKConstants.ISAROMATIC))

List bonds = atomContainer.getConnectedBondsList(ai);
Expand Down

0 comments on commit a59d790

Please sign in to comment.