Skip to content

Commit a59d790

Browse files
committed
More changes to htype 51, maybe still needs more work.
1 parent 3e7dbb9 commit a59d790

File tree

1 file changed

+9
-2
lines changed
  • descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular

1 file changed

+9
-2
lines changed

descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/ALOGPDescriptor.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,8 @@ private int getHAtomType(IAtom ai, List connectedAtoms) {
10331033
// first check for alpha carbon:
10341034
// -C=X, -C#X and -C:X
10351035
if (ai.getSymbol().equals("C") && !ai.getFlag(CDKConstants.ISAROMATIC)) {
1036+
boolean noXfirstShell = true;
1037+
boolean xInSecondShell = false;
10361038
for (int j = 0; j <= ca.size() - 1; j++) {
10371039
if (atomContainer.getBond(ai, ((IAtom) ca.get(j))).getOrder() == IBond.Order.SINGLE
10381040
&& ((IAtom) ca.get(j)).getSymbol().equals("C")) { // single bonded
@@ -1042,8 +1044,13 @@ private int getHAtomType(IAtom ai, List connectedAtoms) {
10421044
if (isHetero(nbor) && (bond.isAromatic() || bond.getOrder() != IBond.Order.SINGLE))
10431045
xInSecondShell = true;
10441046
}
1045-
} // end if (atomContainer.getBond(ai, ((IAtom)ca.get(j))).getOrder() == IBond.Order.SINGLE) {
1046-
}// end j loop
1047+
} else {
1048+
if (isHetero(ca.get(j)))
1049+
noXfirstShell = false;
1050+
}
1051+
}
1052+
if (noXfirstShell && xInSecondShell)
1053+
return 51;
10471054
} // end if(ai.getSymbol().equals("C") && !ai.getFlag(CDKConstants.ISAROMATIC))
10481055

10491056
List bonds = atomContainer.getConnectedBondsList(ai);

0 commit comments

Comments
 (0)