Create Marvin JS 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 Marvin JS 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.

How-ToInstructor HelpWebAssign

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 Marvin JS 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.

Although the native Marvin JS 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 Marvin JS XML or SMILES to display an ethanol molecule:

Marvin JS XML

SMILES

CCO

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

  1. Create your drawing using the Marvin JS Key Generation tool.

    1. Click Marvin under Page Tools.

    2. For Marvin Type, select the drawing mode to use.

    3. Draw the chemical structure or reaction.

  2. In the Marvin JS Key Generation tool, export the drawing to the ChemAxon SMILES format.

    1. Click export.

    2. For Format, select ChemAxon SMILES.

    3. Select and copy the SMILES string that is displayed.

    You don't need to download the SMILES string.

  3. Paste the SMILES string that you copied into your question.

    You can use the SMILES string in your questions instead of Marvin JS XML to display the chemical structure drawing in a question, to specify a Marvin JS answer key, or to define a Marvin JS 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 Example Marvin JS 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