Example Resource

Symbolic Chemical Representations

Source Notebook

Symbolic Chemical Representations

 

Examples

The Wolfram Language provides several data structures for representing chemical species at different levels of granularity.

Start with a small BioSequence representing a single codon.

In[1]:=
bioseq = BioSequence["RNA", "AUG"]
Out[1]=

From this bio sequence you can create a ChemicalFormula or a Molecule depending on your application.

In[2]:=
form = ChemicalFormula@bioseq
Out[2]=
In[3]:=
mol = Molecule@bioseq
Out[3]=

Equivalence between different representations can be checked easily using MoleculeMatchQ.

In[4]:=
{MoleculeMatchQ[mol, bioseq], MoleculeMatchQ[mol, form]}
Out[4]=

As the simplest representation, the formula allows you to find molecular mass and elemental composition.

In[5]:=
form[{"MolecularMass", "ElementCounts"}]
Out[5]=

The molecule represents all atoms and bonds explicitly and allows computing topological properties or even generating a 3D structure.

In[6]:=
mol[{"AromaticRingCount", "HBondDonorCount"}]
Out[6]=
In[7]:=
MoleculePlot3D[mol, PlotTheme -> "Spacefilling"]
Out[7]=

The bio sequence representation allows computation at a higher level of abstraction. Convert this sequence into DNA or into a peptide.

In[8]:=
BioSequenceTranscribe[bioseq]
Out[8]=
In[9]:=
BioSequenceTranslate[bioseq]
Out[9]=

Source Metadata

Publisher Information