Skip to content

How to Visualize SDF files and Other Molecular File Formats§

Learn how to use OpenAD to visualize the contents of different molecular file formats in a convenient molecule grid.

Supported file formats are SDF, CSV, SMI and MOL.

Install OpenAD§

Find more detailed installation instructions here.

Bash
pip install openad

Note

To run this tutorial from a Jupyter Notebook, make sure to enable OpenAD magic commands and prepend every command with %openad.

Visualize Molecule Files§

You can also visualize a batch of molecules from a list or DataFrame or individually by identifier.

Let's start with downloading a sample for each of our supported file formats:

Now copy the files over to your workspace. Update the source paths if needed.

Bash
import from '~/Downloads/sample_molecules1.sdf' to 'sample_molecules1.sdf'
import from '~/Downloads/sample_molecules2.csv' to 'sample_molecules2.csv'
import from '~/Downloads/sample_molecules3.smi' to 'sample_molecules3.smi'
import from '~/Downloads/geraniol.mol' to 'geraniol.mol'

You should get a success message if they're copied over successfully. You can check by listing the files in your workspace:

Bash
list files

Next, you can simply open the files to see the molecules inside.

Bash
open 'sample_molecules1.sdf'
Bash
open 'sample_molecules2.csv'
Bash
open 'sample_molecules3.smi'
Bash
open 'geraniol.mol'

Visualizing an SDF file

This works both from the command line or from a Jupyter Notebook:

Bash
%openad open 'sample_molecules1.sdf'

Visualizing an SDF file

From here, you can open a molecule to see more details and a 3D visualization. You can even enrich a molecule by fetching data from PubChem.

Molecule detail

To learn how to combine molecules from different files and manipulate them together, you may want to learn about working with the molecule working set.

Continue Learning§

Want to learn more about how to work with small molecules in OpenAD?
Check out the other small molecule tutorials.