Example #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 removeListener(IChemObjectListener col) {
   logger.debug("Removing listener: ", col);
   super.removeListener(col);
 }
 public void addListener(IChemObjectListener col) {
   logger.debug("Adding listener: ", col);
   super.addListener(col);
 }
 public void setDirection(IReaction.Direction direction) {
   logger.debug("Setting direction: ", direction);
   super.setDirection(direction);
 }
 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);
 }
 public void setID(String identifier) {
   logger.debug("Setting ID: ", identifier);
   super.setID(identifier);
 }
 public void setProperty(Object description, Object property) {
   logger.debug("Setting property: ", description + "=" + property);
   super.setProperty(description, property);
 }
 public void addReactant(IMolecule reactant) {
   logger.debug("Adding reactant: ", reactant);
   super.addReactant(reactant);
 }
 public void setProducts(IMoleculeSet products) {
   logger.debug("Setting products: ", products);
   super.setProducts(products);
 }
 public void setReactants(IMoleculeSet reactants) {
   logger.debug("Setting reactants: ", reactants);
   super.setReactants(reactants);
 }
 public void setFlags(boolean[] flagsNew) {
   logger.debug("Setting flags:", flagsNew.length);
   super.setFlags(flagsNew);
 }
 public void setProperties(Map<Object, Object> properties) {
   logger.debug("Setting properties: ", properties);
   super.setProperties(properties);
 }
 public void setFlag(int flag_type, boolean flag_value) {
   logger.debug("Setting flag: ", flag_type + "=" + flag_value);
   super.setFlag(flag_type, flag_value);
 }
 public void notifyChanged() {
   logger.debug("Notifying changed");
   super.notifyChanged();
 }
 public void notifyChanged(IChemObjectChangeEvent evt) {
   logger.debug("Notifying changed event: ", evt);
   super.notifyChanged(evt);
 }
 public void addAgent(IMolecule agent) {
   logger.debug("Adding agent: ", agent);
   super.addAgent(agent);
 }
 public void removeProperty(Object description) {
   logger.debug("Removing property: ", description);
   super.removeProperty(description);
 }
 public void addReactant(IMolecule reactant, Double coefficient) {
   logger.debug("Adding reactant with coefficient: ", reactant, "" + coefficient);
   super.addReactant(reactant, coefficient);
 }