Example #1
0
  @Test
  public void methyleneCyclopropeneTest() {
    IAtomContainer mol = builder.newInstance(IAtomContainer.class);
    AbstractSignatureTest.addCarbons(mol, 4);
    AbstractSignatureTest.addHydrogens(mol, 1, 2);
    AbstractSignatureTest.addHydrogens(mol, 2, 1);
    AbstractSignatureTest.addHydrogens(mol, 3, 1);
    mol.addBond(0, 1, IBond.Order.DOUBLE);
    mol.addBond(0, 2, IBond.Order.SINGLE);
    mol.addBond(0, 3, IBond.Order.SINGLE);
    mol.addBond(2, 3, IBond.Order.DOUBLE);
    MoleculeSignature molSig = new MoleculeSignature(mol);

    String sigFor2Height1 = molSig.signatureStringForVertex(2, 1);
    String sigFor3Height1 = molSig.signatureStringForVertex(3, 1);
    Assert.assertTrue(
        "Height 1 signatures for atoms 2 and 3" + " should be the same",
        sigFor2Height1.equals(sigFor3Height1));

    String sigFor2Height2 = molSig.signatureStringForVertex(2, 1);
    String sigFor3Height2 = molSig.signatureStringForVertex(3, 1);
    Assert.assertTrue(
        "Height 2 signatures for atoms 2 and 3" + " should be the same",
        sigFor2Height2.equals(sigFor3Height2));
  }
Example #2
0
 @Test
 public void testBridgedCycloButane() {
   String expected = "[C]([C]([C,0])[C]([C,0])[C,0])";
   IAtomContainer mol = AbstractSignatureTest.makeBridgedCyclobutane();
   String signature = this.canonicalStringFromMolecule(mol);
   Assert.assertEquals(expected, signature);
 }
Example #3
0
 @Test
 public void testCubane() {
   String expected =
       "[C]([C]([C,3]([C,2])[C,1]([C,2]))[C]([C,3][C,0]" + "([C,2]))[C]([C,0][C,1]))";
   IAtomContainer mol = AbstractSignatureTest.makeCubane();
   Assert.assertEquals(expected, this.canonicalStringFromMolecule(mol));
 }
Example #4
0
 @Test
 public void cycleWheelTest() {
   IAtomContainer mol = AbstractSignatureTest.makeCycleWheel(3, 3);
   String expected = "[C]([C]([C]([C,2])[C,2])" + "[C]([C]([C,1])[C,1])" + "[C]([C]([C,0])[C,0]))";
   MoleculeSignature molSig = new MoleculeSignature(mol);
   String centralSignature = molSig.signatureStringForVertex(0);
   Assert.assertEquals(expected, centralSignature);
 }
Example #5
0
 @Test
 public void testPropellane() {
   String expectedA = "[C]([C]([C,0])[C]([C,0])[C]([C,0])[C,0])";
   String expectedB = "[C]([C]([C,2][C,1][C,0])[C,2]([C,1][C,0]))";
   IAtomContainer mol = AbstractSignatureTest.makePropellane();
   String signature = this.canonicalStringFromMolecule(mol);
   Assert.assertEquals(expectedA, signature);
   String fullExpected = "2" + expectedA + " + 3" + expectedB;
   String fullSignature = fullStringFromMolecule(mol);
   Assert.assertEquals(fullExpected, fullSignature);
 }
Example #6
0
  @Test
  public void testBenzeneWithDoubleBonds() {
    IAtomContainer benzene = builder.newInstance(IAtomContainer.class);
    AbstractSignatureTest.addCarbons(benzene, 6);
    for (int i = 0; i < 6; i++) {
      AbstractSignatureTest.addHydrogens(benzene, i, 1);
    }
    benzene.addBond(0, 1, IBond.Order.SINGLE);
    benzene.addBond(1, 2, IBond.Order.DOUBLE);
    benzene.addBond(2, 3, IBond.Order.SINGLE);
    benzene.addBond(3, 4, IBond.Order.DOUBLE);
    benzene.addBond(4, 5, IBond.Order.SINGLE);
    benzene.addBond(5, 0, IBond.Order.DOUBLE);

    MoleculeSignature signature = new MoleculeSignature(benzene);
    String carbonSignature = signature.signatureStringForVertex(0);
    for (int i = 1; i < 6; i++) {
      String carbonSignatureI = signature.signatureStringForVertex(i);
      Assert.assertEquals(carbonSignature, carbonSignatureI);
    }
  }
