Repository: rdkit/rdkit — pull request #8342 (cpp)
Title: Fixes #7983

This is an alternate (and hopefully correct) approach to the fix earlier proposed in #8242 

We fix this by moving the call to `cleanupAtropisomerStereoGroups()` into `assignStereochemistry()`.

This also adds some more tests.

More explanation coming.


Resolved issues:
title: Stereogroup lost when importing chiral sulfoxide from v3000 molfile
body: Hello,

We came across the following issue.

When I import a compound containing a chiral sulfoxide with the corresponding stereogroup, the behavior is different when I import from cxsmiles vs when I import from v3000 molfile.

```
from rdkit import Chem
smilesParserParams = Chem.SmilesParserParams()
smilesParserParams.allowCXSMILES = True

source_smi = 'Cc1ccc(NC(=O)OCc2ccccc2[S@](C)=O)cc1 |a:16|'
mol: Chem.Mol = Chem.MolFromSmiles(source_smi, smilesParserParams)
mol.Debug()

```
Result:
...
	16 16 S chg: 0  deg: 3 exp: 4 imp: 0 hyb: SP3 chi: CCW nbrs:[15 17 18]
Stereo Groups:
	0 ABS rId: 0 wId: 0 atoms: { 16 }

```
m3k = '''
  Mrv2317 02032512242D          

  0  0  0     0  0            999 V3000
M  V30 BEGIN CTAB
M  V30 COUNTS 21 22 0 0 0
M  V30 BEGIN ATOM
M  V30 1 C -4.001 -2.31 0 0
M  V30 2 C -2.6674 -3.08 0 0
M  V30 3 C -1.3337 -2.31 0 0
M  V30 4 C 0 -3.08 0 0
M  V30 5 C 0 -4.6198 0 0
M  V30 6 N 1.3337 -5.3898 0 0
M  V30 7 C 2.6674 -4.6198 0 0
M  V30 8 O 2.6674 -3.08 0 0
M  V30 9 O 4.001 -5.3898 0 0
M  V30 10 C 5.3345 -4.6198 0 0
M  V30 11 C 6.6682 -5.3898 0 0
M  V30 12 C 8.0019 -4.6198 0 0
M  V30 13 C 9.3356 -5.3898 0 0
M  V30 14 C 9.3356 -6.9298 0 0
M  V30 15 C 8.0019 -7.6998 0 0
M  V30 16 C 6.6682 -6.9298 0 0
M  V30 17 S 5.3345 -7.6998 0 0 CFG=2
M  V30 18 C 4.001 -6.9298 0 0
M  V30 19 O 5.3345 -9.2398 0 0
M  V30 20 C -1.3337 -5.3898 0 0
M  V30 21 C -2.6674 -4.6198 0 0
M  V30 END ATOM
M  V30 BEGIN BOND
M  V30 1 1 1 2
M  V30 2 4 2 3
M  V30 3 4 3 4
M  V30 4 4 4 5
M  V30 5 1 5 6
M  V30 6 1 6 7
M  V30 7 2 7 8
M  V30 8 1 7 9
M  V30 9 1 9 10
M  V30 10 1 10 11
M  V30 11 4 11 12
M  V30 12 4 12 13
M  V30 13 4 13 14
M  V30 14 4 14 15
M  V30 15 4 15 16
M  V30 16 4 11 16
M  V30 17 1 17 16
M  V30 18 2 17 19
M  V30 19 4 5 20
M  V30 20 4 20 21
M  V30 21 4 2 21
M  V30 22 1 17 18 CFG=1
M  V30 END BOND
M  V30 BEGIN COLLECTION
M  V30 MDLV30/STEABS ATOMS=(1 17)
M  V30 END COLLECTION
M  V30 END CTAB
M  END
'''
m3 = Chem.MolFromMolBlock(m3k)
m3.Debug()
```
Result:
	16 16 S chg: 0  deg: 3 exp: 4 imp: 0 hyb: SP3 chi: CW nbrs:[15 18 17]

But no stereogroup included.

This seems specific to sulfoxides.

The issue can be reproduced in:
RDKit:2024.03.5
RDKit:2024.09.2

**Configuration (please complete the following information):**

 - OS: windows 11 
 - Python version (if relevant): 3.11
 - Are you using conda? Yes
 - If you are using conda, which channel did you install the rdkit from? Conda-forge
 - If you are not using conda: how did you install the RDKit?



Hints:

Fix patch:
diff --git a/Code/GraphMol/Atropisomers.cpp b/Code/GraphMol/Atropisomers.cpp
index 0b23d7f1ed6..61ef68129a5 100644
--- a/Code/GraphMol/Atropisomers.cpp
+++ b/Code/GraphMol/Atropisomers.cpp
@@ -283,7 +283,7 @@ std::pair<bool, Bond::BondDir> getBondDir(
   return {true, Bond::BondDir::NONE};
 }
 
