Structure
Easily view and interact with any structure¶
from qcio import Structure, view
# Defaults changed just to fit within narrow documentation layout
view.DEFAULT_WIDTH = 400
view.DEFAULT_HEIGHT = 300
caffeine = Structure.from_smiles('CN1C=NC2=C1C(=O)N(C(=O)N2C)C')
view.view(caffeine)
Pass any number of objects (of any type) to view¶
serotonin = Structure.from_smiles("C1=CC2=C(C=C1O)C(=CN2)CCN")
dopamine = Structure.from_smiles("NCCc1cc(O)c(O)cc1")
view.view(serotonin, dopamine)
Titles are generated automatically from identifier information¶
serotonin.add_identifiers({"name": "Serotonin"})
dopamine.add_identifiers({"name": "Dopamine"})
view.view(serotonin, dopamine)
Or manually add titles or subtitles¶
epinephrine = Structure.from_smiles("CNC[C@H](O)c1ccc(O)c(O)c1")
glutamate = Structure.from_smiles("C(CC(=O)O)[C@@H](C(=O)[O-])N")
view.view(
epinephrine,
glutamate,
titles=["Good morning ☀️", "Glutamate 🧪"],
subtitles=["", f"Charge: {glutamate.charge} Multiplicity: {glutamate.multiplicity}"],
)