Skip to content

Commit

Permalink
& --> && and | --> ||
Browse files Browse the repository at this point in the history
  • Loading branch information
k-ujihara committed May 5, 2017
1 parent bd67561 commit a66b51f
Showing 1 changed file with 16 additions and 16 deletions.
Expand Up @@ -302,19 +302,19 @@ public IRingSet assignAtomTyps(IAtomContainer molecule) throws CDKException {
bondType = "0";
if (bond.getOrder() == IBond.Order.SINGLE) {
if ((bond.getBegin().getAtomTypeName().equals("Csp2"))
& ((bond.getEnd().getAtomTypeName().equals("Csp2")) | (bond.getEnd().getAtomTypeName()
&& ((bond.getEnd().getAtomTypeName().equals("Csp2")) || (bond.getEnd().getAtomTypeName()
.equals("C=")))) {
bondType = "1";
}

if ((bond.getBegin().getAtomTypeName().equals("C="))
& ((bond.getEnd().getAtomTypeName().equals("Csp2")) | (bond.getEnd().getAtomTypeName()
&& ((bond.getEnd().getAtomTypeName().equals("Csp2")) || (bond.getEnd().getAtomTypeName()
.equals("C=")))) {
bondType = "1";
}

if ((bond.getBegin().getAtomTypeName().equals("Csp"))
& (bond.getEnd().getAtomTypeName().equals("Csp"))) {
&& (bond.getEnd().getAtomTypeName().equals("Csp"))) {
bondType = "1";
}
}
Expand Down Expand Up @@ -436,7 +436,7 @@ public IAtom configureMM2BasedAtom(IAtom atom, String hoseCode, boolean hetRing)
if (atom.getProperty("RING_SIZE").equals(Integer.valueOf(3))) {
ID = ids[21];
} else if (atom.getProperty("RING_SIZE").equals(Integer.valueOf(6))
& atom.getFlag(CDKConstants.ISAROMATIC)) {
&& atom.getFlag(CDKConstants.ISAROMATIC)) {
ID = ids[1];
} else if (atom.getFlag(CDKConstants.ISAROMATIC)) {
ID = ids[1];
Expand All @@ -446,7 +446,7 @@ public IAtom configureMM2BasedAtom(IAtom atom, String hoseCode, boolean hetRing)
//csp2
if (atom.getFlag(CDKConstants.ISINRING)) {
if (atom.getProperty("RING_SIZE").equals(Integer.valueOf(6))
& atom.getFlag(CDKConstants.ISAROMATIC)) {
&& atom.getFlag(CDKConstants.ISAROMATIC)) {
} else if (atom.getProperty("RING_SIZE").equals(Integer.valueOf(3))) {
ID = ids[37];
} else {
Expand All @@ -456,7 +456,7 @@ public IAtom configureMM2BasedAtom(IAtom atom, String hoseCode, boolean hetRing)
p = (Pattern) atomTypePattern.get(2);
//COOH
mat = p.matcher(hoseCode);
if (mat.matches() & !atom.getFlag(CDKConstants.ISINRING)) {
if (mat.matches() && !atom.getFlag(CDKConstants.ISINRING)) {
ID = ids[2];
}

Expand All @@ -467,23 +467,23 @@ public IAtom configureMM2BasedAtom(IAtom atom, String hoseCode, boolean hetRing)
ID = ids[48];
//EPOXY
} else if (atom.getProperty("RING_SIZE").equals(Integer.valueOf(5))
& atom.getFlag(CDKConstants.ISAROMATIC)) {
&& atom.getFlag(CDKConstants.ISAROMATIC)) {
ID = ids[40];
} else {
ID = ids[5];
}
}
} else if (j == 7) {
//n sp3
if (atom.getFlag(CDKConstants.ISINRING) & atom.getFlag(CDKConstants.ISAROMATIC)) {
if (atom.getFlag(CDKConstants.ISINRING) && atom.getFlag(CDKConstants.ISAROMATIC)) {
if (atom.getProperty("RING_SIZE").equals(Integer.valueOf(5))) {
ID = ids[39];
}
}
//Amid
p = (Pattern) atomTypePattern.get(77);
mat = p.matcher(hoseCode);
if (mat.matches() & !atom.getFlag(CDKConstants.ISINRING)) {
if (mat.matches() && !atom.getFlag(CDKConstants.ISINRING)) {
ID = ids[8];
}
} else if (j == 8) {
Expand All @@ -496,7 +496,7 @@ public IAtom configureMM2BasedAtom(IAtom atom, String hoseCode, boolean hetRing)
p = (Pattern) atomTypePattern.get(36);
//AZO
mat = p.matcher(hoseCode);
if (mat.matches() & !atom.getFlag(CDKConstants.ISINRING)) {
if (mat.matches() && !atom.getFlag(CDKConstants.ISINRING)) {
ID = ids[36];
}

Expand All @@ -511,13 +511,13 @@ public IAtom configureMM2BasedAtom(IAtom atom, String hoseCode, boolean hetRing)
p = (Pattern) atomTypePattern.get(76);
//Enol
mat = p.matcher(hoseCode);
if (mat.matches() & !atom.getFlag(CDKConstants.ISINRING)) {
if (mat.matches() && !atom.getFlag(CDKConstants.ISINRING)) {
ID = ids[27];
}
p = (Pattern) atomTypePattern.get(23);
//COOH
mat = p.matcher(hoseCode);
if (mat.matches() & !atom.getFlag(CDKConstants.ISINRING)) {
if (mat.matches() && !atom.getFlag(CDKConstants.ISINRING)) {
ID = ids[23];
}
} else if (j == 22) {
Expand Down Expand Up @@ -605,10 +605,10 @@ public IAtom configureMMFF94BasedAtom(IAtom atom, String hoseCode, boolean isInH
&& atom.getProperty("RING_SIZE").equals(Integer.valueOf(5))) {
ID = ids[12];
} else if (atom.getProperty("RING_SIZE").equals(Integer.valueOf(3))
& !atom.getFlag(CDKConstants.ISAROMATIC)) {
&& !atom.getFlag(CDKConstants.ISAROMATIC)) {
ID = ids[9];//sp3 3mem rings
} else if (atom.getProperty("RING_SIZE").equals(Integer.valueOf(4))
& !atom.getFlag(CDKConstants.ISAROMATIC)) {
&& !atom.getFlag(CDKConstants.ISAROMATIC)) {
ID = ids[8];//sp3 4mem rings
} else if (atom.getFlag(CDKConstants.ISAROMATIC) && isInHetRing
&& atom.getProperty("RING_SIZE").equals(Integer.valueOf(5))) {
Expand All @@ -626,7 +626,7 @@ public IAtom configureMMFF94BasedAtom(IAtom atom, String hoseCode, boolean isInH
} else if (j == 1) {//csp2
if (atom.getFlag(CDKConstants.ISINRING)) {
if (atom.getProperty("RING_SIZE").equals(Integer.valueOf(4))
& !atom.getFlag(CDKConstants.ISAROMATIC) && !isInHetRing) {
&& !atom.getFlag(CDKConstants.ISAROMATIC) && !isInHetRing) {
ID = ids[29];//C= in 4 ring
}
}
Expand All @@ -640,7 +640,7 @@ public IAtom configureMMFF94BasedAtom(IAtom atom, String hoseCode, boolean isInH
//Amid
p = (Pattern) atomTypePattern.get(48);
mat = p.matcher(hoseCode);
if (mat.matches() & !atom.getFlag(CDKConstants.ISINRING)) {
if (mat.matches() && !atom.getFlag(CDKConstants.ISINRING)) {
ID = ids[48];
}

Expand Down

0 comments on commit a66b51f

Please sign in to comment.