@Test
  public void testBondPermutation() throws CDKException {
    IAtomContainer pamine = makePropylAmine();
    ShortestPathFingerprinter fp = new ShortestPathFingerprinter();
    IBitFingerprint bs1 = fp.getBitFingerprint(pamine);

    AtomContainerBondPermutor acp = new AtomContainerBondPermutor(pamine);
    while (acp.hasNext()) {
      IAtomContainer container = acp.next();
      IBitFingerprint bs2 = fp.getBitFingerprint(container);
      Assert.assertTrue(bs1.equals(bs2));
    }
  }
  @Test
  public void testBondPermutation2() throws CDKException {
    IAtomContainer pamine = TestMoleculeFactory.makeCyclopentane();
    AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(pamine);
    ShortestPathFingerprinter fp = new ShortestPathFingerprinter();
    IBitFingerprint bs1 = fp.getBitFingerprint(pamine);

    AtomContainerBondPermutor acp = new AtomContainerBondPermutor(pamine);
    while (acp.hasNext()) {
      IAtomContainer container = acp.next();
      IBitFingerprint bs2 = fp.getBitFingerprint(container);
      Assert.assertTrue(bs1.equals(bs2));
    }
  }
Ejemplo n.º 3
0
 /** A unit test for JUnit */
 @Test
 public void testBondPermutation() {
   IAtomContainer mol = new AtomContainer();
   mol.addAtom(new Atom("S"));
   mol.addAtom(new Atom("O"));
   mol.addAtom(new Atom("O"));
   mol.addAtom(new Atom("O"));
   mol.addAtom(new Atom("O"));
   mol.addBond(0, 1, IBond.Order.DOUBLE);
   mol.addBond(0, 2, IBond.Order.DOUBLE);
   mol.addBond(0, 3, IBond.Order.SINGLE);
   mol.addBond(0, 4, IBond.Order.SINGLE);
   mol.getAtom(3).setImplicitHydrogenCount(1);
   mol.getAtom(4).setImplicitHydrogenCount(1);
   AtomContainerBondPermutor acbp = new AtomContainerBondPermutor(mol);
   SmilesGenerator sg = new SmilesGenerator();
   String smiles = "";
   String oldSmiles = sg.createSMILES(mol);
   while (acbp.hasNext()) {
     smiles = sg.createSMILES(new AtomContainer((AtomContainer) acbp.next()));
     // logger.debug(smiles);
     Assert.assertEquals(oldSmiles, smiles);
   }
 }