Branching
Branches on an atom are enclosed in parentheses () and placed directly after the atom they are attached to. For example, butanone can be written as CCC(=O)C, where the oxygen is a branch off the central carbon.
Let's look at some examples.
2-methylbutane (isopentane) (Figure 1)
Code:
mol1 = Chem.MolFromSmiles("CCC(C)C")
mol1
Figure 1: Structure of 2-methylbutane.
2. 2,2-dimethylpropane (Figure 2)
Code:
mol2 = Chem.MolFromSmiles("CC(C)(C)C")
mol2
Figure 2: Structure of 2,2-dimethylpropane.
3. 2-methylpentane (Figure 3)
Code:
mol3 = Chem.MolFromSmiles("CCCC(C)C")
mol3
Figure 3: Structure of 2-methylpentane.
4. Isobutanol (Figure 4)
Code:
mol4 = Chem.MolFromSmiles("CC(C)CO")
mol4
Figure 4: Structure of Isobutanol.
5. Isopropylamine (Figure 5)
Code:
mol5 = Chem.MolFromSmiles("CC(C)N")
mol5
Figure 5: Structure of Isopropylamine.
6. Display All Molecules in One Grid
All the molecules above from mol1 to mol5 can be displayed in one Grid (Figure 6).
Code:
from rdkit.Chem import Draw
mols = [mol1, mol2, mol3, mol4, mol5]
legends = [
"2-Methylbutane", "2,2-Dimethylpropane", "2-Methylpentane",
"Isobutanol", "Isopropylamine"
]
Draw.MolsToGridImage(mols, molsPerRow=4, subImgSize=(200,200), legends=legends)
Figure 5: Structure from mol1 to mol5 .