Skip to content

Commit 83bb2d8

Browse files
committed
refactored WeightedPathDescriptor by hand
1 parent 5add28c commit 83bb2d8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.openscience.cdk.graph.PathTools;
2424
import org.openscience.cdk.interfaces.IAtom;
2525
import org.openscience.cdk.interfaces.IAtomContainer;
26+
import org.openscience.cdk.interfaces.IElement;
2627
import org.openscience.cdk.qsar.AbstractMolecularDescriptor;
2728
import org.openscience.cdk.qsar.DescriptorSpecification;
2829
import org.openscience.cdk.qsar.DescriptorValue;
@@ -155,6 +156,7 @@ public DescriptorValue calculate(IAtomContainer container) {
155156
IAtomContainer local = AtomContainerManipulator.removeHydrogens(container);
156157
int natom = local.getAtomCount();
157158
DoubleArrayResult retval = new DoubleArrayResult();
159+
158160

159161
ArrayList<List<?>> pathList = new ArrayList<List<?>>();
160162

@@ -181,7 +183,7 @@ public DescriptorValue calculate(IAtomContainer container) {
181183
int count = 0;
182184
for (int i = 0; i < natom; i++) {
183185
IAtom a = local.getAtom(i);
184-
if (a.getSymbol().equalsIgnoreCase("C")) continue;
186+
if (a.getAtomicNumber() == IElement.C) continue;
185187
count++;
186188
for (int j = 0; j < natom; j++) {
187189
IAtom b = local.getAtom(j);
@@ -201,7 +203,7 @@ public DescriptorValue calculate(IAtomContainer container) {
201203
count = 0;
202204
for (int i = 0; i < natom; i++) {
203205
IAtom a = local.getAtom(i);
204-
if (!a.getSymbol().equalsIgnoreCase("O")) continue;
206+
if (a.getAtomicNumber() != IElement.O) continue;
205207
count++;
206208
for (int j = 0; j < natom; j++) {
207209
IAtom b = local.getAtom(j);
@@ -221,7 +223,7 @@ public DescriptorValue calculate(IAtomContainer container) {
221223
count = 0;
222224
for (int i = 0; i < natom; i++) {
223225
IAtom a = local.getAtom(i);
224-
if (!a.getSymbol().equalsIgnoreCase("N")) continue;
226+
if (a.getAtomicNumber() != IElement.N) continue;
225227
count++;
226228
for (int j = 0; j < natom; j++) {
227229
IAtom b = local.getAtom(j);

0 commit comments

Comments
 (0)