Skip to content

Commit

Permalink
Remove fall through comment and bound Oxygen type 60, and Nitrogen type
Browse files Browse the repository at this point in the history
72.
  • Loading branch information
johnmay committed Feb 1, 2019
1 parent 8581f06 commit dc47cec
Showing 1 changed file with 31 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1160,8 +1160,6 @@ else if (xCount == 4)
break;
}

System.out.println("Fall through");

return 0;
}

Expand Down Expand Up @@ -1261,22 +1259,19 @@ private void calcGroup059_060_063(int i) {
} else {

for (int j = 0; j <= ca.size() - 1; j++) {
// if (((IAtom)ca.get(j)).getSymbol().equals("C")) { // for malathion
// O-P(=S)
// was considered to count as group 60

List ca2 = atomContainer.getConnectedAtomsList(((IAtom) ca.get(j)));
for (int k = 0; k <= ca2.size() - 1; k++) {
if (atomContainer.getBond(((IAtom) ca.get(j)), (IAtom) ca2.get(k)).getOrder() == IBond.Order.DOUBLE) {
if (!((IAtom) ca2.get(k)).getSymbol().equals("C")) {
frags[60]++;
alogpfrag[i] = 60;
return;
}
}
}

} // end j ca loop
if (((IAtom)ca.get(j)).getSymbol().equals("C")) {
List ca2 = atomContainer.getConnectedAtomsList(((IAtom) ca.get(j)));
for (int k = 0; k <= ca2.size() - 1; k++) {
if (atomContainer.getBond(((IAtom) ca.get(j)), (IAtom) ca2.get(k)).getOrder() == IBond.Order.DOUBLE) {
if (!((IAtom) ca2.get(k)).getSymbol().equals("C")) {
frags[60]++;
alogpfrag[i] = 60;
return;
}
}
}
}
}

if (ca0.getSymbol().equals("O") || ca1.getSymbol().equals("O")) {
frags[63]++;
Expand Down Expand Up @@ -1317,22 +1312,26 @@ private void calcGroup066_to_079(int i) {
nAl++;
}

// first check if have RC(=O)N or NX=X
for (int j = 0; j <= nbors.size() - 1; j++) {
if (nbors.get(j).getAtomicNumber() == 1)
continue;
List ca2 = atomContainer.getConnectedAtomsList((IAtom) nbors.get(j));
for (int k = 0; k <= ca2.size() - 1; k++) {
IAtom ca2k = (IAtom) ca2.get(k);
if (atomContainer.indexOf(ca2k) != i) {
if (!ca2k.getSymbol().equals("C")) {
if (!ca2k.getFlag(CDKConstants.ISAROMATIC)
if (fragment[i].equals("SsssN") ||
fragment[i].equals("SssNH") ||
fragment[i].equals("SsNH2")) {
// first check if have RC(=O)N or NX=X
for (int j = 0; j <= nbors.size() - 1; j++) {
if (nbors.get(j).getAtomicNumber() == 1)
continue;
List ca2 = atomContainer.getConnectedAtomsList((IAtom) nbors.get(j));
for (int k = 0; k <= ca2.size() - 1; k++) {
IAtom ca2k = (IAtom) ca2.get(k);
if (atomContainer.indexOf(ca2k) != i) {
if (!ca2k.getSymbol().equals("C")) {
if (!ca2k.getFlag(CDKConstants.ISAROMATIC)
&& !((IAtom) nbors.get(j)).getFlag(CDKConstants.ISAROMATIC)
&& !ai.getFlag(CDKConstants.ISAROMATIC)) {
if (atomContainer.getBond(((IAtom) nbors.get(j)), ca2k).getOrder() == IBond.Order.DOUBLE) {
frags[72]++;
alogpfrag[i] = 72;
return;
if (atomContainer.getBond(((IAtom) nbors.get(j)), ca2k).getOrder() == IBond.Order.DOUBLE) {
frags[72]++;
alogpfrag[i] = 72;
return;
}
}
}
}
Expand Down Expand Up @@ -1437,7 +1436,6 @@ private void calcGroup066_to_079(int i) {
return;
}
}

boolean flag1 = false;
boolean flag2 = false;

Expand Down

0 comments on commit dc47cec

Please sign in to comment.