schrodinger.application.desmond.maestro module¶
A collection of numerous useful functions and classes for working with Maestro.
Copyright Schrodinger, LLC. All rights reserved.
-
class
schrodinger.application.desmond.maestro.
NewEntry
(ct)¶ Bases:
object
A class for representing a structure that can be included/excluded in the Workspace.
-
asl
()¶
-
commit
()¶ Commits any belonging change in the current workspace to this entry.
-
deleteAtomsByAsl
(asl)¶
-
get_ct
(copy=False)¶ Returns a ‘Structure’ object of the CT of this entry.
-
hide
()¶
-
is_shown
()¶ Returns True if this entry is already included into the Workspace.
-
last_entry_unique_id
= 0¶
-
rename
(name)¶ Changes the entry name to ‘name’.
-
set_deletable
(deletable=True)¶ Sets this entry to be deletable if ‘deletable’ is True. If ‘deletable’ is False, sets this entry to be undeletable.
-
set_readonly
(readonly=True)¶ Sets this entry to be readonly if ‘readonly’ is True. If ‘readonly’ is False, sets this entry to be not readonly.
-
show
()¶ Shows the CT in Maestro workspace.
-
show_only
()¶ Shows the CT in Maestro workspace and hides other CTs.
-
updateToWorkspace
()¶
-
write
(fname, mode='')¶ Writes the CT to a file, whose name is given by ‘fname’. The format of the file is determined by the extension name of ‘fname’.
Parameters: mode – If set to ‘a’, then instead of overwriting, this function will append the structure to the end of the file.
-
-
class
schrodinger.application.desmond.maestro.
NewEntryGroup
(structures, group_name=None)¶ Bases:
object
A class for representing a group of Structures that can be included in or excluded from the Workspace as requested.
-
commit
()¶ Commits any belonging changes in the Workspace to their corresponding entries that are in this group.
-
delete
(entry)¶ Deletes one or more entries from the group.
Deletion happens only when the entry is in this entry group.
Parameters: entry – Can be either a single Entry
object or a list ofEntry
objects.
-
dtor
()¶ Deletes all entries in this entry-group.
-
duplicate
(entry)¶ Duplicates an entry, and the new copy will be put in this entry-group.
-
getAtomEntry
(atom_obj)¶ Return the entry object (or None) that the given atom object is associated with.
-
getWorkspaceEntry
()¶ Return the entry that is currently in the Workspace. Or None.
-
get_ct
(copy=False)¶ Returns a list of ‘Structure’ objects of the CTs of this group.
-
hide
()¶
-
is_shown
()¶ Returns True if all entries in this group are included into the Workspace, False otherwise.
-
is_shown_only
()¶ Returns True if all entries in this group and only entries in this group are included into the Workspace.
-
printStatus
()¶
-
show
()¶ Shows all entries in this group onto Maestro workspace if ‘should_show’ is True, hides them if it is False.
-
show_only
()¶ Shows all entries in this group onto Maestro workspace and hides other entries.
-
write
(fname, mode='')¶ Writes all CTs to a file, whose name is given by ‘fname’.
The format of the file is determined by the extensiion name of ‘fname’.
Parameters: mode – If set to ‘a’, then instead of overwriting this function will append the structure to the end of the file.
-
-
class
schrodinger.application.desmond.maestro.
Workspace
¶ Bases:
object
A class for representing the Workspace.
-
ball_atom
(atom=[], asl='', should_ball=True)¶
-
commit
()¶
-
create_atom_tag
(tag, value=None)¶
-
ct
¶ Readonly property: returns the workspace as a ‘Structure’ object.
-
delete_atom_tag
(tag)¶
-
display_asl
(asl, should_display=True)¶ Display the selected atoms (as given by the ASL expression ‘asl’) in the Workspace.
If ‘should_display’ is False, then the selected atoms will be undisplayed.
-
display_only_asl
(asl, should_display=True)¶ Similar to
display_asl
, but non-selected atoms will be hidden.If ‘should_display’ is False, then the selected atoms will be undisplayed without any effect on the non-selected atoms.
-
get_atom
(asl)¶ Returns a list of indices of atoms as selected by the ‘asl’.
-
grab
()¶
-
mark_atom
(tag, value, atom=[], asl='')¶
-
paint_asl
(asl, color)¶
-
paint_mol
(i_mol, color)¶ Colors a molecule as given by the index of the molecule (‘i_mol’).
-
show_entry
(eid)¶
-
show_only_entry
(eid)¶
-
-
schrodinger.application.desmond.maestro.
autoprojectsync_call
(callback)¶ Temporarily sets ‘projectsync’ preference to ‘auto’ before calling to ‘callback’. The original preference is recovered after calling to ‘callback’.
-
schrodinger.application.desmond.maestro.
ball_atom
(st, atoms, should_ball=True)¶
-
schrodinger.application.desmond.maestro.
begin_drawing
()¶ Turns on and initializes the drawing mechanism. This should be called before any ‘draw_*’ function is called.
-
schrodinger.application.desmond.maestro.
clean_drawing
()¶ Erases all drawings.
-
schrodinger.application.desmond.maestro.
create_atom_tag
(st, tag, value=None)¶ Creates one or more atom properties for all atoms in CT.
Parameters: - tag – The property name as a string or a list of property names in a list of strings.
- value – The value for the corresponding atom property. If ‘tag’ is a list, then ‘value’ should also be a list.
-
schrodinger.application.desmond.maestro.
depreference_call
(callback)¶
-
schrodinger.application.desmond.maestro.
draw_1_arrow
(atom_from, atom_to, color='green', radius=0.15, transparency=0.5, resolution=36)¶ Similar to
draw_arrow
. Draws only this arrow; the other arrows (if any) will be erased.
-
schrodinger.application.desmond.maestro.
draw_arrow
(atom_from, atom_to, color='green', radius=0.15, transparency=0.0, resolution=36)¶ Draws an arrowed line from ‘atom_from’ to ‘atom_to’.
Parameters: - atom_from – The source atom. Should be an atom index or
schrodinger.structure._StructureAtom
instance.’ Must be valid for the current state of the Workspace. - atom_to – The destination atom. Should be an atom index or
schrodinger.structure._StructureAtom
instance.’ Must be valid for the current state of the Workspace. - radius – The radius of the arrow in Angstroms.
- transparency – Transparency, in the range 0.0 (none) to 1.0 (invisible).
- resolution – Valid range of 4 to 50.
- atom_from – The source atom. Should be an atom index or
-
schrodinger.application.desmond.maestro.
duplicate_entry
(entry_id)¶ Makes a copy of an entry, and returns the ID of the copy entry (i.e., the new entry).
Parameters: entry_id – The ID of the entry to be copied. If this entry does not exist, nothing will be copied, and None will be returned.
-
schrodinger.application.desmond.maestro.
end_drawing
()¶ Turns off the drawing mechanism and cleans up.
This should be called after any drawing is actually done. Note that drawing is NOT done immediately after the call to a ‘draw_*’ function, it is delayed until the next round of update of the Workspace. This means if you call this function too early, your drawing will not be taken to the Workspace at all.
-
schrodinger.application.desmond.maestro.
get_atoms_from_uid
(workspace_st, uid)¶
-
schrodinger.application.desmond.maestro.
get_entry_id
(entry_name)¶ Returns the entry ID of the entry whose entry name being ‘entry_name’, or None if there is no such an entry.
Note that if there are more than one entries have the same name of ‘entry_name’, the entry id of the first one will be returned.
-
schrodinger.application.desmond.maestro.
get_entryname_prefix
(suggested_prefix='')¶ Returns a string to be used as a prefix of entry names so that the resulted entry name is guaranteed to be different from those existing at the time of getting this prefix.
Note a side-effect of this function: the row selection on the project table will be changed.
Parameters: suggested_prefix – A string from which the returned prefix will be derived.
-
schrodinger.application.desmond.maestro.
mark_atom
(st, tag, value, atom=[], asl='')¶ Sets value (given by the ‘value’ argument) to atom property (given by the ‘tag’ argument) for selected atoms in the CT.
The ‘tag’ and ‘value’ arguments can be lists, but they must be both lists or both not.
The selected atoms are given by the ‘atom’ argument or by an ASL expression (‘asl’). Either ‘atom’ or ‘asl’ should be provided; if both are provided, ‘asl’ will be ignored.
-
schrodinger.application.desmond.maestro.
noautofit_call
(callback)¶ Supresses autofit preference when calling to ‘callback’. The original preference is recovered after calling to ‘callback’. TODO: This function should be removed, if its functionality is really
needed, it should use the new autofit preferences, and it should be a context manager instead of a callback function
-
schrodinger.application.desmond.maestro.
nofitgrow_call
(callback)¶ Temporarily sets ‘fitgrow’ preference to ‘false’ before calling to ‘callback’. The original preference is recovered after calling to ‘callback’.
-
schrodinger.application.desmond.maestro.
paint_asl
(st, asl, color)¶ Colors the selected atoms as given by ‘asl’.