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.
- Prerequisites
- Decide which Marvin JS drawing mode to use
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.
- Always use canonical or combinatorial SMILES strings.
- Only a subset of SMILES notation is supported for use in Marvin JS 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.
- You can't specify the orientation of the drawing when using SMILES.
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 |
---|---|
|
|
The best way to ensure that your SMILES string works correctly in Marvin JS is to use Marvin JS to generate SMILES.
Example Displaying Chemical Structures Using SMILES
The following table summarizes an actual question.
QID |
|
---|---|
Name |
|
Mode |
|
Question |
|
Answer |
|
Display to Students |
Example Marvin JS Question Using SMILES Answer Key
The following table summarizes an actual question.
QID |
|
---|---|
Name |
|
Mode |
|
Question |
|
Answer |
|
Display to Students |