-bool DetectAtropisomerChiralityOneBond(Bond *bond, ROMol &mol,
+void DetectAtropisomerChiralityOneBond(Bond *bond, ROMol &mol,
                                        const Conformer *conf) {
   // the approach is this:
   // we will view the system along the line from the potential atropisomer
@@ -307,7 +307,7 @@ bool DetectAtropisomerChiralityOneBond(Bond *bond, ROMol &mol,
   // one vector for each end - each one - should end up with 1 or 2 entries
   AtropAtomAndBondVec atomAndBondVecs[2];
   if (!getAtropisomerAtomsAndBonds(bond, atomAndBondVecs, mol)) {
-    return false;  // not an atropisomer
+    return;  // not an atropisomer
   }
 
   // make sure we do not have wiggle bonds
@@ -315,7 +315,7 @@ bool DetectAtropisomerChiralityOneBond(Bond *bond, ROMol &mol,
   for (auto atomAndBondVec : atomAndBondVecs) {
     for (auto endBond : atomAndBondVec.second) {
       if (endBond->getBondDir() == Bond::UNKNOWN) {
-        return false;  // not an atropisomer
+        return;  // not an atropisomer
       }
     }
   }
@@ -341,19 +341,19 @@ bool DetectAtropisomerChiralityOneBond(Bond *bond, ROMol &mol,
     std::pair<bool, Bond::BondDir> bond1DirResult;
     bond1DirResult = getBondDir(bond, atomAndBondVecs[0]);
     if (!bond1DirResult.first) {
-      return false;
+      return;
     }
     std::pair<bool, Bond::BondDir> bond2DirResult;
     bond2DirResult = getBondDir(bond, atomAndBondVecs[1]);
     if (!bond2DirResult.first) {
-      return false;
+      return;
     }
     if (bond1DirResult.second == bond2DirResult.second) {
       BOOST_LOG(rdWarningLog)
           << "inconsistent bond wedging for an atropisomer.  Atoms are: "
           << bond->getBeginAtomIdx() << " " << bond->getEndAtomIdx()
           << std::endl;
-      return false;
+      return;
     }
 
     if (bond1DirResult.second == Bond::BEGINWEDGE ||
@@ -364,7 +364,7 @@ bool DetectAtropisomerChiralityOneBond(Bond *bond, ROMol &mol,
       bond->setStereo(Bond::BondStereo::STEREOATROPCW);
     }
 
-    return true;
+    return;
   }
 
   // create a frame of reference that has its X-axis along the atrop bond
@@ -375,7 +375,7 @@ bool DetectAtropisomerChiralityOneBond(Bond *bond, ROMol &mol,
     BOOST_LOG(rdWarningLog)
         << "Failed to get a frame of reference along an atropisomer bond - atoms are: "
         << bond->getBeginAtomIdx() << " " << bond->getEndAtomIdx() << std::endl;
-    return false;
+    return;
   }
   RDGeom::Point3D bondVecs[2];  // one bond vector from each end of the
                                 // potential atropisomer bond
@@ -395,12 +395,12 @@ bool DetectAtropisomerChiralityOneBond(Bond *bond, ROMol &mol,
 
       bondDirResult = getBondDir(bond, atomAndBondVecs[bondAtomIndex]);
       if (!bondDirResult.first) {
-        return false;
+        return;
       }
 
       if (!getAtropIsomerEndVect(atomAndBondVecs[bondAtomIndex], yAxis, zAxis,
                                  conf, bondVecs[bondAtomIndex])) {
-        return false;
+        return;
       }
 
       if (bondDirResult.second == Bond::BEGINWEDGE) {
@@ -453,7 +453,7 @@ bool DetectAtropisomerChiralityOneBond(Bond *bond, ROMol &mol,
               << "Both bonds on one end of an atropisomer are on the same side - atoms are: "
               << bond->getBeginAtomIdx() << " " << bond->getEndAtomIdx()
               << std::endl;
-          return false;
+          return;
         }
       }
 
@@ -462,7 +462,7 @@ bool DetectAtropisomerChiralityOneBond(Bond *bond, ROMol &mol,
             << "Failed to find a bond on one end of an atropisomer that is NOT co-linear - atoms are: "
             << bond->getBeginAtomIdx() << " " << bond->getEndAtomIdx()
             << std::endl;
-        return false;
+        return;
       }
     }
   }
@@ -477,10 +477,8 @@ bool DetectAtropisomerChiralityOneBond(Bond *bond, ROMol &mol,
     BOOST_LOG(rdWarningLog)
         << "The 2 defining bonds for an atropisomer are co-planar - atoms are: "
         << bond->getBeginAtomIdx() << " " << bond->getEndAtomIdx() << std::endl;
-    return false;
+    return;
   }
-
-  return true;
 }
 
 void cleanupAtropisomerStereoGroups(ROMol &mol) {
@@ -537,7 +535,6 @@ void detectAtropisomerChirality(ROMol &mol, const Conformer *conf) {
     }
   }
 
-  bool foundAtrop = false;
   for (auto bondToTry : bondsToTry) {
     if (bondToTry->getBeginAtom()->needsUpdatePropertyCache()) {
       bondToTry->getBeginAtom()->updatePropertyCache(false);
@@ -554,13 +551,7 @@ void detectAtropisomerChirality(ROMol &mol, const Conformer *conf) {
       continue;
     }
 
-    if (DetectAtropisomerChiralityOneBond(bondToTry, mol, conf)) {
-      foundAtrop = true;
-    }
-  }
-
-  if (foundAtrop) {
-    cleanupAtropisomerStereoGroups(mol);
+    DetectAtropisomerChiralityOneBond(bondToTry, mol, conf);
   }
 }
 void getAllAtomIdsForStereoGroup(
diff --git a/Code/GraphMol/Atropisomers.h b/Code/GraphMol/Atropisomers.h
index 86c8d5442dd..2d61c4ad9f8 100644
--- a/Code/GraphMol/Atropisomers.h
+++ b/Code/GraphMol/Atropisomers.h
@@ -1,5 +1,5 @@
 //
-//  Copyright (C) 2004-203 Tad hurst/CDD and other RDKit contributors
+//  Copyright (C) 2004-2025 Tad Hurst/CDD and other RDKit contributors
 //
 //   @@ All Rights Reserved @@
 //  This file is part of the RDKit.
@@ -37,6 +37,8 @@ RDKIT_GRAPHMOL_EXPORT void getAllAtomIdsForStereoGroup(
     std::vector<unsigned int> &atomIds,
     const std::map<int, std::unique_ptr<RDKit::Chirality::WedgeInfoBase>>
         &wedgeBonds);
+
+RDKIT_GRAPHMOL_EXPORT void cleanupAtropisomerStereoGroups(ROMol &mol);
 }  // namespace Atropisomers
 }  // namespace RDKit
 #endif
diff --git a/Code/GraphMol/Chirality.cpp b/Code/GraphMol/Chirality.cpp
index c32f551caaa..091ab815383 100644
--- a/Code/GraphMol/Chirality.cpp
+++ b/Code/GraphMol/Chirality.cpp
@@ -2402,6 +2402,7 @@ void legacyStereoPerception(ROMol &mol, bool cleanIt,
         }
       }
     }
+    bool foundAtropisomer = false;
     for (auto bond : mol.bonds()) {
       // wedged bonds to atoms that have no stereochem
       // should be removed. (github issue 87)
@@ -2411,15 +2412,16 @@ void legacyStereoPerception(ROMol &mol, bool cleanIt,
           bond->getEndAtom()->getChiralTag() == Atom::CHI_UNSPECIFIED) {
         // see if there is an atropisomer bond connected to this bond
 
-        bool hasAtropisomer = false;
+        bool atomHasAtropisomer = false;
         for (auto nbond : mol.atomBonds(bond->getBeginAtom())) {
           if (nbond->getStereo() == Bond::STEREOATROPCCW ||
               nbond->getStereo() == Bond::STEREOATROPCW) {
-            hasAtropisomer = true;
+            atomHasAtropisomer = true;
+            foundAtropisomer = true;
             break;
           }
         }
-        if (!hasAtropisomer) {
+        if (!atomHasAtropisomer) {
           bond->setBondDir(Bond::NONE);
         }
       }
@@ -2459,6 +2461,9 @@ void legacyStereoPerception(ROMol &mol, bool cleanIt,
         }
       }
     }
+    if (foundAtropisomer || Atropisomers::doesMolHaveAtropisomers(mol)) {
+      Atropisomers::cleanupAtropisomerStereoGroups(mol);
+    }
     Chirality::cleanupStereoGroups(mol);
   }
 }
@@ -2544,6 +2549,7 @@ void stereoPerception(ROMol &mol, bool cleanIt,
   // populate double bond stereo info:
   updateDoubleBondStereo(mol, sinfo, cleanIt);
   if (cleanIt) {
+    Atropisomers::cleanupAtropisomerStereoGroups(mol);
     Chirality::cleanupStereoGroups(mol);
   }
 }