Example #7
0
  @Test
  public void cyclobuteneTest() {
    String expectedA = "[C]([C]([C,0])=[C]([C,0]))";
    String expectedB = "[C]([C]([C,0])[C](=[C,0]))";
    IAtomContainer cyclobutene = builder.newInstance(IAtomContainer.class);
    AbstractSignatureTest.addCarbons(cyclobutene, 4);
    cyclobutene.addBond(0, 1, IBond.Order.SINGLE);
    cyclobutene.addBond(0, 2, IBond.Order.SINGLE);
    cyclobutene.addBond(1, 3, IBond.Order.DOUBLE);
    cyclobutene.addBond(2, 3, IBond.Order.SINGLE);
    Assert.assertEquals(expectedA, canonicalStringFromMolecule(cyclobutene));

    String expectedFullString = "2" + expectedA + " + 2" + expectedB;
    String actualFullString = fullStringFromMolecule(cyclobutene);
    Assert.assertEquals(expectedFullString, actualFullString);
  }
Example #8
0
 @Test
 public void fusedSquareMultipleBondTest() {
   IAtomContainer mol = builder.newInstance(IAtomContainer.class);
   String expected = "[C]([C]([C,1])[C]([C,0])[C](=[C,1])[C](=[C,0]))";
   AbstractSignatureTest.addCarbons(mol, 7);
   mol.addBond(0, 1, IBond.Order.SINGLE);
   mol.addBond(0, 2, IBond.Order.SINGLE);
   mol.addBond(0, 3, IBond.Order.SINGLE);
   mol.addBond(0, 4, IBond.Order.SINGLE);
   mol.addBond(1, 5, IBond.Order.DOUBLE);
   mol.addBond(2, 5, IBond.Order.SINGLE);
   mol.addBond(3, 6, IBond.Order.SINGLE);
   mol.addBond(4, 6, IBond.Order.DOUBLE);
   MoleculeSignature molSig = new MoleculeSignature(mol);
   String sigFor0 = molSig.signatureStringForVertex(0);
   Assert.assertEquals(expected, sigFor0);
 }
Example #9
0
  @Test
  public void testCage() {
    String expectedA =
        "[C]([C]([C]([C,4][C,3]([C,1]))[C]([C,5][C,3]))"
            + "[C]([C,4]([C]([C,2][C,1]))[C]([C,2]([C,0])[C,6]))"
            + "[C]([C,5]([C]([C,0][C,1]))[C,6]([C,0])))";

    String expectedB =
        "[C]([C]([C]([C]([C,1]([C,0])[C,4])[C,5])[C,7]"
            + "([C,4]([C,3])))[C]([C]([C,3]([C,0])[C,6])[C,7])"
            + "[C]([C,5]([C]([C,2][C,1]))[C,6]([C,2]([C,0]))))";
    IAtomContainer mol = AbstractSignatureTest.makeCage();
    String signature = this.canonicalStringFromMolecule(mol);
    Assert.assertEquals(expectedA, signature);
    String fullSignature = fullStringFromMolecule(mol);
    String fullExpected = "8" + expectedA + " + 8" + expectedB;
    Assert.assertEquals(fullExpected, fullSignature);
  }
Example #10
0
 @Test
 @Category(SlowTest.class)
 public void ttprTest() {
   String expected =
       "[Rh]([P]([C]([C]([C]([C,6]))"
           + "[C]([C]([C,6])))[C]([C]([C]([C,3]))"
           + "[C]([C]([C,3])))[C]([C]([C]([C,2]))"
           + "[C]([C]([C,2]))))[P]([C]([C]([C]([C,7]))"
           + "[C]([C]([C,7])))[C]([C]([C]([C,4]))"
           + "[C]([C]([C,4])))[C]([C]([C]([C,1]))"
           + "[C]([C]([C,1]))))[P]([C]([C]([C]([C,8]))"
           + "[C]([C]([C,8])))[C]([C]([C]([C,5]))"
           + "[C]([C]([C,5])))[C]([C]([C]([C,0]))"
           + "[C]([C]([C,0])))))";
   int phosphateCount = 3;
   int ringCount = 3;
   IAtomContainer ttpr = AbstractSignatureTest.makeRhLikeStructure(phosphateCount, ringCount);
   MoleculeSignature molSig = new MoleculeSignature(ttpr);
   String centralSignature = molSig.signatureStringForVertex(0);
   Assert.assertEquals(expected, centralSignature);
 }