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.
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:
- SDF file: sample_molecules1.sdf
- CSV file: sample_molecules2.csv
- SMI file: sample_molecules3.smi
- MOL file: geraniol.mol
Now copy the files over to your workspace. Update the source paths if needed.
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:
Next, you can simply open the files to see the molecules inside.
This works both from the command line or from a Jupyter Notebook:
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.
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.