schrodinger.application.desmond.maestro module

A collection of numerous useful functions and classes for working with Maestro.

Copyright Schrodinger, LLC. All rights reserved.

schrodinger.application.desmond.maestro.get_atoms_from_uid(workspace_st, uid)
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.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.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.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.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.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.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.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.depreference_call(callback)
class schrodinger.application.desmond.maestro.NewEntry(ct)

Bases: object

A class for representing a structure that can be included/excluded in the Workspace.

last_entry_unique_id = 0
__init__(ct)
asl()
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.

set_deletable(deletable=True)

Sets this entry to be deletable if ‘deletable’ is True. If ‘deletable’ is False, sets this entry to be undeletable.

updateToWorkspace()
show()

Shows the CT in Maestro workspace.

show_only()

Shows the CT in Maestro workspace and hides other CTs.

hide()
is_shown()

Returns True if this entry is already included into the Workspace.

commit()

Commits any belonging change in the current workspace to this entry.

rename(name)

Changes the entry name to ‘name’.

get_ct(copy=False)

Returns a ‘Structure’ object of the CT of this entry.

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.

deleteAtomsByAsl(asl)
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.

__init__(structures, group_name=None)

Creates an entry group with a given list of CTs.

Parameters

struc – Must be list of schrodinger.structure.Structure 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.

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 of Entry objects.

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.

show()

Shows all entries in this group onto Maestro workspace if ‘should_show’ is True, hides them if it is False.

hide()
show_only()

Shows all entries in this group onto Maestro workspace and hides other entries.

commit()

Commits any belonging changes in the Workspace to their corresponding entries that are in this group.

get_ct(copy=False)

Returns a list of ‘Structure’ objects of the CTs of this group.

getWorkspaceEntry()

Return the entry that is currently in the Workspace. Or None.

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.

printStatus()
getAtomEntry(atom_obj)

Return the entry object (or None) that the given atom object is associated with.

class schrodinger.application.desmond.maestro.Workspace

Bases: object

A class for representing the Workspace.

__init__()

Does nothing.

show_entry(eid)
show_only_entry(eid)
grab()
paint_asl(asl, color)
paint_mol(i_mol, color)

Colors a molecule as given by the index of the molecule (‘i_mol’).

ball_atom(atom=[], asl='', should_ball=True)
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.

property ct

Readonly property: returns the workspace as a ‘Structure’ object.

commit()
get_atom(asl)

Returns a list of indices of atoms as selected by the ‘asl’.

create_atom_tag(tag, value=None)
delete_atom_tag(tag)
mark_atom(tag, value, atom=[], asl='')
schrodinger.application.desmond.maestro.ball_atom(st, atoms, should_ball=True)
schrodinger.application.desmond.maestro.paint_asl(st, asl, color)

Colors the selected atoms as given by ‘asl’.