schrodinger.application.matsci.maestrocmds module¶
Common Maestro commands.
Copyright Schrodinger, LLC. All rights reserved.
- schrodinger.application.matsci.maestrocmds.get_colors(palette=None, seed=None, n_colors=10, normalized=False)¶
Return RGB color tuples.
- Parameters
palette (str) – if not a palette in PALETTES then this is the palette kwarg passed to seaborn.color_palette
seed (None or int) – if given randomize the RGB color tuples using the given seed
n_colors (int) – the number of colors to return
normalized (bool) – whether to normalize the RGB tuples
- Return type
list
- Returns
contains RGB color tuples
- schrodinger.application.matsci.maestrocmds.normalize_rgb_color(rgb)¶
Normalize the given color.
- Parameters
rgb (tuple) – an RGB triple of integers in [0, 255]
- Return type
tuple
- Returns
normalized RGB triple of floats in [0, 1]
- schrodinger.application.matsci.maestrocmds.get_atoms_asl(idxs)¶
Return the atoms ASL.
- Parameters
idxs (list(int)) – atom indices
- Return type
str
- Returns
the atoms ASL
- schrodinger.application.matsci.maestrocmds.execute_cmd(cmd)¶
Execute the Maestro command.
- Parameters
cmd (str) – the Maestro command
- schrodinger.application.matsci.maestrocmds.color_atoms(rgb, idxs)¶
Color atoms in the Maestro WS.
- Parameters
rgb (tuple) – an RGB triple of integers in [0, 255]
idxs (list(int)) – atom indices
- schrodinger.application.matsci.maestrocmds.color_atom_groups(all_idxs, rgbs=None)¶
Color groups of atoms in the Maestro WS.
- Parameters
all_idxs (list(list(int))) – groups of atom indices
rgbs (list(tuple) or None) – RGB triples of integers in [0, 255] for coloring the different groups of atoms, if None then some defaults colors are used
- schrodinger.application.matsci.maestrocmds.select_all_atoms()¶
Context manager to temporarily select all atoms in the Maestro WS.
- schrodinger.application.matsci.maestrocmds.select_atoms(index)¶
Select specified atoms in Maestro WS
- Parameters
index (list) – list of atom indexes
- schrodinger.application.matsci.maestrocmds.color_by_element()¶
Color all atoms in the Maestro WS by element.
- schrodinger.application.matsci.maestrocmds.set_ballnstick_repr(idxs)¶
Set the representation of atoms in the Maestro WS to ball-and-stick.
- Parameters
idxs (list(int)) – atom indices
- schrodinger.application.matsci.maestrocmds.set_included(entry_id)¶
Set the included entry to that of the given entry ID.
- Parameters
entry_id (str) – the entry ID
- schrodinger.application.matsci.maestrocmds.ensure_project_entry(struct, groupname, ptable=None, include_and_sort=False, sorting_prop=None)¶
Find if the structure entry exists in the project table’s group named groupname, if not create a new entry in this group. Then optionally sort the group and include/select the structure using the sorting property name.
- Parameters
struct (structure.Structure) – The structure to ensure is in the project
groupname (str) – The name of the group to add the structure to
ptable (project.Project) – The project table
include_and_sort (bool) – If True, include and select the entry and sort the PT group it is in by sorting_prop. Default is False.
sorting_prop (str) – The structure property name used to sort the entries
- Return type
- Returns
The project row for the entry
- schrodinger.application.matsci.maestrocmds.sort_group_include_row(groupname, row, sorting_prop, ptable=None)¶
Sort the given project group by iteration number and then select/include the given row
- Parameters
groupname (str) – The name of the group to sort
row (project.ProjectRow) – The project row of the entry to include
sorting_prop (str) – The property name used to sort the entries. If None, group sorting will be skipped.
ptable (project.Project) – The project table
- schrodinger.application.matsci.maestrocmds.add_miller_plane(hkl, vecs, scaled_vecs=None, min_plane=0, max_plane=1, color=(255, 0, 0), opacity=75, show_arrow=True, entry_id=None, origin=None, draw_location=0, thickness=1, also_draw_planes_behind=True)¶
Make plane and arrow graphics of a Miller plane and lattice vectors.
- Parameters
hkl (list[int]) – Miller triple hkl (example: [1,2,1])
vecs (list[float]) – Lattice vectors (A)
scaled_vecs (list[float]) – Scaled lattice vectors (A) that presumably fit all the planes. If not provide, vecs will be used. See related
any_polygons_outside_cell
functionmin_plane (int) – Minimum plane to draw
max_plane (int) – Minimum plane to draw
color (tuple[int]) – Plane color in RGB
opacity (float) – Plane opacity
show_arrow (bool) – Whether to show plane normal as an arrow
entry_id (str) – Project table entry ID, plane and arrow are associated with
origin (list[float]) – Origin (A)
draw_location (float) – Shift from the origin in dHKL units
thickness (float) – Thickness in the dHKL units
also_draw_planes_behind (bool) – Whether to draw planes behind the cell
- Return type
xtal.CrystalPlane, maestro.common.Group or None
- Returns
Plane and graphics or None on error
- schrodinger.application.matsci.maestrocmds.any_polygons_outside_cell(group)¶
Given a maestro graphics group, check if there are any polygons outside of it. This function is related to
add_miller_plane
above.- Parameters
group (maestro.common.Group) – Group to check
- Return type
bool
- Returns
Whether there are any polygons outside the cell
- schrodinger.application.matsci.maestrocmds.undoblock_cm(maestro)¶
Wrap between maestro
beginundoblock
andendundoblock
commands.- Parameters
maestro (maestro) – Maestro instance
- schrodinger.application.matsci.maestrocmds.delete_group(maestro, group_name, with_undo=True)¶
Delete group by name using maestro. Optionally provide undo functionality.
- Parameters
maestro (maestro) – Input maestro
group_name (str) – Group name
with_undo (bool) – Whether to wrap in undo block