mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-03 21:44:30 +08:00
- expose the onlyWedgeFlags parameter to SWIG ClearSingleBondDirFlags (#8600)
- exercise the flag through a unit test Co-authored-by: ptosco <paolo.tosco@novartis.com>
This commit is contained in:
@@ -435,8 +435,8 @@ unsigned int getDefaultPickleProperties();
|
||||
RDKit::Chirality::pickBondsToWedge(*($self));
|
||||
};
|
||||
|
||||
void ClearSingleBondDirFlags() {
|
||||
RDKit::ClearSingleBondDirFlags(*($self));
|
||||
void ClearSingleBondDirFlags(bool onlyWedgeFlags=false) {
|
||||
RDKit::MolOps::clearSingleBondDirFlags(*($self), onlyWedgeFlags);
|
||||
};
|
||||
|
||||
void reapplyMolBlockWedging() {
|
||||
|
||||
@@ -168,8 +168,8 @@ void DetectAtomStereoChemistry(const RDKit::Conformer *conf) {
|
||||
void DetectBondStereoChemistry(const RDKit::Conformer *conf) {
|
||||
RDKit::DetectBondStereoChemistry(*($self), conf);
|
||||
}
|
||||
void ClearSingleBondDirFlags() {
|
||||
RDKit::ClearSingleBondDirFlags(*($self));
|
||||
void ClearSingleBondDirFlags(bool onlyWedgeFlags=false) {
|
||||
RDKit::MolOps::clearSingleBondDirFlags(*($self), onlyWedgeFlags);
|
||||
};
|
||||
void reapplyMolBlockWedging() {
|
||||
RDKit::Chirality::reapplyMolBlockWedging(*($self));
|
||||
|
||||
@@ -710,6 +710,38 @@ public class Chemv2Tests extends GraphMolTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClearSingleBondDirFlagsOnlyWedgeFlags() {
|
||||
RWMol m = null;
|
||||
RWMol m2 = null;
|
||||
RWMol m3 = null;
|
||||
try {
|
||||
m = RWMol.MolFromSmiles("Cl[C@H](C)/C=C/CC");
|
||||
m2 = new RWMol(m);
|
||||
m2.compute2DCoords();
|
||||
m2.ClearSingleBondDirFlags();
|
||||
m2.WedgeMolBonds(m2.getConformer());
|
||||
RDKFuncs.assignStereochemistry(m2, true, true);
|
||||
assertEquals(m2.MolToSmiles(), "CCC=C[C@@H](C)Cl");
|
||||
m3 = new RWMol(m);
|
||||
m3.compute2DCoords();
|
||||
m3.ClearSingleBondDirFlags(true);
|
||||
m3.WedgeMolBonds(m3.getConformer());
|
||||
RDKFuncs.assignStereochemistry(m3, true, true);
|
||||
assertEquals(m3.MolToSmiles(), "CC/C=C/[C@@H](C)Cl");
|
||||
} finally {
|
||||
if (m != null) {
|
||||
m.delete();
|
||||
}
|
||||
if (m2 != null) {
|
||||
m2.delete();
|
||||
}
|
||||
if (m3 != null) {
|
||||
m3.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String args[]) {
|
||||
org.junit.runner.JUnitCore.main("org.RDKit.Chemv2Tests");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user