Browse Source

fix aromatic rings assignment

Alexander Rose 3 years ago
parent
commit
ca5e57ddbf
2 changed files with 3 additions and 0 deletions
  1. 1 0
      CHANGELOG.md
  2. 2 0
      src/mol-model/structure/structure/unit/rings.ts

+ 1 - 0
CHANGELOG.md

@@ -7,6 +7,7 @@ Note that since we don't clearly distinguish between a public and private interf
 ## [Unreleased]
 
 - Check that model and coordinates have same element count when creating a trajectory
+- Fix aromatic rings assignment: do not mix flags and planarity test
 
 ## [v3.5.0] - 2022-03-25
 

+ 2 - 0
src/mol-model/structure/structure/unit/rings.ts

@@ -123,6 +123,8 @@ namespace UnitRing {
         if (aromaticBondCount === 2 * ring.length) return true;
         if (!hasAromaticRingElement) return false;
         if (ring.length < 5) return false;
+        // no planarity-based aromaticity if any aromatic flags are present
+        if (aromaticBondCount > 0) return false;
 
         const ma = PrincipalAxes.calculateMomentsAxes(getPositions(unit, ring));
         return Vec3.magnitude(ma.dirC) < AromaticRingPlanarityThreshold;