Beispiel #1
0
  /**
   * Test generation of a reaction SMILES. I know, it's a stupid alchemic reaction, but it serves
   * its purpose.
   */
  @Test
  public void testReactionSMILES() {
    Reaction reaction = new Reaction();
    IAtomContainer methane = new AtomContainer();
    methane.addAtom(new Atom("C"));
    reaction.addReactant(methane);
    IAtomContainer magic = new AtomContainer();
    magic.addAtom(new PseudoAtom("magic"));
    reaction.addAgent(magic);
    IAtomContainer gold = new AtomContainer();
    gold.addAtom(new Atom("Au"));
    reaction.addProduct(gold);

    SmilesGenerator sg = new SmilesGenerator();
    try {
      String smiles = sg.createSMILES(reaction);
      // logger.debug("Generated SMILES: " + smiles);
      Assert.assertEquals("C>[*]>[Au]", smiles);
    } catch (Exception exc) {
      System.out.println(exc);
    }
  }
 public void addProduct(IMolecule product, Double coefficient) {
   logger.debug("Adding product with coefficient: ", product, "" + coefficient);
   super.addProduct(product, coefficient);
 }
 public void addProduct(IMolecule product) {
   logger.debug("Adding product: ", product);
   super.addProduct(product);
 }