Skip to content

Commit b3ddbe5

Browse files
committed
Alpha carbon check should only apply to Sp3 carbons... move it to where we have this value.
1 parent 8e3e2e9 commit b3ddbe5

File tree

1 file changed

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

1 file changed

+23
-23
lines changed

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

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,29 +1050,6 @@ private int getHAtomType(IAtom ai, List connectedAtoms) {
10501050
else
10511051
ca = connectedAtoms;
10521052

1053-
// first check for alpha carbon:
1054-
// -C=X, -C#X and -C:X
1055-
if (ai.getSymbol().equals("C") && !ai.getFlag(CDKConstants.ISAROMATIC)) {
1056-
boolean noXfirstShell = true;
1057-
boolean xInSecondShell = false;
1058-
for (int j = 0; j <= ca.size() - 1; j++) {
1059-
if (atomContainer.getBond(ai, ((IAtom) ca.get(j))).getOrder() == IBond.Order.SINGLE
1060-
&& ((IAtom) ca.get(j)).getSymbol().equals("C")) { // single bonded
1061-
IAtom aCarbon = ca.get(j);
1062-
for (IBond bond : aCarbon.bonds()) {
1063-
IAtom nbor = bond.getOther(aCarbon);
1064-
if (isHetero(nbor) && (bond.isAromatic() || bond.getOrder() != IBond.Order.SINGLE))
1065-
xInSecondShell = true;
1066-
}
1067-
} else {
1068-
if (isHetero(ca.get(j)))
1069-
noXfirstShell = false;
1070-
}
1071-
}
1072-
if (noXfirstShell && xInSecondShell)
1073-
return 51;
1074-
} // end if(ai.getSymbol().equals("C") && !ai.getFlag(CDKConstants.ISAROMATIC))
1075-
10761053
IAtomType.Hybridization hyb;
10771054

10781055
int ndoub = 0;
@@ -1122,6 +1099,29 @@ else if (ndoub == 2 || ntrip == 1)
11221099
else
11231100
return 0; // unknown
11241101

1102+
// first check for alpha carbon:
1103+
// -C=X, -C#X and -C:X
1104+
if (ai.getAtomicNumber() == 6 && !ai.isAromatic() && hyb == IAtomType.Hybridization.SP3) {
1105+
boolean noXfirstShell = true;
1106+
boolean xInSecondShell = false;
1107+
for (int j = 0; j <= ca.size() - 1; j++) {
1108+
if (atomContainer.getBond(ai, ((IAtom) ca.get(j))).getOrder() == IBond.Order.SINGLE
1109+
&& ((IAtom) ca.get(j)).getSymbol().equals("C")) { // single bonded
1110+
IAtom aCarbon = ca.get(j);
1111+
for (IBond bond : aCarbon.bonds()) {
1112+
IAtom nbor = bond.getOther(aCarbon);
1113+
if (isHetero(nbor) && (bond.isAromatic() || bond.getOrder() != IBond.Order.SINGLE))
1114+
xInSecondShell = true;
1115+
}
1116+
} else {
1117+
if (isHetero(ca.get(j)))
1118+
noXfirstShell = false;
1119+
}
1120+
}
1121+
if (noXfirstShell && xInSecondShell)
1122+
return 51;
1123+
}
1124+
11251125
switch (hyb) {
11261126
case SP1:
11271127
if (oxNum == 0)

0 commit comments

Comments
 (0)