mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-03 21:44:30 +08:00
If templates match, skip ring number check (#9217)
* remove ring mathcing for templates * remove extra code * remove empty lines * fix build error
This commit is contained in:
@@ -452,8 +452,7 @@ static bool checkStereoChemistry(const RDKit::ROMol &mol,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EmbeddedFrag::matchToTemplate(const RDKit::INT_VECT &ringSystemAtoms,
|
||||
unsigned int ring_count) {
|
||||
bool EmbeddedFrag::matchToTemplate(const RDKit::INT_VECT &ringSystemAtoms) {
|
||||
CoordinateTemplates &coordinate_templates =
|
||||
CoordinateTemplates::getRingSystemTemplates();
|
||||
|
||||
@@ -495,8 +494,6 @@ bool EmbeddedFrag::matchToTemplate(const RDKit::INT_VECT &ringSystemAtoms,
|
||||
// and bond count first
|
||||
if (mol->getNumBonds() != numBonds) {
|
||||
continue;
|
||||
} else if (mol->getRingInfo()->numRings() != ring_count) {
|
||||
continue;
|
||||
}
|
||||
// also check if the mol atoms have the same connectivity as the template
|
||||
#ifdef _MSC_VER
|
||||
@@ -634,7 +631,7 @@ void EmbeddedFrag::embedFusedRings(const RDKit::VECT_INT_VECT &fusedRings,
|
||||
(fusedRings.size() > 1 ||
|
||||
(fusedRings.size() == 1 && fusedRings[0].size() > 8))) {
|
||||
RDKit::Union(fusedRings, funion);
|
||||
bool found_template = matchToTemplate(funion, fusedRings.size());
|
||||
bool found_template = matchToTemplate(funion);
|
||||
if (found_template) {
|
||||
// we are done
|
||||
return;
|
||||
@@ -656,7 +653,7 @@ void EmbeddedFrag::embedFusedRings(const RDKit::VECT_INT_VECT &fusedRings,
|
||||
if (coreRings.size() > 1 && coreRings.size() < fusedRings.size()) {
|
||||
// look for a template that matches the core ring system
|
||||
RDKit::Union(coreRings, funion);
|
||||
bool found_template = matchToTemplate(funion, coreRings.size());
|
||||
bool found_template = matchToTemplate(funion);
|
||||
if (found_template) {
|
||||
doneRings = coreRingsIds;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,11 @@ typedef boost::shared_array<double> DOUBLE_SMART_PTR;
|
||||
//! Class that contains the data for an atoms that has already been embedded
|
||||
class RDKIT_DEPICTOR_EXPORT EmbeddedAtom {
|
||||
public:
|
||||
typedef enum { UNSPECIFIED = 0, CISTRANS, RING } EAtomType;
|
||||
typedef enum {
|
||||
UNSPECIFIED = 0,
|
||||
CISTRANS,
|
||||
RING
|
||||
} EAtomType;
|
||||
|
||||
EmbeddedAtom() { neighs.clear(); }
|
||||
|
||||
@@ -372,8 +376,7 @@ class RDKIT_DEPICTOR_EXPORT EmbeddedFrag {
|
||||
double totalDensity();
|
||||
|
||||
// returns true if fused rings found a template
|
||||
bool matchToTemplate(const RDKit::INT_VECT &ringSystemAtoms,
|
||||
unsigned int ring_count);
|
||||
bool matchToTemplate(const RDKit::INT_VECT &ringSystemAtoms);
|
||||
|
||||
void embedFusedRings(const RDKit::VECT_INT_VECT &fusedRings,
|
||||
bool useRingTemplates);
|
||||
|
||||
Reference in New Issue
Block a user