Skip to content

Commit f0d4e7e

Browse files
committed
Add logic for atom type 40.
1 parent a96f8a0 commit f0d4e7e

1 file changed

Lines changed: 15 additions & 9 deletions

File tree

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

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

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -705,15 +705,21 @@ else if (atomContainer.getBond(ai, ((IAtom) ca.get(j))).getOrder() == IBond.Orde
705705

706706
if (haveCdX) {
707707
if (aromaticCount >= 1) { // Ar-C(=X)-R
708-
// TODO: add code to check if have R or X for nonaromatic
709-
// attachment to C?
710-
// if we do this check we would have missing fragment for
711-
// Ar-C(=X)-X
712-
// TODO: which fragment to use if we have Ar-C(=X)-Ar? Currently
713-
// this frag is used
714-
715-
frags[39]++;
716-
alogpfrag[i] = 39;
708+
for (IBond bond : ai.bonds()) {
709+
if (bond.getOrder() != IBond.Order.SINGLE)
710+
continue;
711+
IAtom nbor = bond.getOther(ai);
712+
if (!nbor.isAromatic()) {
713+
if (isHetero(nbor)) {
714+
frags[40]++;
715+
alogpfrag[i] = 40;
716+
} else {
717+
frags[39]++;
718+
alogpfrag[i] = 39;
719+
}
720+
}
721+
}
722+
717723
}
718724
else if (aromaticCount == 0) {
719725
if (rCount == 1 && xCount == 1) {

0 commit comments

Comments
 (0)