Skip to content

Commit c4463a6

Browse files
committed
made threshold for determining relative mass vs absolute
1 parent 4657402 commit c4463a6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

storage/inchi/src/main/java/org/openscience/cdk/inchi/InChIToStructure.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ public class InChIToStructure {
9999
// magic number - indicates isotope mass is relative
100100
private static final int ISOTOPIC_SHIFT_FLAG = 10000;
101101

102+
private static final int ISOTOPIC_SHIFT_RANGE = ISOTOPIC_SHIFT_FLAG - 100;
103+
102104
/**
103105
* Constructor. Generates CDK AtomContainer from InChI.
104106
* @param inchi
@@ -181,7 +183,7 @@ protected void generateAtomContainerFromInchi(IChemObjectBuilder builder) throws
181183
int isotopicMass = iAt.getIsotopicMass();
182184

183185
if (isotopicMass != 0) {
184-
if (0 != (isotopicMass & ISOTOPIC_SHIFT_FLAG)) {
186+
if (isotopicMass > ISOTOPIC_SHIFT_RANGE) {
185187
try {
186188
int massNumber = Isotopes.getInstance().getMajorIsotope(cAt.getAtomicNumber()).getMassNumber();
187189
cAt.setMassNumber(massNumber + (isotopicMass - ISOTOPIC_SHIFT_FLAG));

0 commit comments

Comments
 (0)