Task: Fixes #7983 (rdkit/rdkit#8342)

org: rdkit
repo: rdkit
pr_number: 8342
issue_title: Fixes #7983
issue_body: 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: number: 7983
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?



Reference solution:
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