Create MarvinSketch Questions That Use Canonical or Combinatorial SMILES Strings

Sometimes, you want to display a randomly selected molecule in your question. Or, you might even want to combine molecules — for example, in condensation reactions or peptide sequences. Specifying the chemical structure using SMILES (Simplified Molecular Input Line Entry System) strings instead of the native MarvinSketch XML lets you combine or otherwise change the chemical structure programmatically, and offers a space-efficient method for defining arrays of chemical structures that can be used in your question.

Canonical SMILES strings uniquely identify a particular molecule. The canonical SMILES representation of any molecule is dependent on the software program's canonicalization algorithm. For this reason, the canonical SMILES string for a molecule in MarvinSketch might be different from the canonical SMILES string generated by another application.

Combinatorial SMILES strings identify a discrete structure in a molecule, and can be combined to form canonical SMILES strings.

Important:  
  • Always use canonical or combinatorial SMILES strings.
  • Only a subset of SMILES notation is supported for use in MarvinSketch questions.
  • Do not use SMILES strings for reactions or to specify atom mapping.
  • Other formats, such as molfile formats, protein data bank files, InChi strings, and IUPAC names, are not supported for use in WebAssign® questions. You might be able to use one of these formats to display a structure in your question, but you should never use them to define answer keys that your students must draw, as this could result in scoring problems with your students' responses.

Although the native MarvinSketch XML format provides the most comprehensive description of your chemical structures, it is long, difficult to read, and cannot be manipulated by your question code. With SMILES, your question code can easily combine or change SMILES strings, for example, to reflect a chemical process or to randomize your question.

For example, you could use either MarvinSketch XML or SMILES to display an ethanol molecule: 

MarvinSketch XML

SMILES

<?xml version="1.0" encoding="UTF-8"?><cml version="ChemAxon file format v5.10.0, generated by v5.12.1"><MDocument>  <MChemicalStruct>    <molecule molID="m1">      <atomArray atomID="a1 a2 a3" elementType="C C O" x2="2.310 3.644 4.977" y2="-1.334 -2.104 -1.334"/>      <bondArray>        <bond atomRefs2="a1 a2" order="1"/>        <bond atomRefs2="a2 a3" order="1"/>      </bondArray>    </molecule>  </MChemicalStruct></MDocument></cml>
CCO

The best way to ensure that your SMILES string works correctly in MarvinSketch is to use MarvinSketch to generate SMILES.

To use a SMILES string in your question:

  1. Create your drawing using the MarvinSketch Key Generation tool.
    1. Click Marvin under Page Tools.
    2. For Marvin Type, select the drawing mode that you want to use.
    3. Draw the chemical structure.
  2. In the MarvinSketch Key Generation tool, save the drawing using the SMILES format.
    1. Click File > Save.
    2. In Files of Type, select SMILES.
    3. Navigate to the location where you want to save the file, type a File Name, and then click Save.
  3. In a text editor, open the SMILES file you saved and copy its contents.
  4. Paste the SMILES string that you copied into your question.
    You can use the SMILES string in your questions instead of MarvinSketch XML to display the chemical structure drawing in a question, to specify a MarvinSketch answer key, or to define a MarvinSketch template.

Example Displaying Chemical Structures Using SMILES

The following table summarizes an actual question.

QID

1534322

Name

Template2 5.MARVIN.06.

Mode

Multiple-Choice

Question

<eqn>
# ----------------------------------------------------
#    Select 1 of 8 molecules to identify
# ----------------------------------------------------
@dat = (["ethanol", "CCO"],
        ["isopropanol", "CC(O)C"],
        ["methanol", "CO"],
        ["n-propanol", "CCCO"],
        ["n-butanol", "CCCCO"],
        ["isobutanol", "CC(C)CO"],
        ["propene", "C=CC"],
        ["ethylene", "C=C"]);
@choices = pick(5, 0..$#dat);
''
</eqn>
Identify the molecule.
<table><tr><td width="250"><_></td>
<td><MARVIN type='condensed'><EQN 
$dat[$choices[0]][1]></MARVIN></td></tr></table>

Answer

<EQN $dat[$choices[0]][0]>
<EQN $dat[$choices[1]][0]>
<EQN $dat[$choices[2]][0]>
<EQN $dat[$choices[3]][0]>
<EQN $dat[$choices[4]][0]>

Display to Students

Question as displayed to students

Example MarvinSketch Question Using SMILES Answer Key

The following table summarizes an actual question.

QID

1534328

Name

Template2 5.MARVIN.07.

Mode

Fill-in-the-Blank

Question

<eqn>
# ----------------------------------------------------
#    Set $mykey to one of 2730 possible tripeptides
# ----------------------------------------------------
@dat = (["Ala", "NC(C)C(=O)"],
        ["Arg", "NC(CCCNC(N)=N)C(=O)"],
        ["Asn", "NC(CC(N)=O)C(=O)"],
        ["Asp", "NC(CC(O)=O)C(=O)"],
        ["Cys", "NC(CS)C(=O)"],
        ["Gln", "NC(CCC(N)=O)C(=O)"],
        ["Glu", "NC(CCC(O)=O)C(=O)"],
        ["Gly", "NCC(=O)"],
        ["Ile", "NC(C(C)CC)C(=O)"],
        ["Leu", "NC(CC(C)C)C(=O)"],
        ["Lys", "NC(CCCCN)C(=O)"],
        ["Met", "NC(CCSC)C(=O)"],
        ["Ser", "NC(CO)C(=O)"],
        ["Thr", "NC(C(C)O)C(=O)"],
        ["Val", "NC(C(C)C)C(=O)"]);
($a, $b, $c) = pick(3, 0..$#dat);
$label = $dat[$a][0] . '-' . $dat[$b][0] . '-' . $dat[$c][0];
$mykey = $dat[$a][1] . $dat[$b][1] . $dat[$c][1] . 'O';
''
</eqn> 
Draw the structure of the tripeptide <eqn $label>. <br> <_>

Answer

<EQN $MARVIN='condensed'; $mykey>

Display to Students

Question as displayed to students