File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
storage/inchi/src/main/java/org/openscience/cdk/inchi Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -98,8 +98,13 @@ public class InChIToStructure {
9898
9999 // magic number - indicates isotope mass is relative
100100 private static final int ISOTOPIC_SHIFT_FLAG = 10000 ;
101-
102- private static final int ISOTOPIC_SHIFT_RANGE = ISOTOPIC_SHIFT_FLAG - 100 ;
101+ /**
102+ * JNI-Inchi uses the magic number {#link ISOTOPIC_SHIFT_FLAG} plus the
103+ * (possibly negative) relative mass. So any isotope value
104+ * coming back from jni-inchi greater than this threshold value
105+ * should be treated as a relative mass.
106+ */
107+ private static final int ISOTOPIC_SHIFT_THRESHOLD = ISOTOPIC_SHIFT_FLAG - 100 ;
103108
104109 /**
105110 * Constructor. Generates CDK AtomContainer from InChI.
@@ -183,7 +188,7 @@ protected void generateAtomContainerFromInchi(IChemObjectBuilder builder) throws
183188 int isotopicMass = iAt .getIsotopicMass ();
184189
185190 if (isotopicMass != 0 ) {
186- if (isotopicMass > ISOTOPIC_SHIFT_RANGE ) {
191+ if (isotopicMass > ISOTOPIC_SHIFT_THRESHOLD ) {
187192 try {
188193 int massNumber = Isotopes .getInstance ().getMajorIsotope (cAt .getAtomicNumber ()).getMassNumber ();
189194 cAt .setMassNumber (massNumber + (isotopicMass - ISOTOPIC_SHIFT_FLAG ));
You can’t perform that action at this time.
0 commit comments