@@ -2914,9 +2920,9 @@ void findPotentialStereoBonds(ROMol &mol, bool cleanIt) {
             if (begAtomNeighbors.size() > 0 && endAtomNeighbors.size() > 0) {
               if ((begAtomNeighbors.size() == 2) &&
                   (endAtomNeighbors.size() == 2)) {
-// if both of the atoms have 2 neighbors (other than the one
-// connected
-// by the double bond) and ....
+                // if both of the atoms have 2 neighbors (other than the one
+                // connected
+                // by the double bond) and ....
                 if ((ranks[begAtomNeighbors[0]] !=
                      ranks[begAtomNeighbors[1]]) &&
                     (ranks[endAtomNeighbors[0]] !=
diff --git a/Code/GraphMol/FileParsers/CMakeLists.txt b/Code/GraphMol/FileParsers/CMakeLists.txt
index 3258e3bc304..6a809d8e118 100644
--- a/Code/GraphMol/FileParsers/CMakeLists.txt
+++ b/Code/GraphMol/FileParsers/CMakeLists.txt
@@ -96,6 +96,11 @@ rdkit_catch_test(v2MolSuppliers v2_suppliers_catch.cpp
 rdkit_catch_test(v2FileParsersCatchTest v2_file_parsers_catch.cpp
     LINK_LIBRARIES FileParsers)
 
+rdkit_catch_test(atropisomersCatch atropisomers_catch.cpp
+    LINK_LIBRARIES FileParsers)
+
+
+
 if(RDK_TEST_MULTITHREADED AND RDK_BUILD_THREADSAFE_SSS)
 rdkit_catch_test(multithreadedSupplierCatchTest multithreaded_supplier_catch.cpp
     LINK_LIBRARIES FileParsers)
diff --git a/Code/GraphMol/FileParsers/MolFileParser.cpp b/Code/GraphMol/FileParsers/MolFileParser.cpp
index 39355176278..fb741d70b89 100644
--- a/Code/GraphMol/FileParsers/MolFileParser.cpp
+++ b/Code/GraphMol/FileParsers/MolFileParser.cpp
@@ -3351,7 +3351,9 @@ void finishMolProcessing(
   const Conformer &conf = res->getConformer();
   if (chiralityPossible || conf.is3D()) {
     if (!conf.is3D()) {
-      DetectAtomStereoChemistry(*res, &conf);
+      bool replaceExistingTags = true;
+      MolOps::assignChiralTypesFromBondDirs(*res, conf.getId(),
+                                            replaceExistingTags);
     } else {
       res->updatePropertyCache(false);
       MolOps::assignChiralTypesFrom3D(*res, conf.getId(), true);
diff --git a/Code/GraphMol/FileParsers/atropisomers_catch.cpp b/Code/GraphMol/FileParsers/atropisomers_catch.cpp
new file mode 100644
index 00000000000..03dfe14cb18
--- /dev/null
+++ b/Code/GraphMol/FileParsers/atropisomers_catch.cpp
@@ -0,0 +1,129 @@
+//
+//  Copyright (C) 2025 Greg Landrum and other RDKit contributors
+//   @@ All Rights Reserved @@
+//  This file is part of the RDKit.
+//  The contents are covered by the terms of the BSD license
+//  which is included in the file license.txt, found at the root
+//  of the RDKit source tree.
+//
+
+#include <string>
+
+#include "RDGeneral/test.h"
+#include <catch2/catch_all.hpp>
+#include <GraphMol/RDKitBase.h>
+#include <GraphMol/Chirality.h>
+#include <GraphMol/FileParsers/FileParsers.h>
+#include <GraphMol/FileParsers/MolSupplier.h>
+#include <GraphMol/SmilesParse/SmilesWrite.h>
+#include <GraphMol/test_fixtures.h>
+
+using namespace RDKit;
+
+TEST_CASE("explicit tests") {
+  // making some of the other atropisomer tests explicitly test what we expect
+  std::string rdbase = getenv("RDBASE");
+  REQUIRE(rdbase != "");
+  SECTION("basics") {
+    std::string file =
+        rdbase +
+        "/Code/GraphMol/FileParsers/test_data/atropisomers/AtropManyChirals.sdf";
+    auto mol = v2::FileParsers::MolFromMolFile(file);
+    REQUIRE(mol);
+    CHECK(mol->getBondWithIdx(7)->getStereo() ==
+          Bond::BondStereo::STEREOATROPCCW);
+  }
+  SECTION("macrocycle") {
+    std::string file =
+        rdbase +
+        "/Code/GraphMol/FileParsers/test_data/atropisomers/macrocycle-5-meta-Cl-ortho-hash.sdf";
+    auto mol = v2::FileParsers::MolFromMolFile(file);
+    REQUIRE(mol);
+    CHECK(mol->getBondWithIdx(15)->getStereo() ==
+          Bond::BondStereo::STEREOATROPCW);
+  }
+  SECTION("with stereo groups and other chiral centers") {
+    REQUIRE(rdbase != "");
+    std::string file =
+        rdbase +
+        "/Code/GraphMol/FileParsers/test_data/atropisomers/AtropManyChiralsEnhanced.sdf";
+    auto mol = v2::FileParsers::MolFromMolFile(file);
+    REQUIRE(mol);
+    CHECK(mol->getBondWithIdx(7)->getStereo() ==
+          Bond::BondStereo::STEREOATROPCCW);
+    CHECK(mol->getAtomWithIdx(6)->getChiralTag() ==
+          Atom::ChiralType::CHI_UNSPECIFIED);
+    CHECK(mol->getAtomWithIdx(9)->getChiralTag() !=
+          Atom::ChiralType::CHI_UNSPECIFIED);
+    CHECK(mol->getAtomWithIdx(13)->getChiralTag() !=
+          Atom::ChiralType::CHI_UNSPECIFIED);
+    CHECK(mol->getAtomWithIdx(16)->getChiralTag() !=
+          Atom::ChiralType::CHI_UNSPECIFIED);
+    CHECK(mol->getAtomWithIdx(10)->getChiralTag() !=
+          Atom::ChiralType::CHI_UNSPECIFIED);
+
+    REQUIRE(mol->getStereoGroups().size() == 2);
+    {
+      const auto &sg = mol->getStereoGroups()[0];
+      CHECK(sg.getAtoms().size() == 2);
+      CHECK(sg.getBonds().size() == 1);
+    }
+    {
+      const auto &sg = mol->getStereoGroups()[1];
+      CHECK(sg.getAtoms().size() == 2);
+      CHECK(sg.getBonds().size() == 0);
+    }
+  }
+}
+
+TEST_CASE("atropisomerism and dependent chirality") {
+  SECTION("chirality allows stereoisomers") {
+    {
+      auto m = "C=C(C)C1=CC([C@H](C)O)=CC([C@@H](C)O)=C1 |wD:3.14|"_smiles;
+      REQUIRE(m);
+      CHECK(m->getBondWithIdx(2)->getStereo() ==
+            Bond::BondStereo::STEREOATROPCW);
+    }
+#if 0
+    // FIX: this test does not work, this is Github #8340
+    {
+      // the two stereocenters are identical, we should not have atropisomerism
+      auto m = "C=C(C)C1=CC([C@H](C)O)=CC([C@H](C)O)=C1 |wD:3.14|"_smiles;
+      REQUIRE(m);
+      CHECK(m->getBondWithIdx(2)->getStereo() == Bond::BondStereo::STEREONONE);
+    }
+#endif
+  }
+
+  SECTION("atropisomers allow chirality") {
+#if 0
+    // FIX: this test does not work
+    {
+      // here the atropisomeric bonds have opposite stereochemistry, so the
+      // central atom should be chiral, this is Github #8341
+      auto m =
+          "C=C(C1C=C(C)C=CC=1)[C@H](C)C(=C)C1C=C(C)C=CC=1 |wD:2.2,wD:13.14|"_smiles;
+      REQUIRE(m);
+      CHECK(m->getBondWithIdx(1)->getStereo() ==
+            Bond::BondStereo::STEREOATROPCCW);
+      CHECK(m->getBondWithIdx(12)->getStereo() ==
+            Bond::BondStereo::STEREOATROPCCW);
+      CHECK(m->getAtomWithIdx(9)->getChiralTag() !=
+            Atom::ChiralType::CHI_UNSPECIFIED);
+    }
+#endif
+    {
+      // here the atropisomeric bonds have the same stereochemistry, so the
+      // central atom should not be chiral
+      auto m =
+          "C=C(C1C=C(C)C=CC=1)[C@H](C)C(=C)C1C=C(C)C=CC=1 |wD:2.2,wU:13.14|"_smiles;
+      REQUIRE(m);
+      CHECK(m->getBondWithIdx(1)->getStereo() ==
+            Bond::BondStereo::STEREOATROPCCW);
+      CHECK(m->getBondWithIdx(12)->getStereo() ==
+            Bond::BondStereo::STEREOATROPCW);
+      CHECK(m->getAtomWithIdx(9)->getChiralTag() ==
+            Atom::ChiralType::CHI_UNSPECIFIED);
+    }
+  }
+}
diff --git a/Code/GraphMol/MolOps.h b/Code/GraphMol/MolOps.h
index c6252488494..60984810f8c 100644
--- a/Code/GraphMol/MolOps.h
+++ b/Code/GraphMol/MolOps.h
@@ -1085,8 +1085,7 @@ RDKIT_GRAPHMOL_EXPORT void assignChiralTypesFrom3D(
 RDKIT_GRAPHMOL_EXPORT void assignStereochemistryFrom3D(
     ROMol &mol, int confId = -1, bool replaceExistingTags = true);
 
-//! \brief Use bond directions to assign ChiralTypes to a molecule's atoms and
-//! stereo flags to its bonds
+//! \brief Use bond directions to assign ChiralTypes to a molecule's atoms
 /*!
 
   \param mol                  the molecule of interest
diff --git a/Code/GraphMol/catch_chirality.cpp b/Code/GraphMol/catch_chirality.cpp
index 3abd59ecb0d..0dc5eb3f597 100644
--- a/Code/GraphMol/catch_chirality.cpp
+++ b/Code/GraphMol/catch_chirality.cpp
@@ -5999,4 +5999,132 @@ TEST_CASE(
     CHECK(m->getAtomWithIdx(0)->hasProp(common_properties::_CIPCode) == false);
     CHECK(m->getBondWithIdx(0)->hasProp(common_properties::_CIPCode) == false);
   }
+}
+
+TEST_CASE("Github issue #7983: stereogroup lost on chiral sulfoxide") {
+  SECTION("basics") {
+    auto m = R"CTAB(
+  Mrv2317 02032512242D          
+
+  0  0  0     0  0            999 V3000
+M  V30 BEGIN CTAB
+M  V30 COUNTS 21 22 0 0 0
+M  V30 BEGIN ATOM
+M  V30 1 C -4.001 -2.31 0 0
+M  V30 2 C -2.6674 -3.08 0 0
+M  V30 3 C -1.3337 -2.31 0 0
+M  V30 4 C 0 -3.08 0 0
+M  V30 5 C 0 -4.6198 0 0
+M  V30 6 N 1.3337 -5.3898 0 0
+M  V30 7 C 2.6674 -4.6198 0 0
+M  V30 8 O 2.6674 -3.08 0 0
+M  V30 9 O 4.001 -5.3898 0 0
+M  V30 10 C 5.3345 -4.6198 0 0
+M  V30 11 C 6.6682 -5.3898 0 0
+M  V30 12 C 8.0019 -4.6198 0 0
+M  V30 13 C 9.3356 -5.3898 0 0
+M  V30 14 C 9.3356 -6.9298 0 0
+M  V30 15 C 8.0019 -7.6998 0 0
+M  V30 16 C 6.6682 -6.9298 0 0
+M  V30 17 S 5.3345 -7.6998 0 0 CFG=2
+M  V30 18 C 4.001 -6.9298 0 0
+M  V30 19 O 5.3345 -9.2398 0 0
+M  V30 20 C -1.3337 -5.3898 0 0
+M  V30 21 C -2.6674 -4.6198 0 0
+M  V30 END ATOM
+M  V30 BEGIN BOND
+M  V30 1 1 1 2
+M  V30 2 4 2 3
+M  V30 3 4 3 4
+M  V30 4 4 4 5
+M  V30 5 1 5 6
+M  V30 6 1 6 7
+M  V30 7 2 7 8
+M  V30 8 1 7 9
+M  V30 9 1 9 10
+M  V30 10 1 10 11
+M  V30 11 4 11 12
+M  V30 12 4 12 13
+M  V30 13 4 13 14
+M  V30 14 4 14 15
+M  V30 15 4 15 16
+M  V30 16 4 11 16
+M  V30 17 1 17 16
+M  V30 18 2 17 19
+M  V30 19 4 5 20
+M  V30 20 4 20 21
+M  V30 21 4 2 21
+M  V30 22 1 17 18 CFG=1
+M  V30 END BOND
+M  V30 BEGIN COLLECTION
+M  V30 MDLV30/STEABS ATOMS=(1 17)
+M  V30 END COLLECTION
+M  V30 END CTAB
+M  END)CTAB"_ctab;
+    REQUIRE(m);
+    auto &sgs = m->getStereoGroups();
+    REQUIRE(sgs.size() == 1);
+    CHECK(sgs[0].getGroupType() == StereoGroupType::STEREO_ABSOLUTE);
+    CHECK(sgs[0].getAtoms().size() == 1);
+    CHECK(sgs[0].getAtoms().at(0)->getIdx() == 16);
+  }
+  SECTION("making sure sulfoxides do not trigger atropisomerism") {
+    auto m = R"CTAB(
+     RDKit          2D
+
+  0  0  0  0  0  0  0  0  0  0999 V3000
+M  V30 BEGIN CTAB
+M  V30 COUNTS 10 10 0 0 0
+M  V30 BEGIN ATOM
+M  V30 1 C 1.892852 4.651432 0.000000 0
+M  V30 2 C 3.199931 3.915535 0.000000 0
+M  V30 3 C 3.216171 2.415622 0.000000 0
+M  V30 4 C 1.925330 1.651602 0.000000 0
+M  V30 5 C 0.618251 2.387492 0.000000 0
+M  V30 6 C 0.602011 3.887408 0.000000 0
+M  V30 7 S -0.705072 4.623298 0.000000 0
+M  V30 8 C -0.672591 1.623472 0.000000 0
+M  V30 9 O -0.721314 6.123210 0.000000 0
+M  V30 10 C -1.995913 3.859276 0.000000 0
+M  V30 END ATOM
+M  V30 BEGIN BOND
+M  V30 1 2 1 2
+M  V30 2 1 2 3
+M  V30 3 2 3 4
+M  V30 4 1 4 5
+M  V30 5 2 5 6
+M  V30 6 1 6 1 CFG=1
+M  V30 7 1 6 7
+M  V30 8 1 5 8
+M  V30 9 2 7 9
+M  V30 10 1 7 10 CFG=1
+M  V30 END BOND
+M  V30 BEGIN COLLECTION
+M  V30 MDLV30/STEABS ATOMS=(1 7)
+M  V30 END COLLECTION
+M  V30 END CTAB
+M  END
+$$$$
+)CTAB"_ctab;
+    REQUIRE(m);
+    CHECK(m->getAtomWithIdx(6)->getChiralTag() !=
+          Atom::ChiralType::CHI_UNSPECIFIED);
+    CHECK(m->getBondBetweenAtoms(5, 6)->getStereo() ==
+          Bond::BondStereo::STEREONONE);
+  }
+  SECTION("examples from #8323") {
+    std::string pathName = getenv("RDBASE");
+    pathName += "/Code/GraphMol/test_data/Github8323.sdf";
+    SDMolSupplier suppl(pathName);
+    while (!suppl.atEnd()) {
+      auto mol = suppl.next();
+      REQUIRE(mol);
+      auto &sgs = mol->getStereoGroups();
+      REQUIRE(sgs.size() == 1);
+      REQUIRE(mol->hasProp("StereoGroupOnAtom"));
+      auto aid = std::stoul(mol->getProp<std::string>("StereoGroupOnAtom"));
+      CHECK(sgs[0].getAtoms().size() == 1);
+      CHECK(sgs[0].getAtoms().at(0)->getIdx() == aid);
+    }
+  }
 }
\ No newline at end of file


Test patch:
diff --git a/Code/GraphMol/FileParsers/test_data/atropisomers/AtropManyChiralsEnhanced.sdf.expected.sdf b/Code/GraphMol/FileParsers/test_data/atropisomers/AtropManyChiralsEnhanced.sdf.expected.sdf
index 2bd3de0b0bd..6f329a3ca47 100644
--- a/Code/GraphMol/FileParsers/test_data/atropisomers/AtropManyChiralsEnhanced.sdf.expected.sdf
+++ b/Code/GraphMol/FileParsers/test_data/atropisomers/AtropManyChiralsEnhanced.sdf.expected.sdf
@@ -49,7 +49,7 @@ M  V30 19 1 17 19
 M  V30 20 2 6 20
 M  V30 END BOND
 M  V30 BEGIN COLLECTION
-M  V30 MDLV30/STEREL1 ATOMS=(3 10 14 7)
+M  V30 MDLV30/STEREL1 ATOMS=(3 7 10 14)
 M  V30 MDLV30/STERAC1 ATOMS=(2 11 17)
 M  V30 END COLLECTION
 M  V30 END CTAB
diff --git a/Code/GraphMol/FileParsers/test_data/atropisomers/AtropManyChiralsEnhanced2.sdf.expected.sdf b/Code/GraphMol/FileParsers/test_data/atropisomers/AtropManyChiralsEnhanced2.sdf.expected.sdf
index a3c275f5b70..146d0a2411e 100644
--- a/Code/GraphMol/FileParsers/test_data/atropisomers/AtropManyChiralsEnhanced2.sdf.expected.sdf
+++ b/Code/GraphMol/FileParsers/test_data/atropisomers/AtropManyChiralsEnhanced2.sdf.expected.sdf
@@ -49,7 +49,7 @@ M  V30 19 1 17 19
 M  V30 20 2 6 20
 M  V30 END BOND
 M  V30 BEGIN COLLECTION
-M  V30 MDLV30/STEABS ATOMS=(3 10 14 7)
+M  V30 MDLV30/STEABS ATOMS=(3 7 10 14)
 M  V30 MDLV30/STERAC1 ATOMS=(2 11 17)
 M  V30 END COLLECTION
 M  V30 END CTAB
diff --git a/Code/GraphMol/MarvinParse/test_data/AtropEnhancedStereo.mrv.nosan.expected.mrv b/Code/GraphMol/MarvinParse/test_data/AtropEnhancedStereo.mrv.nosan.expected.mrv
index c3518dc67a8..8d8ce27eab6 100644
--- a/Code/GraphMol/MarvinParse/test_data/AtropEnhancedStereo.mrv.nosan.expected.mrv
+++ b/Code/GraphMol/MarvinParse/test_data/AtropEnhancedStereo.mrv.nosan.expected.mrv
@@ -1,2 +1,2 @@
 <?xml version="1.0" encoding="utf-8"?>
-<cml xmlns="http://www.chemaxon.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.chemaxon.com http://www.chemaxon.com/marvin/schema/mrvSchema_20_20_0.xsd"><MDocument><MChemicalStruct><molecule molID="m1"><atomArray><atom id="a1" elementType="C" x2="-1.39593" y2="-1.93907"/><atom id="a2" elementType="C" x2="-2.72947" y2="-2.70907"/><atom id="a3" elementType="C" x2="-2.72947" y2="-4.24926"/><atom id="a4" elementType="C" x2="-1.39593" y2="-5.01926"/><atom id="a5" elementType="C" x2="-0.0621933" y2="-4.24926"/><atom id="a6" elementType="C" x2="-0.0621933" y2="-2.70907"/><atom id="a7" elementType="C" x2="-1.39597" y2="-0.399073" mrvStereoGroup="or1"/><atom id="a8" elementType="N" x2="1.27148" y2="-1.93906"/><atom id="a9" elementType="C" x2="-4.06317" y2="-1.9391"/><atom id="a10" elementType="C" x2="-0.0624033" y2="0.370886"/><atom id="a11" elementType="C" x2="-0.0623567" y2="1.91107"/><atom id="a12" elementType="C" x2="-1.39588" y2="2.68111"/><atom id="a13" elementType="C" x2="-2.72964" y2="1.91115"/><atom id="a14" elementType="C" x2="-2.72968" y2="0.370967"/><atom id="a15" elementType="O" x2="1.27127" y2="-0.399126"/><atom id="a16" elementType="C" x2="-4.06338" y2="-0.399004"/></atomArray><bondArray><bond id="b1" atomRefs2="a1 a2" order="2"/><bond id="b2" atomRefs2="a2 a3" order="1"/><bond id="b3" atomRefs2="a3 a4" order="2"/><bond id="b4" atomRefs2="a4 a5" order="1"/><bond id="b5" atomRefs2="a5 a6" order="2"/><bond id="b6" atomRefs2="a6 a1" order="1"/><bond id="b7" atomRefs2="a1 a7" order="1"/><bond id="b8" atomRefs2="a2 a9" order="1"/><bond id="b9" atomRefs2="a10 a11" order="1"/><bond id="b10" atomRefs2="a11 a12" order="2"/><bond id="b11" atomRefs2="a12 a13" order="1"/><bond id="b12" atomRefs2="a13 a14" order="2"/><bond id="b13" atomRefs2="a7 a10" order="2"/><bond id="b14" atomRefs2="a7 a14" order="1"><bondStereo>W</bondStereo></bond><bond id="b15" atomRefs2="a14 a16" order="1"/><bond id="b16" atomRefs2="a10 a15" order="1"/><bond id="b17" atomRefs2="a6 a8" order="1"/></bondArray></molecule></MChemicalStruct></MDocument></cml>
\ No newline at end of file
+<cml xmlns="http://www.chemaxon.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.chemaxon.com http://www.chemaxon.com/marvin/schema/mrvSchema_20_20_0.xsd"><MDocument><MChemicalStruct><molecule molID="m1"><atomArray><atom id="a1" elementType="C" x2="-1.39593" y2="-1.93907" mrvStereoGroup="or1"/><atom id="a2" elementType="C" x2="-2.72947" y2="-2.70907"/><atom id="a3" elementType="C" x2="-2.72947" y2="-4.24926"/><atom id="a4" elementType="C" x2="-1.39593" y2="-5.01926"/><atom id="a5" elementType="C" x2="-0.0621933" y2="-4.24926"/><atom id="a6" elementType="C" x2="-0.0621933" y2="-2.70907"/><atom id="a7" elementType="C" x2="-1.39597" y2="-0.399073"/><atom id="a8" elementType="N" x2="1.27148" y2="-1.93906"/><atom id="a9" elementType="C" x2="-4.06317" y2="-1.9391"/><atom id="a10" elementType="C" x2="-0.0624033" y2="0.370886"/><atom id="a11" elementType="C" x2="-0.0623567" y2="1.91107"/><atom id="a12" elementType="C" x2="-1.39588" y2="2.68111"/><atom id="a13" elementType="C" x2="-2.72964" y2="1.91115"/><atom id="a14" elementType="C" x2="-2.72968" y2="0.370967"/><atom id="a15" elementType="O" x2="1.27127" y2="-0.399126"/><atom id="a16" elementType="C" x2="-4.06338" y2="-0.399004"/></atomArray><bondArray><bond id="b1" atomRefs2="a1 a2" order="2"/><bond id="b2" atomRefs2="a2 a3" order="1"/><bond id="b3" atomRefs2="a3 a4" order="2"/><bond id="b4" atomRefs2="a4 a5" order="1"/><bond id="b5" atomRefs2="a5 a6" order="2"/><bond id="b6" atomRefs2="a6 a1" order="1"/><bond id="b7" atomRefs2="a1 a7" order="1"/><bond id="b8" atomRefs2="a2 a9" order="1"/><bond id="b9" atomRefs2="a10 a11" order="1"/><bond id="b10" atomRefs2="a11 a12" order="2"/><bond id="b11" atomRefs2="a12 a13" order="1"/><bond id="b12" atomRefs2="a13 a14" order="2"/><bond id="b13" atomRefs2="a7 a10" order="2"/><bond id="b14" atomRefs2="a7 a14" order="1"><bondStereo>W</bondStereo></bond><bond id="b15" atomRefs2="a14 a16" order="1"/><bond id="b16" atomRefs2="a10 a15" order="1"/><bond id="b17" atomRefs2="a6 a8" order="1"/></bondArray></molecule></MChemicalStruct></MDocument></cml>
\ No newline at end of file
diff --git a/Code/GraphMol/MarvinParse/test_data/AtropEnhancedStereo.mrv.nosan.expected.sdf b/Code/GraphMol/MarvinParse/test_data/AtropEnhancedStereo.mrv.nosan.expected.sdf
index dac8923f3c9..b68f5788152 100644
--- a/Code/GraphMol/MarvinParse/test_data/AtropEnhancedStereo.mrv.nosan.expected.sdf
+++ b/Code/GraphMol/MarvinParse/test_data/AtropEnhancedStereo.mrv.nosan.expected.sdf
@@ -42,7 +42,7 @@ M  V30 16 1 10 15
 M  V30 17 1 6 8
 M  V30 END BOND
 M  V30 BEGIN COLLECTION
-M  V30 MDLV30/STEREL1 ATOMS=(1 7)
+M  V30 MDLV30/STEREL1 ATOMS=(1 1)
 M  V30 END COLLECTION
 M  V30 END CTAB
 M  END
diff --git a/Code/GraphMol/MarvinParse/test_data/AtropManyChiralsEnhanced.mrv.nosan.expected.sdf b/Code/GraphMol/MarvinParse/test_data/AtropManyChiralsEnhanced.mrv.nosan.expected.sdf
index 426a4a19dd8..16b9d65271a 100644
--- a/Code/GraphMol/MarvinParse/test_data/AtropManyChiralsEnhanced.mrv.nosan.expected.sdf
+++ b/Code/GraphMol/MarvinParse/test_data/AtropManyChiralsEnhanced.mrv.nosan.expected.sdf
@@ -49,7 +49,7 @@ M  V30 19 1 18 19 CFG=1
 M  V30 20 1 18 20
 M  V30 END BOND
 M  V30 BEGIN COLLECTION
-M  V30 MDLV30/STEREL1 ATOMS=(3 11 15 8)
+M  V30 MDLV30/STEREL1 ATOMS=(3 8 11 15)
 M  V30 MDLV30/STERAC1 ATOMS=(2 12 18)
 M  V30 END COLLECTION
 M  V30 END CTAB
diff --git a/Code/GraphMol/MarvinParse/test_data/AtropManyChiralsEnhanced2.mrv.nosan.expected.sdf b/Code/GraphMol/MarvinParse/test_data/AtropManyChiralsEnhanced2.mrv.nosan.expected.sdf
index 30d76c1bd8c..8fd896c62da 100644
--- a/Code/GraphMol/MarvinParse/test_data/AtropManyChiralsEnhanced2.mrv.nosan.expected.sdf
+++ b/Code/GraphMol/MarvinParse/test_data/AtropManyChiralsEnhanced2.mrv.nosan.expected.sdf
@@ -49,7 +49,7 @@ M  V30 19 1 18 19 CFG=1
 M  V30 20 1 18 20
 M  V30 END BOND
 M  V30 BEGIN COLLECTION
-M  V30 MDLV30/STEABS ATOMS=(3 11 15 8)
+M  V30 MDLV30/STEABS ATOMS=(3 8 11 15)
 M  V30 MDLV30/STERAC1 ATOMS=(2 12 18)
 M  V30 END COLLECTION
 M  V30 END CTAB
diff --git a/Code/GraphMol/MarvinParse/test_data/AtropManyChiralsEnhanced3.mrv.nosan.expected.sdf b/Code/GraphMol/MarvinParse/test_data/AtropManyChiralsEnhanced3.mrv.nosan.expected.sdf
index c87bac9d130..52e876af68d 100644
--- a/Code/GraphMol/MarvinParse/test_data/AtropManyChiralsEnhanced3.mrv.nosan.expected.sdf
+++ b/Code/GraphMol/MarvinParse/test_data/AtropManyChiralsEnhanced3.mrv.nosan.expected.sdf
@@ -49,7 +49,7 @@ M  V30 19 1 18 19 CFG=1
 M  V30 20 1 18 20
 M  V30 END BOND
 M  V30 BEGIN COLLECTION
-M  V30 MDLV30/STERAC1 ATOMS=(3 11 15 8)
+M  V30 MDLV30/STERAC1 ATOMS=(3 8 11 15)
 M  V30 MDLV30/STERAC2 ATOMS=(2 12 18)
 M  V30 END COLLECTION
 M  V30 END CTAB
diff --git a/Code/GraphMol/MarvinParse/test_data/AtropManyChiralsEnhanced4.mrv.nosan.expected.mrv b/Code/GraphMol/MarvinParse/test_data/AtropManyChiralsEnhanced4.mrv.nosan.expected.mrv
index f8f99c1afec..85c5ba7b198 100644
--- a/Code/GraphMol/MarvinParse/test_data/AtropManyChiralsEnhanced4.mrv.nosan.expected.mrv
+++ b/Code/GraphMol/MarvinParse/test_data/AtropManyChiralsEnhanced4.mrv.nosan.expected.mrv
@@ -1,2 +1,2 @@
 <?xml version="1.0" encoding="utf-8"?>
-<cml xmlns="http://www.chemaxon.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.chemaxon.com http://www.chemaxon.com/marvin/schema/mrvSchema_20_20_0.xsd"><MDocument><MChemicalStruct><molecule molID="m1"><atomArray><atom id="a1" elementType="O" x2="2.8625" y2="1.0561"/><atom id="a2" elementType="C" x2="2.2921" y2="-0.5174"/><atom id="a3" elementType="C" x2="3.4688" y2="-1.0018"/><atom id="a4" elementType="C" x2="3.6019" y2="-2.4682"/><atom id="a5" elementType="N" x2="2.3988" y2="-3.3169"/><atom id="a6" elementType="C" x2="1.0621" y2="-2.6992"/><atom id="a7" elementType="O" x2="0.1062" y2="-3.9298"/><atom id="a8" elementType="N" x2="0.9288" y2="-1.2328" mrvStereoGroup="or1"/><atom id="a9" elementType="C" x2="-0.5563" y2="-0.6124" mrvStereoGroup="or1"/><atom id="a10" elementType="C" x2="-1.5367" y2="-1.8"/><atom id="a11" elementType="C" x2="-0.8947" y2="0.9647" mrvStereoGroup="or1"/><atom id="a12" elementType="C" x2="-0.8778" y2="2.5678" mrvStereoGroup="and1"/><atom id="a13" elementType="C" x2="-0.1398" y2="3.9298"/><atom id="a14" elementType="Br" x2="-1.9563" y2="3.6407"/><atom id="a15" elementType="C" x2="0.5974" y2="1.3136" mrvStereoGroup="or1"/><atom id="a16" elementType="F" x2="1.1268" y2="-0.0778"/><atom id="a17" elementType="C" x2="1.9954" y2="1.9251"/><atom id="a18" elementType="C" x2="-2.4534" y2="0.7177" mrvStereoGroup="and1"/><atom id="a19" elementType="Cl" x2="-3.6019" y2="1.737"/><atom id="a20" elementType="C" x2="-3.4495" y2="-0.4655"/></atomArray><bondArray><bond id="b1" atomRefs2="a1 a2" order="2"/><bond id="b2" atomRefs2="a2 a3" order="1"/><bond id="b3" atomRefs2="a3 a4" order="2"/><bond id="b4" atomRefs2="a4 a5" order="1"/><bond id="b5" atomRefs2="a5 a6" order="1"/><bond id="b6" atomRefs2="a6 a7" order="2"/><bond id="b7" atomRefs2="a6 a8" order="1"/><bond id="b8" atomRefs2="a8 a2" order="1"><bondStereo>W</bondStereo></bond><bond id="b9" atomRefs2="a8 a9" order="1"/><bond id="b10" atomRefs2="a9 a10" order="2"/><bond id="b11" atomRefs2="a9 a11" order="1"><bondStereo>H</bondStereo></bond><bond id="b12" atomRefs2="a11 a12" order="1"/><bond id="b13" atomRefs2="a12 a13" order="1"/><bond id="b14" atomRefs2="a12 a14" order="1"><bondStereo>W</bondStereo></bond><bond id="b15" atomRefs2="a11 a15" order="1"><bondStereo>W</bondStereo></bond><bond id="b16" atomRefs2="a15 a16" order="1"><bondStereo>H</bondStereo></bond><bond id="b17" atomRefs2="a15 a17" order="1"/><bond id="b18" atomRefs2="a11 a18" order="1"/><bond id="b19" atomRefs2="a18 a19" order="1"><bondStereo>W</bondStereo></bond><bond id="b20" atomRefs2="a18 a20" order="1"/></bondArray></molecule></MChemicalStruct></MDocument></cml>
\ No newline at end of file
+<cml xmlns="http://www.chemaxon.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.chemaxon.com http://www.chemaxon.com/marvin/schema/mrvSchema_20_20_0.xsd"><MDocument><MChemicalStruct><molecule molID="m1"><atomArray><atom id="a1" elementType="O" x2="2.8625" y2="1.0561"/><atom id="a2" elementType="C" x2="2.2921" y2="-0.5174"/><atom id="a3" elementType="C" x2="3.4688" y2="-1.0018"/><atom id="a4" elementType="C" x2="3.6019" y2="-2.4682"/><atom id="a5" elementType="N" x2="2.3988" y2="-3.3169"/><atom id="a6" elementType="C" x2="1.0621" y2="-2.6992"/><atom id="a7" elementType="O" x2="0.1062" y2="-3.9298"/><atom id="a8" elementType="N" x2="0.9288" y2="-1.2328" mrvStereoGroup="or1"/><atom id="a9" elementType="C" x2="-0.5563" y2="-0.6124"/><atom id="a10" elementType="C" x2="-1.5367" y2="-1.8"/><atom id="a11" elementType="C" x2="-0.8947" y2="0.9647" mrvStereoGroup="or1"/><atom id="a12" elementType="C" x2="-0.8778" y2="2.5678" mrvStereoGroup="and1"/><atom id="a13" elementType="C" x2="-0.1398" y2="3.9298"/><atom id="a14" elementType="Br" x2="-1.9563" y2="3.6407"/><atom id="a15" elementType="C" x2="0.5974" y2="1.3136" mrvStereoGroup="or1"/><atom id="a16" elementType="F" x2="1.1268" y2="-0.0778"/><atom id="a17" elementType="C" x2="1.9954" y2="1.9251"/><atom id="a18" elementType="C" x2="-2.4534" y2="0.7177" mrvStereoGroup="and1"/><atom id="a19" elementType="Cl" x2="-3.6019" y2="1.737"/><atom id="a20" elementType="C" x2="-3.4495" y2="-0.4655"/></atomArray><bondArray><bond id="b1" atomRefs2="a1 a2" order="2"/><bond id="b2" atomRefs2="a2 a3" order="1"/><bond id="b3" atomRefs2="a3 a4" order="2"/><bond id="b4" atomRefs2="a4 a5" order="1"/><bond id="b5" atomRefs2="a5 a6" order="1"/><bond id="b6" atomRefs2="a6 a7" order="2"/><bond id="b7" atomRefs2="a6 a8" order="1"/><bond id="b8" atomRefs2="a8 a2" order="1"><bondStereo>W</bondStereo></bond><bond id="b9" atomRefs2="a8 a9" order="1"/><bond id="b10" atomRefs2="a9 a10" order="2"/><bond id="b11" atomRefs2="a9 a11" order="1"><bondStereo>H</bondStereo></bond><bond id="b12" atomRefs2="a11 a12" order="1"/><bond id="b13" atomRefs2="a12 a13" order="1"/><bond id="b14" atomRefs2="a12 a14" order="1"><bondStereo>W</bondStereo></bond><bond id="b15" atomRefs2="a11 a15" order="1"><bondStereo>W</bondStereo></bond><bond id="b16" atomRefs2="a15 a16" order="1"><bondStereo>H</bondStereo></bond><bond id="b17" atomRefs2="a15 a17" order="1"/><bond id="b18" atomRefs2="a11 a18" order="1"/><bond id="b19" atomRefs2="a18 a19" order="1"><bondStereo>W</bondStereo></bond><bond id="b20" atomRefs2="a18 a20" order="1"/></bondArray></molecule></MChemicalStruct></MDocument></cml>
\ No newline at end of file
diff --git a/Code/GraphMol/MarvinParse/test_data/AtropManyChiralsEnhanced4.mrv.nosan.expected.sdf b/Code/GraphMol/MarvinParse/test_data/AtropManyChiralsEnhanced4.mrv.nosan.expected.sdf
index a601cb2f275..83121a8b6c8 100644
--- a/Code/GraphMol/MarvinParse/test_data/AtropManyChiralsEnhanced4.mrv.nosan.expected.sdf
+++ b/Code/GraphMol/MarvinParse/test_data/AtropManyChiralsEnhanced4.mrv.nosan.expected.sdf
@@ -49,7 +49,7 @@ M  V30 19 1 18 19 CFG=1
 M  V30 20 1 18 20
 M  V30 END BOND
 M  V30 BEGIN COLLECTION
-M  V30 MDLV30/STEREL1 ATOMS=(4 11 15 8 9)
+M  V30 MDLV30/STEREL1 ATOMS=(3 8 11 15)
 M  V30 MDLV30/STERAC1 ATOMS=(2 12 18)
 M  V30 END COLLECTION
 M  V30 END CTAB
diff --git a/Code/GraphMol/test_data/Github8323.sdf b/Code/GraphMol/test_data/Github8323.sdf
new file mode 100644
index 00000000000..20da45c6094
--- /dev/null
+++ b/Code/GraphMol/test_data/Github8323.sdf
@@ -0,0 +1,152 @@
+
+  ACCLDraw03052509552D
+
+  0  0  0     0  0            999 V3000
+M  V30 BEGIN CTAB
+M  V30 COUNTS 9 9 0 0 1
+M  V30 BEGIN ATOM
+M  V30 1 S 15.9078 -7.0163 0 0 CFG=2 
+M  V30 2 C 15.3149 -5.994 0 0 
+M  V30 3 O 15.319 -8.0401 0 0 
+M  V30 4 C 17.0876 -7.0147 0 0 
+M  V30 5 C 18.8552 -5.9903 0 0 
+M  V30 6 C 17.6773 -5.9908 0 0 
+M  V30 7 C 19.4475 -7.013 0 0 
+M  V30 8 C 18.863 -8.033 0 0 
+M  V30 9 C 17.6823 -8.0414 0 0 
+M  V30 END ATOM
+M  V30 BEGIN BOND
+M  V30 1 1 1 2 CFG=1 
+M  V30 2 2 1 3 
+M  V30 3 1 1 4 
+M  V30 4 1 5 6 
+M  V30 5 2 6 4 
+M  V30 6 2 5 7 
+M  V30 7 1 7 8 
+M  V30 8 2 8 9 
+M  V30 9 1 4 9 
+M  V30 END BOND
+M  V30 BEGIN COLLECTION
+M  V30 MDLV30/STEABS ATOMS=(1 1)
+M  V30 END COLLECTION
+M  V30 END CTAB
+M  END
+>  <StereoGroupOnAtom>
+0
+
+$$$$
+
+  ACCLDraw03052509542D
+
+  0  0  0     0  0            999 V3000
+M  V30 BEGIN CTAB
+M  V30 COUNTS 9 9 0 0 0
+M  V30 BEGIN ATOM
+M  V30 1 C 15.3149 -5.994 0 0 
+M  V30 2 S 15.9078 -7.0163 0 0 CFG=2 
+M  V30 3 O 15.319 -8.0401 0 0 
+M  V30 4 C 17.0876 -7.0147 0 0 
+M  V30 5 C 18.8552 -5.9903 0 0 
+M  V30 6 C 17.6773 -5.9908 0 0 
+M  V30 7 C 19.4475 -7.013 0 0 
+M  V30 8 C 18.863 -8.033 0 0 
+M  V30 9 C 17.6823 -8.0414 0 0 
+M  V30 END ATOM
+M  V30 BEGIN BOND
+M  V30 1 1 2 1 CFG=1 
+M  V30 2 2 2 3 
+M  V30 3 1 4 2 
+M  V30 4 1 5 6 
+M  V30 5 2 6 4 
+M  V30 6 2 7 5 
+M  V30 7 1 8 7 
+M  V30 8 2 9 8 
+M  V30 9 1 4 9 
+M  V30 END BOND
+M  V30 BEGIN COLLECTION
+M  V30 MDLV30/STERAC1 ATOMS=(1 2)
+M  V30 END COLLECTION
+M  V30 END CTAB
+M  END
+>  <StereoGroupOnAtom>
+1
+
+$$$$
+
+  ACCLDraw03052510142D
+
+  0  0  0     0  0            999 V3000
+M  V30 BEGIN CTAB
+M  V30 COUNTS 10 10 0 0 1
+M  V30 BEGIN ATOM
+M  V30 1 C 15.2801 -6.3814 0 0 
+M  V30 2 C 14.0994 -6.3853 0 0 
+M  V30 3 C 13.5125 -7.4099 0 0 
+M  V30 4 C 14.1063 -8.4305 0 0 
+M  V30 5 C 15.287 -8.4265 0 0 
+M  V30 6 C 15.8741 -7.4019 0 0 
+M  V30 7 C 17.0554 -7.4003 0 0 
+M  V30 8 S 17.6481 -8.4223 0 0 CFG=2 
+M  V30 9 O 17.0595 -9.4458 0 0 
+M  V30 10 C 18.8275 -8.4207 0 0 
+M  V30 END ATOM
+M  V30 BEGIN BOND
+M  V30 1 2 2 1 
+M  V30 2 1 3 2 
+M  V30 3 2 4 3 
+M  V30 4 1 5 4 
+M  V30 5 1 1 6 
+M  V30 6 2 6 5 
+M  V30 7 1 7 6 
+M  V30 8 1 8 7 CFG=1 
+M  V30 9 2 8 9 
+M  V30 10 1 10 8 
+M  V30 END BOND
+M  V30 BEGIN COLLECTION
+M  V30 MDLV30/STEABS ATOMS=(1 8)
+M  V30 END COLLECTION
+M  V30 END CTAB
+M  END
+>  <StereoGroupOnAtom>
+7
+
+$$$$
+
+  ACCLDraw03052510142D
+
+  0  0  0     0  0            999 V3000
+M  V30 BEGIN CTAB
+M  V30 COUNTS 10 10 0 0 0
+M  V30 BEGIN ATOM
+M  V30 1 C 15.2801 -6.3814 0 0 
+M  V30 2 C 14.0994 -6.3853 0 0 
+M  V30 3 C 13.5125 -7.4099 0 0 
+M  V30 4 C 14.1063 -8.4305 0 0 
+M  V30 5 C 15.287 -8.4265 0 0 
+M  V30 6 C 15.8741 -7.4019 0 0 
+M  V30 7 C 17.0554 -7.4003 0 0 
+M  V30 8 S 17.6481 -8.4223 0 0 CFG=2 
+M  V30 9 O 17.0595 -9.4458 0 0 
+M  V30 10 C 18.8275 -8.4207 0 0 
+M  V30 END ATOM
+M  V30 BEGIN BOND
+M  V30 1 2 2 1 
+M  V30 2 1 3 2 
+M  V30 3 2 4 3 
+M  V30 4 1 5 4 
+M  V30 5 1 1 6 
+M  V30 6 2 6 5 
+M  V30 7 1 7 6 
+M  V30 8 1 8 7 CFG=1 
+M  V30 9 2 8 9 
+M  V30 10 1 10 8 
+M  V30 END BOND
+M  V30 BEGIN COLLECTION
+M  V30 MDLV30/STERAC1 ATOMS=(1 8)
+M  V30 END COLLECTION
+M  V30 END CTAB
+M  END
+>  <StereoGroupOnAtom>
+7
+
+$$$$
\ No newline at end of file