File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
main/java/org/openscience/cdk/inchi
test/java/org/openscience/cdk/inchi Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -181,7 +181,7 @@ protected void generateAtomContainerFromInchi(IChemObjectBuilder builder) throws
181181 int isotopicMass = iAt .getIsotopicMass ();
182182
183183 if (isotopicMass != 0 ) {
184- if (ISOTOPIC_SHIFT_FLAG = = (isotopicMass & ISOTOPIC_SHIFT_FLAG )) {
184+ if (0 ! = (isotopicMass & ISOTOPIC_SHIFT_FLAG )) {
185185 try {
186186 int massNumber = Isotopes .getInstance ().getMajorIsotope (cAt .getAtomicNumber ()).getMassNumber ();
187187 cAt .setMassNumber (massNumber + (isotopicMass - ISOTOPIC_SHIFT_FLAG ));
Original file line number Diff line number Diff line change @@ -256,4 +256,13 @@ public void readImplicitDeuteriums() throws Exception {
256256 }
257257 assertThat (dCount , is (5 ));
258258 }
259+
260+ @ Test
261+ public void isotope () throws Exception {
262+ InChIToStructure parse = new InChIToStructure ("InChI=1S/HI/h1H/p-1/i1-6" ,
263+ SilentChemObjectBuilder .getInstance ());
264+ IAtomContainer mol = parse .getAtomContainer ();
265+ assertThat (mol .getAtomCount (), is (1 ));
266+ assertThat (mol .getAtom (0 ).getMassNumber (), is (121 ));
267+ }
259268}
You can’t perform that action at this time.
0 commit comments