Visualize the Chemical Space
ChemPlot can generate two types of plots for a given chemical space: static and interactive.
For the following examples we will use the BBBP (blood-brain barrier penetration) dataset 1.
from chemplot import Plotter, load_data
data = load_data("BBBP")
cp = Plotter.from_smiles(data["smiles"], target=data["target"], target_type="C")
Static Plot
To generate a static plot first reduce the dimensions of the molecules used to
initialize the Plotter
instance. Then you can use visualize_plot()
to generate a static visualization of the chemical space.
import matplotlib.pyplot as plt
cp.tsne()
cp.visualize_plot()
Interactive Plot
To generate an interactive plot first reduce the dimensions of the molecules used to
initialize the Plotter
instance. Then you can use interactive_plot()
to generate an interactive visualization of the chemical space.
cp.interactive_plot(show_plot=True)