Core Views
A quick overview of all possible views within qcio
.
from qcio import ProgramOutput, view
# Defaults changed just to fit the examples within the narrow documentation layout
view.DEFAULT_WIDTH = 400
view.DEFAULT_HEIGHT = 300
xtb_opt = ProgramOutput.open("U1-_180_mmff94s-opt-xtb.json")
terachem_opt = ProgramOutput.open("U1-_mmff94s_180-opt-terachem-thf.json")
crest_confsearch = ProgramOutput.open("U1-_confsearch-crest.json")
Structure Views¶
Basic Structure¶
Pass in a structure to visualize it. If structure.ids.name
or structure.ids.smiles
is set this will be used automatically for a title. Subtitles can be passed manually.
view.view(
xtb_opt.input_data.structure,
subtitles=["My Awesome Subtitle"]
)
Pass view_2d=True
for a 2D image of the molecule.
view.view(
xtb_opt.input_data.structure,
view_2d=True,
subtitles=["My Awesome Subtitle"]
)
Multi-Structure¶
Pass multiple Structure
objects to view.view(...)
and it will create a grid of Structure
objects. Pass titles
and subtitles
as desired. show_indices=True
will display the indices for each atom.
view.view(
xtb_opt.input_data.structure, xtb_opt.results.final_structure,
titles=['Initial Structure', 'Final Structure'],
subtitles=["First Subtitle", "Second Subtitle"],
show_indices=True,
)
Overlay Structures¶
Set same_viewer=True
to overlay two (or more) Structure
objects in the same viewer.
view.view(
xtb_opt.input_data.structure, xtb_opt.results.final_structure,
same_viewer=True,
subtitles=["First and Last Structure"],
)
Animation¶
Pass one or more list of Structure
objects to view.view(...)
and each list will be animated. The .results.structures
objects passed belows are lists of Structure
.
view.view(
xtb_opt.results.structures, terachem_opt.results.structures,
titles=['xtb Opt', 'TeraChem Opt'],
subtitles=['Successful Trajectory', 'Failed Opt Trajectory'],
)
Program Output Views¶
Simply pass any ProgramOutput
object to view.view(...)
to see a visualization of the results.
Single Point Calculation¶
view.view(
xtb_opt.results.trajectory[0],
subtitles=["A Subtitle for the Structure"]
)
Optimization¶
May pass animate=False
if the animations are slowing down the browser.
view.view(
xtb_opt,
animate=True,
subtitles=["Some nice subtitle"],
titles_extra=["Optimization Trajectory"]
)
If you have too many molecule viewers or animations running and your browser is slowing down, pass view_2d=True
to any view to substitute a static 2D molecule image.
view.view(
xtb_opt,
animate=False,
view_2d=True,
)
Conformer Search¶
view.view(crest_confsearch)