Package schrodinger :: Package application :: Package desmond :: Module maestro
[hide private]
[frames] | no frames]

Module maestro

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

Copyright Schrodinger, LLC. All rights reserved.

Classes [hide private]
  NewEntry
A class for representing a structure that can be included/excluded in the Workspace.
  NewEntryGroup
A class for representing a group of Structures that can be included in or excluded from the Workspace as requested.
  Workspace
A class for representing the Workspace.
Functions [hide private]
 
get_atoms_from_uid(workspace_st, uid)
 
create_atom_tag(st, tag, value=None)
Creates one or more atom properties for all atoms in CT.
 
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.
 
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.
 
duplicate_entry(entry_id)
Makes a copy of an entry, and returns the ID of the copy entry (i.e., the new entry).
 
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.
 
_draw_arrow_callback()
A callback function to be registered by using schrodinger.maestro.workspace_draw_function_add.
 
begin_drawing()
Turns on and initializes the drawing mechanism.
 
end_drawing()
Turns off the drawing mechanism and cleans up.
 
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'.
 
draw_1_arrow(atom_from, atom_to, color='green', radius=0.15, transparency=0.5, resolution=36)
Similar to draw_arrow.
 
clean_drawing()
Erases all drawings.
 
noautofit_call(callback)
Supresses autofit preference when calling to 'callback'.
 
autoprojectsync_call(callback)
Temporarily sets 'projectsync' preference to 'auto' before calling to 'callback'.
 
nofitgrow_call(callback)
Temporarily sets 'fitgrow' preference to 'false' before calling to 'callback'.
 
depreference_call(callback)
 
_run()
 
ball_atom(st, atoms, should_ball=True)
 
paint_asl(st, asl, color)
Colors the selected atoms as given by 'asl'.
Variables [hide private]
  _version = '$Revision: 1.29 $'
  mae = None
hash(x)
  UNIQUE_ID_PROP = 'i_desmond_internal_entry_id'
  ARROW_GROUP = None
hash(x)
  ARROW_GROUP_refcount = 0
hash(x)
  __package__ = 'schrodinger.application.desmond'
Function Details [hide private]

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.

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.

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.

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.

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.

_draw_arrow_callback()

 

A callback function to be registered by using schrodinger.maestro.workspace_draw_function_add. The registration is done by the begin_drawing function below.

begin_drawing()

 

Turns on and initializes the drawing mechanism. This should be called before any 'draw_*' function is called.

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.

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.

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.

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

autoprojectsync_call(callback)

 

Temporarily sets 'projectsync' preference to 'auto' before calling to 'callback'. The original preference is recovered after calling to 'callback'.

nofitgrow_call(callback)

 

Temporarily sets 'fitgrow' preference to 'false' before calling to 'callback'. The original preference is recovered after calling to 'callback'.