diff --git a/pom.xml b/pom.xml index a2d10da..d50874b 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ gov.nih.ncats molwitch - 0.6.5 + 0.6.6 ncats-molwitch diff --git a/src/main/java/gov/nih/ncats/molwitch/Bond.java b/src/main/java/gov/nih/ncats/molwitch/Bond.java index f2a1202..bd73d63 100644 --- a/src/main/java/gov/nih/ncats/molwitch/Bond.java +++ b/src/main/java/gov/nih/ncats/molwitch/Bond.java @@ -250,6 +250,10 @@ public enum DoubleBondStereo { * Z (from zusammen, the German word for "together"). */ Z_CIS; + + public boolean isDefined() { + return this == Z_CIS || this == E_TRANS; + } } diff --git a/src/main/java/gov/nih/ncats/molwitch/Chirality.java b/src/main/java/gov/nih/ncats/molwitch/Chirality.java index 0b99e89..7dce0db 100644 --- a/src/main/java/gov/nih/ncats/molwitch/Chirality.java +++ b/src/main/java/gov/nih/ncats/molwitch/Chirality.java @@ -32,7 +32,15 @@ public enum Chirality { * Sinister (left, even). priority decreases in counterclockwise direction. */ S(2), - Parity_Either(3); + Parity_Either(3), + /** + * Psuedo-Rectus (right, odd). Priority decreases in clockwise direction. + */ + r(4), + /** + * Psuedo-Sinister (left, even). priority decreases in counterclockwise direction. + */ + s(5); @@ -42,8 +50,8 @@ public enum Chirality { private static final Chirality[] VALUES; private static final Chirality[] INVERTED; static { - VALUES = new Chirality[] {Non_Chiral, R, S, Parity_Either}; - INVERTED = new Chirality[] {Unknown,Non_Chiral, S, R, Parity_Either}; + VALUES = new Chirality[] {Non_Chiral, R, S, Parity_Either, r, s}; + INVERTED = new Chirality[] {Unknown,Non_Chiral, S, R, Parity_Either, s, r}; } Chirality(int v){ @@ -65,9 +73,19 @@ public boolean isEither(){ public int getParity(){ return parity; } + public boolean isRForm() { + return parity==1 || parity==4; + } + public boolean isSForm() { + return parity==2 || parity==5; + } + + public boolean isDefined() { + return parity==2 || parity==1 || parity==4 || parity==5; + } public static Chirality valueByParity(int parity) { - if(parity <0 || parity > 3) { + if(parity <0 || parity > 5) { return Unknown; } return VALUES[parity];