Daylight Summer School 2001, June 5-7, Santa Fe, NM

Daylight Worksheet - Explore reaction capabilities of contrib programs. -- WITH HINTS

We'll revisit several of the contrib programs. We'll see if they handle reactions as written, and make modifications if necessary for those which don't work correctly.

showparts.c ($DY_ROOT/contrib/c/smiles)

  1. Build showparts and run it. Try entering reactions. What is the behavior? Does it correctly identify the parts within different reaction molecules?

         % cd
         % pwd
         % cd jane_doe/toolkit
         % mkdir showparts
         % cd showparts
         % cp $DY_ROOT/contrib/c/smiles/showparts.c .
         % cp $DY_ROOT/contrib/c/smiles/makefile .
         % make showparts
         % showparts
         molecule has 2 parts
         part 1  atom C
         part 2  atom C
         part 2  atom O
         part 2 bond C-O
         molecule has 3 parts
         part 1  atom C
         part 2  atom C
         part 2  atom O
         part 3  atom C
         part 3  atom C
         part 3  atom O
         part 2 bond C-O
         part 3 bond C-C
         part 3 bond C-O
  2. Modify showparts.c. Include in the output the role of each atom (use dt_getrole()). Compile and test.

    Add to variable declarations in showparts():

       int role;
    Revise the atom loop to:
       while (NULL_OB != (atom = dt_next(atoms))) {
          sy = dt_symbol(&lensy, atom);
          role = dt_role(atom);
          printf("part %d  atom %.*s", du_part(atom), lensy, sy);
          if (role == DX_ROLE_REACTANT) printf("(REACTANT)\n");
          else if (role == DX_ROLE_AGENT) printf("(AGENT)\n");
          else if (role == DX_ROLE_PRODUCT) printf("(PRODUCT)\n");
          else printf("(unknown role=%d)\n",role);

smarts_filter.c ($DY_ROOT/contrib/c/smarts)

  1. Build smarts_filter and run it. Give a molecule SMARTS (eg. "CCC") and see the results when entering both molecule and reaction SMILES.
        $ smarts_filter "CCC"
        C1CCCCC1 C1CCCCC1 CO
        $ smarts_filter "CCC>>CCO"
  2. Add code to identify the number of matches found (use dt_count(pathset, TYP_PATH)). For reaction queries, identify where the matches occur (eg. in the reactant, product, agent, or combination thereof).

    Revise the appropriate section of code to:

       if (NULL_OB != pathset) {
          printf("%s\n", buf);
          printf("\tnumber of matches = %d\n",dt_count(pathset,TYP_PATH));

Daylight Chemical Information Systems Inc.