mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-04 21:54:27 +08:00
Added AtomComparator.AtomCompareAnyHeavyAtom and test cases to FMCS code (#2656)
* Added AtomComparator.AtomCompareAnyHeavyAtom and test cases to FMCS code * Added AtomComparator.AtomCompareAnyHeavyAtom * Added AtomComparator.AtomCompareAnyHeavyAtom - fixed test typo * Added AtomComparator.AtomCompareAnyHeavyAtom and test cases to FMCS code (2) * Added AtomComparator.AtomCompareAnyHeavyAtom - fixed test cases * Added AtomComparator.AtomCompareAnyHeavyAtom and test cases * Update Code/GraphMol/FMCS/FMCS.cpp Co-Authored-By: Greg Landrum <greg.landrum@gmail.com> * Reverted tabs to 4 spaces * Update FMCS.cpp
This commit is contained in:
committed by
Greg Landrum
parent
b92c265348
commit
710bdfa60b
@@ -86,6 +86,37 @@ public class FMCSTests extends GraphMolTest {
|
||||
assertEquals(false,mcs.getCanceled());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAtomCompareAnyHeavyAtom() {
|
||||
ROMol_Vect mols = new ROMol_Vect();
|
||||
mols.add(RWMol.MolFromSmiles("[H]c1ccccc1C",0, false));
|
||||
mols.add(RWMol.MolFromSmiles("[H]c1ccccc1O",0, false));
|
||||
// H matches H, O matches C
|
||||
MCSResult mcs=RDKFuncs.findMCS(mols,true,1,60,false,false,false,false,false,
|
||||
AtomComparator.AtomCompareAnyHeavyAtom,
|
||||
BondComparator.BondCompareAny);
|
||||
assertEquals(8,mcs.getNumAtoms());
|
||||
assertEquals(8,mcs.getNumBonds());
|
||||
//assertEquals("[#6]1:,-[#6]:,-[#6]:,-[#6]:,-[#6]:,-[#6]:,-1",mcs.getSmartsString());
|
||||
assertEquals(false,mcs.getCanceled());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAtomCompareAnyHeavyAtom1() {
|
||||
ROMol_Vect mols = new ROMol_Vect();
|
||||
mols.add(RWMol.MolFromSmiles("[H]c1ccccc1C",0, false));
|
||||
mols.add(RWMol.MolFromSmiles("Oc1ccccc1O",0, false));
|
||||
// O matches C, H does not match O
|
||||
MCSResult mcs=RDKFuncs.findMCS(mols,true,1,60,false,false,false,false,false,
|
||||
AtomComparator.AtomCompareAnyHeavyAtom,
|
||||
BondComparator.BondCompareAny);
|
||||
assertEquals(7,mcs.getNumAtoms());
|
||||
assertEquals(7,mcs.getNumBonds());
|
||||
//assertEquals("[#6]1:,-[#6]:,-[#6]:,-[#6]:,-[#6]:,-[#6]:,-1",mcs.getSmartsString());
|
||||
assertEquals(false,mcs.getCanceled());
|
||||
|
||||
}
|
||||
|
||||
public static void main(String args[]) {
|
||||
org.junit.runner.JUnitCore.main("org.RDKit.FMCSTests");
|
||||
|
||||
Reference in New Issue
Block a user