schrodinger.maestro.maestro module

Core functions for interaction with Maestro.

These allow Maestro to be controlled from Python scripts running in the embedded Maestro interpreter.

Copyright Schrodinger, LLC. All rights reserved.

NOTE: Any new function added to this file should be also added its test version in maestrointerface.py file.

exception schrodinger.maestro.maestro.MaestroCommand(*args)

Bases: Exception

Raises an Exception and is used whenever a command fails to execute.

__init__(*args)

See class comment

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

schrodinger.maestro.maestro.is_maestro_elements()

Return True if running Maestro Elements, False otherwise

schrodinger.maestro.maestro.set_prompt_mode_for_next_export(overwrite_prompt)
:param overwrite_prompt is a Boolean.
If True, then the prompt will be displayed if the file exists. If False, then no prompt is given and the file is simply overwritten. This only stays in effect for the next call to maestro.command(). After that, whether the command succeeded or not and whether or not entryexport was actually invoked as part of the commands, prompting is re-enabled.
schrodinger.maestro.maestro.suspend_view_updates()

A context manager used to manage turning on and off updating of the views in Maestro. This is typically used to control whether views are updated in response to commmands being issued:

with suspend_view_updates():
    maestro.command(cmd1)
    maestro.command(cmd2)
    maestro.command(cmd3)

The views in Maestro will only be updated following the processing of the final command.

schrodinger.maestro.maestro.command(keyword, *operands, **options)

Issues a command from a Python script to be executed by Maestro. See the Maestro Command Reference for available commands.

If the command execution fails, then a MaestroCommand exception is raised.

There are three ways to call this routine:

i) Pass a single string as an argument which simply executes the string as is.

or

ii) Pass a multi-line string (triple quoted) where each line contains a Maestro command which is executed as is.

or

iii) Allow this routine to assemble the arguments into a command string for you. If you choose this option, then the arguments must be in the following order: keyword, operand(s), option(s). See the Maestro Command Reference for details on keywords, operands and options.

schrodinger.maestro.maestro.redraw(changed_type=None)

Forces an immediate redraw of the main Maestro Workspace. All currently visible objects are redrawn. Unless the Workspace really needs to be redrawn immediately (i.e. while the script is running), the preferred method of redrawing the Workspace is to use redraw_request(). If some atoms have been changed in the main CT then changed_type can be used to indicate the nature of the change to the CT since the last draw. The value should be one of WORKSPACE_CHANGED-prefixed values listed at the top of the file.

schrodinger.maestro.maestro.redraw_request(changed_type=None)

Requests the main Maestro Workspace be redrawn. This is the preferred method of redrawing the Workspace. If the Workspace is to be redrawn when the script finishes running, use this command to avoid multiple and unnecessary redrawing of the main Workspace. If some atoms have been changed in the main CT then changed_type can be used to indicate the nature of the change to the CT since the last draw. The value should be one of WORKSPACE_CHANGED-prefixed values listed at the top of the file.

schrodinger.maestro.maestro.regenerate_markers()

Forces Maestro to update markers for distances, labels, etc. This should be done after atoms are moved in the structure returned by workspace_get().

schrodinger.maestro.maestro.update_surface_display()

Forces a redraw of displayed surfaces (mostly for included project entries) to reflect any changes. This should be done after modifying entry surfaces directly, without the use of maestro commands. A separate maestro redraw_request is not needed.

schrodinger.maestro.maestro.create_entry_from_workspace(entry_name='entry')

Creates a new Project Table entry from Workspace

schrodinger.maestro.maestro.workspace_get(copy=True)

Return a Structure object that contains all the atoms in the Maestro Workspace. Project table properties are not included.

For a description of basic concepts that clarify the relationship between the Workspace and Maestro Projects as well as when and how changes in one affect the other, please see the Basic Concepts section in the python tutorial. The Scripting with Python tutorial is part of the General documentation and can be accessed from within Maestro’s Help facility from the Manuals Index.

By default the ‘copy’ parameter is True and a copy of the structure corresponding to the Maestro Workspace is returned. If you want to actually make changes to the structure in the Workspace then use maestro.workspace_set() to update the Maestro Workspace (note that new molecules can not be added to the Workspace; to add molecules to an entry, use the ProjectRow.getStructure() and ProjectRow.setStructure() API).

You can also use maestro.workspace_get(copy=False) to get a Structure object that corresponds to the actual Maestro workspace. This was the behavior in versions before the 2008 release but this approach is no longer recommended.

When using copy=False, any change to the Workspace structure by Maestro may render your retrieved Structure instance invalid and further use may cause a core dump. The safest thing to do is assume that your Structure is only valid until the next Maestro command completes.

Also, when using copy=False any call to workspace_set() will render your structure invalid.

schrodinger.maestro.maestro.will_create_scratch_entry(st)

Return True if the given structure, when passed to mae_set_main_ct(), would cause scratch entries to be created. Scratch entries have been deprecated in Maestro, and cause annoyance to users, as their presense shows warning dialogs to pop-up asking them whether to add it to the PT or discard it.

Instead of calling workspace_set(), to add new molecules to the Workspace, use one of these methods:

  1. To create a new entry (replacing the Workspace):

    Project.importStructure(st_to_add, wsreplace=True)

  2. To create a new entry (appending to the Workspace):

    Project.importStructure(st_to_add).in_workspace = IN_WORKSPACE

  3. To append molecules to existing entry:

    entry = Project.getRow(entry_id) row_st = entry.getStructure() row_st.extend(st_to_add) entry.setStructure(row_st)

schrodinger.maestro.maestro.workspace_set(struct, regenerate_markers=True, copy=True, check_scratch_entry=True)

Sets the main Workspace connection table to the given Structure object. Structure properties are ignored.

For a description of basic concepts that clarify the relationship between the Workspace and Maestro Projects as well as when and how changes in one affect the other, please see the Basic Concepts section in the python tutorial. The Scripting with Python tutorial is part of the General documentation and can be accessed from within Maestro’s Help facility from the Manuals Index.

Setting regenerate_markers to True (default) will force Maestro to update markers for distances, labels, etc. and to apply any changes to the Workspace structure. It should be set to True in most circumstances.

Parameters:check_scratch_entry – True if ct structure needs to be validated for

scratch entries. will_create_scratch_entry() is an expensive call and should be avoided whenever caller knows that structure does not have scratch entries (like trajectory snapshot, trajectory playing). :type check_scratch_entry: bool

schrodinger.maestro.maestro.get_included_entry()

Returns a structure of the included entry with properties. Raises RuntimeError if no entries are included or if more than one entry is included. Returned Structure is a copy of the included entry. Scratch entries, if any, are ignored.

schrodinger.maestro.maestro.get_included_entries()

Returns a list of structure objects with properties for included entries. Will return an empty list if no entries are included. Returned structures are copies of the entry structures. If there are scratch entries in the Workspace, they will be returned last in the list.

schrodinger.maestro.maestro.get_included_entry_ids()

Return a set of entry ids for all structures in the workspace (including scratch entry)

Returns:Set of entry ids
Return type:set of str
schrodinger.maestro.maestro.is_function_registered(callback_type, func)

This returns whether a function has already been registered with a callback.

Parameters:
  • callback_type (str) – What callback you’re checking, these are the keys to the _callbacks dict.
  • func (A function) – The function you’re checked to see if it’s registered
Returns:

Is the function registered already?

Return type:

bool

schrodinger.maestro.maestro.workspace_draw_function_add(func)

Register a function to be called when the Workspace is redrawn. This is intended to support drawing of additional 3D graphics.

The Workspace is redrawn whenever a part of the drawing area is exposed or resized, or when Maestro changes the contents of the Workspace (different structures, markers, text, surfaces, etc.)

func: This argument is the client-supplied function to call.

A common way to do this is to have one function for creating the graphical objects you wish to draw and another to do the actual drawing

Example:

Calls from within Maestro would be like:

pythonrun workspace_graphics_sphere_centroid.create_centroid pythonrun workspace_graphics_sphere_centroid.add

where workspace_graphics_sphere_centroid is a .py file containing these two functions. The first one creates the object, the second one registers the drawing function by telling the maestro module about itself:

maestro.workspace_draw_function_add(my_draw_func)

To remove it have an additional function in your .py, something like remove() which tells the maestro module to remove the named function from the list of callback functions:

maestro.workspace_draw_function_remove(my_draw_func)

schrodinger.maestro.maestro.workspace_draw_function_remove(func)

Remove the named function so it is no longer called when the Workspace is redrawn.

Removing a non-existent function will cause an error.

For an example see the docstring for workspace_draw_function_add()

schrodinger.maestro.maestro.workspace_changed_function_add(callback_func)

Register a function to be called when the Workspace contents are changed in some way. The function registered should expect to receive a single string parameter - one of the following values which indicates what has changed for the workspace structure. You should check against the module-level constants that are provided. These start with WORKSPACE_CHANGED-prefixed. See top of module for more details.

This feature will usually be used in conjunction with a workspace drawing callback but it can be used for anytime a Python script needs to know that the contents of the workspace have changed.

Note that the state of the Project table is not defined during this callback if the callback was triggered by the inclusion or exclusion of an entry from the project. In other words you can’t reliably check on the inclusion state of an entry during this callback. Also you shouldn’t issue Maestro commands from the callback.

schrodinger.maestro.maestro.workspace_changed_function_remove(callback_func)

Remove the named function so it is no longer called when the Workspace is changed

Removing a non-existent function will cause an error.

schrodinger.maestro.maestro.rotation_points_add(rotation_center, points, changed_cb, removed_cb)

Add points which will be rotated around the rotation_center as the user rotates the Workspace using the mouse.

Parameters:
  • rotation_center (List of 3 floats) – The coordinates of the center of rotation.
  • points (List of 3-item lists.) – Coordinates that should be rotated around the center.
  • changed_cb (callable) – Function to be called as points are rotated. It will be called with a single argument: A list of new coordinates for all points: [[x0,y0,z0], [x1,y1,z1], ...]
  • removed_cb (callable) – Function to be called when the rotation mode was exited.
schrodinger.maestro.maestro.rotation_points_remove()

Removes the functions and points which were added with the rotation_points_add() function.

schrodinger.maestro.maestro.translation_points_add(points, changed_cb, removed_cb)

Add points which will be translated as the user translates the Workspace using the mouse.

Parameters:
  • points (List of 3-item lists.) – Model coordinates that should be translated, in the form: [ [x0, y0, z0], [x1, y1, z1], [x2, y2, z2], ... ]
  • changed_cb (callable) – Function to be called as points are translated. It will be called with a single argument: A list of new coordinates for all points: [[x0,y0,z0], [x1,y1,z1], ...]
  • removed_cb (callable) – Function to be called when the translation mode is exited.
schrodinger.maestro.maestro.translation_points_remove()

Removes the functions and points which were added with the translation_points_add() function.

schrodinger.maestro.maestro.get_model_coordinates(window_x, window_y)

Returns model coordinates corresponding to the given window coordinates Returns (x, y, z)

schrodinger.maestro.maestro.job_incorporation_function_add(callback_func)

Register a function to be called when a job is available to be incorporated. The function should expect to be called with two parameters. The first is the job ID (a string). The second is a Boolean which indicates if this is just a test of whether the Python script is prepared to handle the incorporation of the job. If this parameter is true, then the callback should only test whether it has the ability to incorporate the job, but not to do the actual job incorporation. This is done to support a feature that allows maestro to get user approval to incorporate jobs even though they are not being monitored. If the second parameter is false, then the callback should attempt to incorporate the job, if it can.

If the function is either prepared to handle the incorporation or is actually going to handle it then it should return maestro.WILL_HANDLE_JOB. If it is not able to handle it at this time then it should return maestro.NOT_INCORPORATABLE. If it is not going to handle the incorporation it should return maestro.NOT_MY_JOB

schrodinger.maestro.maestro.job_incorporation_function_remove(callback_func)

Remove the named function so it is no longer called when the a job is available to be incorporated

Removing a non-existent function will cause an error.

schrodinger.maestro.maestro.project_get()

Gets a handle to the currently open project. Note: this is the actual handle to the project and not a copy, so it should never be deleted from within a script. The handle can be operated on by mmproj_* interface routines, but there are higher-level interfaces available to perform many project operations and these are the preferred mechanisms for manipulating the Project Table data from a Python script.

schrodinger.maestro.maestro.project_table_get()

Creates an instance of a Project using the currently opened project.

schrodinger.maestro.maestro.project_table_update()

Forces a redraw of the Project Table to reflect any changes. This function may be called at anytime in order to update the Project Table after new properties or entries have been added.

schrodinger.maestro.maestro.project_table_synchronize()

Synchronizes the Workspace with the project according to the users’ synchronization preferences. Any changes in the Workspace will be saved in to the project. If the user has ‘Automatic’ set then this will be done silently. If they have ‘Prompt’ set then they will be prompted as to whether they want to synchronize. If ‘Manual’ then no synchronization will be done.

This function returns True if the synchronization took place, False if the user canceled it when prompted.

schrodinger.maestro.maestro.process_pending_events(wait_for_more_events=False)

Give some processor time to Maestro, for it to process pending events.

Parameters:wait_for_more_events (bool) – When True, WaitForMoreEvents flag is passed to QCoreApplication::processEvents, thus waiting for events if no pending events are available. This is False by default, i.e. the function returns control immediately.
schrodinger.maestro.maestro.picking_atom_start(help_string, callback_func, allow_locked_entries=False)
Parameters:help_string (string) – Displayed in the picking banner

:type callback_func : callable :type callback_func : Function called when an atom is picked

Parameters:allow_locked_entries (bool) – When True picking is permitted for locked

entries

Requests that atom picks are sent to the function callback_func. This must be a callable which expects to take a single integer parameter: the atom number of the picked atom. This atom number is appropriate for the CT handle returned from get_main_ct(). When picks are no longer needed, the script should call stop_picking().

Note: It is possible for a script to have the ability to receive picks if a panel in Maestro is activated for picking (picks can only go to one place at any given time). Scripts which use picking_atom_start() may also want to consider the use of maestro.picking_loss_notify() so they can be aware when the user has moved to another pick mode and their panel is no longer receiving picks from the workspace.

schrodinger.maestro.maestro.picking_bond_start(help_string, callback_func, allow_locked_entries=False)
Parameters:help_string (string) – Displayed in the picking banner

:type callback_func : callable :type callback_func : Function called when an atom is picked

Parameters:allow_locked_entries (bool) – When True picking is permitted for locked

entries

Requests that bond picks are sent to the function callback_func. This must be a callable which expects to take a two integer parameters: the atom numbers around the picked bond. The first atom corresponds to the atom nearest the half-bond picked. These atom numbers are appropriate for the CT handle returned from get_main_ct(). When picks are no longer needed, the script should call picking_stop(). Note: it is possible for a script to have the ability to receive picks if a panel in Maestro is activated for picking (picks can only go to one place at any given time). Scripts which use picking_bond_start() may also want to consider the use of maestro.picking_loss_notify() so they can be aware when the user has moved to another pick mode and their panel is no longer receiving picks from the workspace.

schrodinger.maestro.maestro.picking_stop()

Requests that picks no longer be sent to the callback function specified earlier with picking_atom_start(), picking_bond_start(), or picking_lasso_start(). This should be called whenever a script no longer needs to receive picks and must be called before a Tkinter-based interactive script terminates.

schrodinger.maestro.maestro.picking_loss_notify(callback_func)

Requests that if atom picks are no longer being sent to the function registered by maestro.picking_atom_start(), maestro.picking_bond_start(), or maestro.picking_lasso_start(), the specifed function will be called. This must be a callable which takes no parameters. This function must re-registed each time you turn on picking via maestro.picking_atom_start(), maestro.picking_bond_start(), or maestro.picking_lasso_start().

schrodinger.maestro.maestro.picking_lasso_start(help_string, callback_func, allow_locked_entries=False)

Requests that atom picks are sent to the function callback_func.

Parameters:
  • help_string – the text to be displayed in Maestro main window status bar, e.g., “Pick atom to delete”.
  • callback_func – the callable which expects to take an ASL expression, e.g., pick_atom_cb(self, asl). If a single atom is picked, the parameter ‘asl’ is something like “atom.num 15”. If a lasso selection is done, the parameter ‘asl’ is something like “at.n 5-8,15-18,1”. Atom numbers are appropriate for the CT handle returned from get_main_ct(), and they can be extracted by mmasl_parse_input() based on the CT handle and the ASL string. When picks are no longer needed, the script should call picking_stop().
  • allow_locked_entries (bool) – When True picking is permitted for locked

entries

Note: it is possible for a script to have the ability to receive picks if a panel in Maestro is activated for picking (picks can only go to one place at any given time).

Scripts which use picking_lasso_start() may also want to consider the use of maestro.picking_loss_notify() so they can be aware when the user has moved to another pick mode and their panel is no longer receiving picks from the workspace.

schrodinger.maestro.maestro.picking_lasso_object_start(help_string, callback_func)

Requests that graphics object picks are sent to the function callback_func.

Parameters:
  • help_string – the text to be displayed in Maestro main window status bar, e.g., “Pick object to delete”.
  • callback_func – the callable which expects to take either a single integer pick ID or a string containing multiple pick IDs separated by commas. When picks are no longer needed, the script should call picking_stop().

Note: it is possible for a script to have the ability to receive picks if a panel in Maestro is activated for picking (picks can only go to one place at any given time).

Scripts which use picking_lasso_object_start() may also want to consider the use of maestro.picking_loss_notify() so they can be aware when the user has moved to another pick mode and their panel is no longer receiving picks from the Workspace.

schrodinger.maestro.maestro.picking_asl_start(help_string, pickstate, callback_func, allow_locked_entries=False)

Requests that atom picks are sent to the function callback_func.

Parameters:
  • help_string – the text to be displayed in Maestro main window banner , e.g., “Pick atom to delete”.
  • pick_state – One of the pick states defined above - PICK_ATOMS, PICK_RESIDUES, PICK_MOLECULES etc.
  • callback_func – the callable which expects to take an ASL expression, e.g., pick_atom_cb(self, asl). If a single atom is picked, the parameter ‘asl’ is something like “atom.num 15”. If a lasso selection is done, the parameter ‘asl’ is something like “at.n 5-8,15-18,1”. Atom numbers are appropriate for the CT handle returned from get_main_ct(), and they can be extracted by mmasl_parse_input() based on the CT handle and the ASL string. When picks are no longer needed, the script should call picking_stop().
  • allow_locked_entries (bool) – When True picking is permitted for locked

entries

Note: it is possible for a script to have the ability to receive picks if a panel in Maestro is activated for picking (picks can only go to one place at any given time).

Scripts which use picking_asl_start() may also want to consider the use of maestro.picking_loss_notify() so they can be aware when the user has moved to another pick mode and their panel is no longer receiving picks from the workspace.

schrodinger.maestro.maestro.command_callback_add(callback_func)

Register a function that will be called each time a command is processed in Maestro.

This must be a callable which takes a single parameter - the text of the command processed.

schrodinger.maestro.maestro.command_callback_remove(callback_func)

Remove the named function so it is no longer called when a command is issued in Maestro

Removing a non-existent function will cause an error.

schrodinger.maestro.maestro.right_click_callback_add(callback_func)

Register a function to be called when the user makes a right-click in the Workspace. Note this will override any normal Maestro right-mouse features such as the built-in right-mouse menu.

This must be a callable which takes three parameters, the x and y positions of the mouse when clicked and the atom number of any atom under the mouse (or an invalid index if there’s no atom under the mouse). Use mm.mmct_valid_atom to determine if the index is valid.

schrodinger.maestro.maestro.right_click_callback_remove(callback_func)

Remove the named function so it is no longer called when a right-mouse click is done in Maestro.

Removing a non-existent function will cause an error.

schrodinger.maestro.maestro.level_of_detail_callback_add(callback_func)

Register a callback to be called when the level of detail in the Maestro Workspace changes. This is typically used for graphical representation like whether to show the bond orders.

The callback function takes no parameters.

schrodinger.maestro.maestro.level_of_detail_callback_remove(callback_func)

Remove the callback so it is no longer called when the level of detail in the Workspace changes.

Removing a non-existent function will cause an error.

schrodinger.maestro.maestro.project_close_callback_add(callback_func)

Register a function to be called when current project is about to be closed. This must be a callable which takes no parameters. If Python scripts want to cancel Maestro project closing operation, they should call Maestro function mae_project_close_cancel(). This function can be used for anytime a Python script needs to know that current project is about to be closed.

schrodinger.maestro.maestro.project_close_callback_remove(callback_func)

Remove the named function so it is no longer called when current project is about to be closed

Removing a non-existent function will cause an error.

schrodinger.maestro.maestro.project_rename_callback_add(callback_func)

Register a function to be called when current project is about to be renamed. This must be a callable which takes no parameters. This function can be used for anytime a Python script needs to know that current project is about to be renamed.

schrodinger.maestro.maestro.project_rename_callback_remove(callback_func)

Remove the named function so it is no longer called when current project is about to be renamed.

Removing a non-existent function will cause an error.

schrodinger.maestro.maestro.project_update_callback_add(callback_func)

Register a function to be called when current project is updated in some way. This might be because of changes in selection, inclusion or properties. The function must be a callable which takes no parameters.

schrodinger.maestro.maestro.project_update_callback_remove(callback_func)

Remove the named function so it is no longer called when current project is updated.

Removing a non-existent function will cause an error.

schrodinger.maestro.maestro.project_close_cancel()

Forces to cancel the processing of closing current project. This function may be called at the end of callback function from project_close_callback_add(), if the script doesn’t want to close current project. This might cause bad behavior if it’s done unconditionally.

schrodinger.maestro.maestro.workspace_bounding_box_function_add(func)

Register a function to be called when the bounding box for a fit to screen operation is being performed. This is intended to take into account python 3D graphics objects when fitting Maestro Workspace.

The Workspace fit to screen is required whenever new 3D graphics objects are added, or when Maestro changes the contents of the Workspace (different structures, markers, text, surfaces, etc.)

func: This argument is the client-supplied function to call.

A common way to do this is to have one function for creating the graphical objects you wish to draw and another to do the actual drawing

Example:

Calls from within Maestro would be like:

pythonrun workspace_graphics_sphere_centroid.create_centroid pythonrun workspace_graphics_sphere_centroid.add

where workspace_graphics_sphere_centroid is a .py file containing these two functions. The first one creates the object, the second one registers the bounding box function by telling the maestro module about itself:

maestro.workspace_bounding_box_function_add(my_bounding_box_func)

To remove it have an additional function in your .py, something like remove() which tells the maestro module to remove the named function from the list of callback functions:

maestro.workspace_bounding_box_function_remove(my_bounding_box_func)

schrodinger.maestro.maestro.workspace_bounding_box_function_remove(func)

Remove the named function so it is no longer called when the Workspace is fit to screen.

Removing a non-existent function will cause an error.

For an example see the docstring for workspace_bounding_box_function_add()

schrodinger.maestro.maestro.set_workspace_bounding_box(min1, min2, min3, min4, min5, min6, max1, max2, max3, max4, max5, max6)

Adds a Python function to be called each time the workspace bounding box callback function is called. The Python function passes the bounding box of Python 3D graphics objects to Maestro.

schrodinger.maestro.maestro.hover_callback_add(callback_func)

Adds a Python function to be called each time the mouse rests over an atom in the Workspace. This function should expect to receive a single parameter: the number of the atom which the mouse is currently resting over (or an invalid index if none—see mm.mmct_valid_atom). To remove the callback use hover_callback_remove() but note that this cannot be done from within a the callback function itself - in other words the hover callback cannot self-terminate.

schrodinger.maestro.maestro.hover_callback_remove(callback_func)

Removes a Python function from the list of functions to be called each time the mouse rests over an atom in the Workspace. This function must have been previously added with hover_callback_add(). Note that this function cannot be called from within the callback_func() itself, as this will cause Maestro to crash.

schrodinger.maestro.maestro.feedback_string_set(feedback_string)

Sets the string that appears in the status bar.

schrodinger.maestro.maestro.add_job_launch_log(job_name, log_string)

A python function that adds the given job launch info to the project’s annotation. The job name is passed as one of the argument so that we can selectively log job launches if necessary.

schrodinger.maestro.maestro.periodic_callback_add(callback_func)

Adds a Python function which is called periodically during Maestro’s operation (about 20 times a second). When the periodic task is no longer required, it should be removed with periodic_callback_remove(). NOTE: periodic_callback_remove() cannot be called from the callback_func() itself.

schrodinger.maestro.maestro.periodic_callback_remove(callback_func)

Removes a Python function being called periodically during Maestro’s operations. This function should have been previously added with periodic_callback_add(). NOTE: periodic_callback_remove() cannot be called from the callback_func() itself.

schrodinger.maestro.maestro.selected_atoms_get()

Gets a list of the numbers of the currently-selected atoms in the Workspace.

schrodinger.maestro.maestro.selected_atoms_get_asl()

Returns an ASL expression corresponding to the currently selected atoms in the Workspace. If there are no selected atoms in the workspace then None is returned.

schrodinger.maestro.maestro.selected_atoms_get_smarts()

Returns a SMARTS pattern for the currently selected Workspace atoms.

Raises ValueError if no atoms are selected, if selection is not continuous, or if more than 50 atoms are selected.

Returns:SMARTS pattern that would match the selected atoms.
Return type:str
schrodinger.maestro.maestro.get_command_option(command, option, item=None)

Gets the value of the option for the given command. If there is an error such as the command does not exist or the option does not exist, then empty string, “”, is returned. Note that this function may return None if fetching the option fails or if there’s a buffer overflow.

schrodinger.maestro.maestro.get_command_items(command)

Gets the names of the items currently associated with the given command. For example if the command is ‘set’ then the nmaes of all the currently defined sets will be returned.

schrodinger.maestro.maestro.get_current_command_item(command)

Gets the name of the currently selelected item associated with the given command. For example if the command is ‘set’ then it will be the name of the currently selected set. If no items are selected then None will be returned.

schrodinger.maestro.maestro.get_font_names()

Returns a list of names of available fonts for drawing in the Maestro workspace

schrodinger.maestro.maestro.create_single_line_text(text_to_draw, x, y, z, font_name='Sans Serif', r=1.0, g=1.0, b=1.0, a=1.0, font_size=14, is_bold=False, is_italic=False)

Draw text_to_draw string at position x, y, z in the 3D workspace.

This function replaces draw_string, using a graphics text object instead of a workspace drawing callback, but only draws a single line of text.

Parameters:
  • text_to_draw (str) – String to render.
  • x (float) – X coordinate (Angstroms)
  • y (float) – Y coordinate (Angstroms)
  • z (float) – Z coordinate (Angstroms)
  • font_name (str) – Font to be used (one returned by get_font_names())
  • r (float) – Red color component, range is 0.0 to 1.0
  • g (float) – Green color component, range is 0.0 to 1.0
  • b (float) – Blue color component, range is 0.0 to 1.0
  • a (float) – Alpha color component, range is 0.0 to 1.0
  • font_size (int) – Font pixel size
  • is_bold (bool) – Whether to use bold font
  • is_italic (bool) – Whether to use italic font
Return type:

int

Returns:

The handle of a Maestro text array object

schrodinger.maestro.maestro.create_single_line_z_buffered_text(text_to_draw, x, y, z, font_name='Sans Serif', r=1.0, g=1.0, b=1.0, a=1.0, font_size=14, is_bold=False, is_italic=False)

Draw text_to_draw string at position x, y, z in the 3D workspace.

This function replaces draw_string, using a graphics text object instead of a workspace drawing callback, but only draws a single line of text. This text is Z-buffered.

Parameters:
  • text_to_draw (str) – String to render.
  • x (float) – X coordinate (Angstroms)
  • y (float) – Y coordinate (Angstroms)
  • z (float) – Z coordinate (Angstroms)
  • font_name (str) – Font to be used (one returned by get_font_names())
  • r (float) – Red color component, range is 0.0 to 1.0
  • g (float) – Green color component, range is 0.0 to 1.0
  • b (float) – Blue color component, range is 0.0 to 1.0
  • a (float) – Alpha color component, range is 0.0 to 1.0
  • font_size (int) – Font pixel size
  • is_bold (bool) – Whether to use bold font
  • is_italic (bool) – Whether to use italic font
Return type:

int

Returns:

The handle of a Maestro text array object

schrodinger.maestro.maestro.create_multiline_text(text_to_draw, x, y, z, font_name='Sans Serif', r=1.0, g=1.0, b=1.0, a=1.0, font_size=14, is_bold=False, is_italic=False)

Draw text_to_draw string at position x, y, z in the 3D workspace.

This function replaces draw_string, using a graphics text object instead of a workspace drawing callback, and supports multi-line text with embedded newlines.

Parameters:
  • text_to_draw (str) – String to render.
  • x (float) – X coordinate (Angstroms)
  • y (float) – Y coordinate (Angstroms)
  • z (float) – Z coordinate (Angstroms)
  • font_name (str) – Font to be used (one returned by get_font_names())
  • r (float) – Red color component, range is 0.0 to 1.0
  • g (float) – Green color component, range is 0.0 to 1.0
  • b (float) – Blue color component, range is 0.0 to 1.0
  • a (float) – Alpha color component, range is 0.0 to 1.0
  • font_size (int) – Font pixel size
  • is_bold (bool) – Whether to use bold font
  • is_italic (bool) – Whether to use italic font
Return type:

int

Returns:

The handle of a Maestro text2 object

schrodinger.maestro.maestro.draw_string(text_to_draw, x, y, z, font_name='Sans Serif', r=1.0, g=1.0, b=1.0, a=1.0, font_size=14, is_bold=False, is_italic=False)

Draw text_to_draw string at position x, y, z in the 3D workspace.

This function would normally only be used in a workspace drawing callback, and is deprecated in favor of create_multiline_text or create_single_line_text.

Parameters:
  • text_to_draw (str) – String to render.
  • x (float) – X coordinate (Angstroms)
  • y (float) – Y coordinate (Angstroms)
  • z (float) – Z coordinate (Angstroms)
  • font_name (str) – Font to be used (one returned by get_font_names())
  • r (float) – Red color component, range is 0.0 to 1.0
  • g (float) – Green color component, range is 0.0 to 1.0
  • b (float) – Blue color component, range is 0.0 to 1.0
  • a (float) – Alpha color component, range is 0.0 to 1.0
  • font_size (int) – Font pixel size
  • is_bold (bool) – Whether to use bold font
  • is_italic (bool) – Whether to use italic font
schrodinger.maestro.maestro.draw_html_string(text_to_draw, x, y, z, is_transparent=True, xoffset=0.0, yoffset=0.0, adjustments=None, mode=0, use_default_font=True)

Draw a string (with optional html tags) at position x,y,z in the 3D workspace. Uses the default font.

Parameters:
  • text_to_draw – string to render. Can contain some limited html: <sub></sub> and <sup></sup> tags for sub- and super-scripts, respectively. Can also pass a non-formatted string (ie doesn’t require you have html tags in it)
  • x – double - X coordinate, Angstrom space
  • y – double - Y coordinate, Angstrom space
  • z – double - Z coordinate, Angstrom space
  • is_transparent – bool - when false will render a box around the text in the background color. When true, no box is rendered, i.e. the background is transparent. Default is true.
  • xoffset – float - X offset in pixels, from bottom left. Default = 0.0.
  • yoffset – float - Y offset in pixels, from bottom left Default = 0.0.
  • adjustments

    Set/list of which adjustments, if any, to apply. Default is None meaning no centerin is done and no offsets are applied. Values which can be placed into adjustments are:

    LABEL_CENTER_HORIZONTAL LABEL_CENTER_VERTICAL LABEL_USER_OFFSETS

    Centering, if any, is applied first. Then user offsets, if any, are applied.

  • mode – LABEL_DRAW draws the label and returns bounding box LABEL_BOUNDING_BOX only returns the bounding box The default is LABEL_DRAW.
  • use_default_font – bool indicating whether to use the default font or let the caller of this routine set the font. If the latter, then the caller must use MM_Font.useFont() or similar to set the font or the text won’t render.
Returns:

Bounding box list (indices precede value here only for informational purposes - they’re not part of the returned values):

0:left, 1:right, 2:bottom, 3:top, 4:near, 5:far

Or empty list if there was an error

This function would normally only be used in a workspace drawing callback.

schrodinger.maestro.maestro.create_atom_marker(atom, r, g, b, hr, hg, hb, highlight, icon=0, style=0)

Create a 2D atom marker.

Parameters:
  • atom – atom number
  • r – red color component, range is 0.0 to 1.0
  • g – green color component, range is 0.0 to 1.0
  • b – blue color component, range is 0.0 to 1.0
  • hr – highlight red color component, range is 0.0 to 1.0
  • hg – highlight green color component, range is 0.0 to 1.0
  • hb – highlight blue color component, range is 0.0 to 1.0
  • highlight – uses highlight color and line width or not, icon will drawn in highlight color
  • icon – is one of the GRAPHICS_ICON_* values listed at the top of the file.
  • style – is a style for atom markers either GRAPHICS_ATOM_MARKER_STYLE_STAR or GRAPHICS_ATOM_MARKER_STYLE_GENERAL
Returns:

handle of the marker, on error this function returns -1

schrodinger.maestro.maestro.create_atom_pair_marker(atom1, atom2, r, g, b, hr, hg, hb, highlight, text, icon=0)

Create a 2D atom pair marker.

Parameters:
  • atom1 – first atom number
  • atom2 – second atom number
  • r – red color component, range is 0.0 to 1.0
  • g – green color component, range is 0.0 to 1.0
  • b – blue color component, range is 0.0 to 1.0
  • hr – highlight red color component, range is 0.0 to 1.0
  • hg – highlight green color component, range is 0.0 to 1.0
  • hb – highlight blue color component, range is 0.0 to 1.0
  • highlight – uses highlight color and line width or not, icon and text will drawn in highlight color
  • text – draw text if it’s not NULL, if it’s drawn then icon is hidden
  • icon – one of the GRAPHICS_ICON values listed at the top of the file
Returns:

handle of the marker, on error this function returns -1

schrodinger.maestro.maestro.create_atom_triple_marker(atom1, atom2, atom3, r, g, b, hr, hg, hb, highlight, text, icon=0)

Create a 2D atom triple marker.

Parameters:
  • atom1 – first atom number
  • atom2 – second atom number
  • atom3 – third atom number
  • r – red color component, range is 0.0 to 1.0
  • g – green color component, range is 0.0 to 1.0
  • b – blue color component, range is 0.0 to 1.0
  • hr – highlight red color component, range is 0.0 to 1.0
  • hg – highlight green color component, range is 0.0 to 1.0
  • hb – highlight blue color component, range is 0.0 to 1.0
  • highlight – uses highlight color and line width or not, icon and text will drawn in highlight color
  • text – draw text if it’s not NULL, if it’s drawn then icon is hidden
  • icon – one of the GRAPHICS_ICON values listed at the top of the file
Returns:

handle of the marker, on error this function returns -1.

schrodinger.maestro.maestro.create_atom_quad_marker(atom1, atom2, atom3, atom4, r, g, b, hr, hg, hb, highlight, text, icon=0)

Create a 2D atom quad marker.

Parameters:
  • atom1 – is the first atom number
  • atom2 – is the second atom number
  • atom3 – is the third atom number
  • atom4 – is the fourth atom number
  • r – is the red color component, range is 0.0 to 1.0
  • g – is the green color component, range is 0.0 to 1.0
  • b – is the blue color component, range is 0.0 to 1.0
  • hr – is the highlight red color component, range is 0.0 to 1.0
  • hg – is the highlight green color component, range is 0.0 to 1.0
  • hb – is the highlight blue color component, range is 0.0 to 1.0
  • highlight – uses highlight color and line width or not, icon and text will drawn in highlight color
  • text – draw text if it’s not NULL, if it’s drawn then icon is hidden
  • icon – ne of the GRAPHICS_ICON values listed at the top of the file
Returns:

handle of the marker, on error this function returns -1.

schrodinger.maestro.maestro.get_temp_location()

Returns a path to a temporary directory which is likely to be writeable and will be removed when this Maestro session is finished. This would typically used when temporary files need to be created, for example if file conversion is required as part of a script workflow

schrodinger.maestro.maestro.rebuild_scripts_menu()

Rebuild the scripts menu (includes entries for both Knime Workflows and custom python scripts menus). This will re-read the scriptsx.mnu file from the user and common areas and display the contents in the Scripts menu.

schrodinger.maestro.maestro.write_entries_from_project(filename, which_entries, Htreatment=None, synchronize=True, append=False, props=True)

Write entries from the project to a file. The parameters to this method are:

Parameters:
  • filename (str) – the name of the file which to write these entries to. The suffix determines the format of the file using the same rules as Structure.write()
  • which_entries (str) – entries to write ‘All’, ‘Included’ or ‘Selected’
  • Htreatment (str) – If not None then hydrogens will be added to the structures before they are written to the file using the specified H-treatment. Allowed treatment names are: All-atom with Osp3/Nsp3-Lp, All-atom with No-Lp, Csp3 United-atom with S-Lp, Csp3 United-atom with No-Lp, All-atom with S-Lp, C sp2/sp3 United-atom with No-Lp, C sp2/sp3, N,O,S United-atom with No-Lp. The one you almost certainly want is ‘All-Atom with No-Lp’
  • synchronize (bool) – If True, first synchronize the Workspace with the project. It is recommended this be done.
  • append (bool) – If True, append to the specified file. If False, overwrite.
  • props (bool) – If True, CT-level properties should be written.

If synchronization was done and the Maestro user had ‘Prompt’ mode active then they may choose to cancel the operation. If they cancel then nothing will be written and this method will return False, otherwise it returns True.

schrodinger.maestro.maestro.tk_toplevel_add(toplevel_widget)

Notifies Maestro that a new Tk toplevel has been created and should be displayed and share event processing with Maestro itself. Note: this is the preferred way to run a Tkinter script from within Maestro and should be called instead of using the Tkinter.MainLoop() function.

schrodinger.maestro.maestro.tk_toplevel_remove(toplevel_widget)

Notifies Maestro that a Tk toplevel previously registered via tk_toplevel_add() no longer needs to be displayed or have events passed to it. Note: this function does not actually hide the toplevel widget. The script should call destroy() on the widget after remove_tk_toplevel() in order to hide the widget.

schrodinger.maestro.maestro.atom_selection_dialog(description, current_asl='', initial_pick_state=<sphinx.ext.autodoc.importer._MockObject object>)

Post the atom selection dialog. The user can make selections in that dialog and the resulting ASL string will be returned as a result of this function. If the user cancels then the empty string will be returned by this function. The description field is displayed in the upper section of the dialog to indicate to the user the purpose of displaying this dialog. The current_asl will be set in the dialog when it is first displayed and the user will be able to edit that in this dialog.

schrodinger.maestro.maestro.warning(message)

Post a Maestro warning dialog with an OK button. This displays the text specified in ‘message’ in the same dialog Maestro uses to display warnings/errors, ensuring a consistent look and feel.

schrodinger.maestro.maestro.info(message)

Post a Maestro informational dialog with an OK button. This displays the text specified in ‘message’ in the same dialog Maestro uses for displaying information, ensuring a consistent look and feel.

schrodinger.maestro.maestro.question(question, button1='OK', button2='Cancel')

Post a Maestro question dialog - the same dialog Maestro uses for displaying questions, ensuring a consistent look and feel.

Arguments are:
question: Question text button1: Defaults to OK, but you can pass in what you like button2: Defaults to Cancel, but you can pass in what you like

Returns: maestro.BUTTON1 or maestro.BUTTON2, depending on which button was pressed.

schrodinger.maestro.maestro.invoke_picking_loss_callback()

Notify the current pick widget that it lost its picking rights. Note that this function will not stop the picking itself.

schrodinger.maestro.maestro.get_directory(which_directory, preferences_file_name='')

Return the full path for the specified directory. If which_directory is valid but it cannot, it raises a StandardError.

Parameters:
  • which_directory – specifies the directory to get back.
  • preferences_file_name – only applies when PREFERENCES is specified. In the PREFERENCES case if preferences_file_name is not specified, then just the absolute path to the preferences directory is returned. This is the default. If preferences_file_name is specified, then return a string which is the preferences dir + directory separator + preferences_file_name.

Valid values for which_directory are defined at the top of this module and are:

PREFERENCES - Maestro preferences (for this version of Maestro) TEMPORARY_DATA - Temporary data directory TEMPORARY_PROJECTS - Directory where temporary (scratch) projects are put

If an invalid which_directory is specified, then a ValueError is thrown.

schrodinger.maestro.maestro.workspace_get_coordinate_center()

Returns a list of three floats representing the current Workspace center of rotation.

schrodinger.maestro.maestro.workspace_get_translation()

Returns a list of three floats representing the current Workspace translation vector

schrodinger.maestro.maestro.workspace_get_viewing_volume()

Returns a list of six floats representing the current Workspace viewing volume

schrodinger.maestro.maestro.workspace_get_view_matrix()

Returns a list of 16 floats representing the current view matrix. Note that the final column of the matrix is always 0.0 as this doesn’t actually include the translation - for that see workspace_get_translation()

Also note that this matrix is returned in OpenGL order meaning it is column major notation.

schrodinger.maestro.maestro.workspace_get_view_matrix_inverse()

Returns a list of 16 floats representing the current inverse view matrix. Note that the final column of the matrix is always 0.0 as this doesn’t actually include the translation - for that see workspace_get_translation()

schrodinger.maestro.maestro.workspace_get_view_matrix_inverse_no_center()

Returns a list of 16 floats representing the current inverse view matrix with no center. Note that the final column of the matrix is always 0.0 as this doesn’t actually include the translation - for that see workspace_get_translation()

schrodinger.maestro.maestro.reset_workspace_transformations()

Reset the current Workspace transformations

schrodinger.maestro.maestro.workspace_get_size_and_scale()

Return a tuple of width, height, scale

width: width of the Workspace drawing area in pixels

height: height of the Workspace drawing area in pixels

scale: ratio of window to world space. The ratio is calculated for the width and for the height. The the smaller of these is returned (as this is what Maestro uses).

schrodinger.maestro.maestro.create_cone(x0, y0, z0, x1, y1, z1, r, g, b, radius, opacity, resolution)

Return the handle of a Maestro cone object using the given data

schrodinger.maestro.maestro.create_cylinder(x0, y0, z0, x1, y1, z1, r, g, b, radius, opacity, resolution, remove_endcaps=False)

Return the handle of a Maestro cylinder object using the given data

schrodinger.maestro.maestro.create_sphere(x, y, z, r, g, b, radius, opacity, resolution, angle_dep_transparency=False)

Return the handle of a Maestro sphere object using the given data

schrodinger.maestro.maestro.set_glow_color(handle, r, g, b)

Set glow color on a graphics object.

schrodinger.maestro.maestro.set_is_glowing(handle, flag)

Set glowing flag on a graphics object.

schrodinger.maestro.maestro.create_torus(x0, y0, z0, x1, y1, z1, r, g, b, radius, tube_radius, opacity, u_resolution, v_resolution)

Return the handle of a Maestro torus object using the given data

schrodinger.maestro.maestro.create_model_xyz_axes(cx, cy, cz, lx, ly, lz, r, g, b)

Return the handle of a Maestro xyz axes object using the given data

schrodinger.maestro.maestro.create_polyhedron(vertices, faces, normals, r, g, b, opacity, style)

Return the handle of a Maestro polyhedron object using the given data

schrodinger.maestro.maestro.set_polyhedron_style(polyhedron, style)

Set the polyhedron style to either LINE or FILL

Parameters:
  • polyhedron – A handle to a Maestro polyhedron, returned from create_polyhedron()
  • style (Choice, FILL or LINE) – Whether to fill the polyhedron in or to leave it as lines connecting vertices.
schrodinger.maestro.maestro.create_polygon(vertices, r, g, b, opacity)

Return the handle of a Maestro polygon object using the given data

schrodinger.maestro.maestro.create_parallelepiped(parallelepiped, r, g, b, line_width=1.0, style=0)

Return the handle of a Maestro parallelepiped object using the given data

Parameters:
  • parallelepiped (maestro_ui.MM_GraphicsParallelepiped) – The parallelepiped data to use to create the Maestro object
  • r (float) – The red component of the color for the parallelepiped, in the range 0 to 1.
  • g (float) – The green component of the color for the parallelepiped, in the range 0 to 1.
  • b (float) – The blue component of the color for the parallelepiped, in the range 0 to 1.
  • line_width (float) – The line width to use to draw the parallelepiped, > 0.
  • style (int) – The line style to use to draw the parallelepiped. 0 is solid, 1 is short dashed lines, and 2 is dashed cylinders
schrodinger.maestro.maestro.create_lines(segments, r, g, b, line_width=1.0, style=0)

Return the handle of a Maestro graphics object containing the given line segments

Parameters:
  • segments ([ maestro_ui.MM_GraphicsLineSegment ]) – The line segments to use to create the Maestro object
  • r (float) – The red component of the color for the segments, in the range 0 to 1.
  • g (float) – The green component of the color for the segments, in the range 0 to 1.
  • b (float) – The blue component of the color for the segments, in the range 0 to 1.
  • line_width (float) – The line width to use to draw the segments, > 0.
  • style (int) – The line style to use to draw the segments. 0 is solid, 1 is short dashed lines, and 2 is dashed cylinders
schrodinger.maestro.maestro.hide_object(handle)

Hide the 3D graphics object in Maestro with the given handle

schrodinger.maestro.maestro.show_object(handle)

Show the 3D graphics object in Maestro with the given handle

schrodinger.maestro.maestro.remove_object(handle)

Remove the 3D graphics object in Maestro with the given handle

schrodinger.maestro.maestro.set_coords(handle, x, y, z)

Set the coordinates (centroid) for the given handle

schrodinger.maestro.maestro.set_coords1(handle, x, y, z)

Set the coordinates for the given handle. Used for cylinders and cones.

schrodinger.maestro.maestro.set_coords2(handle, x, y, z)

Set the other coordinates for the given handle. Used for cylinders and cones.

schrodinger.maestro.maestro.set_colors(handle, r, g, b, alpha)

Set the colors for the given handle

schrodinger.maestro.maestro.set_radius(handle, radius)

Set the radius for the given handle

schrodinger.maestro.maestro.set_material(handle, material)

Set the material for the given handle

schrodinger.maestro.maestro.set_pick_id(handle, id)

Set the picking ID for the given handle.

Parameters:id (int or NoneType) – Pick id. None disables picking.
schrodinger.maestro.maestro.set_persistent_name(handle, name)

Set the persistent name for the given handle.

schrodinger.maestro.maestro.set_entry_id(handle, id)
schrodinger.maestro.maestro.set_pick_category(handle, pick_category)

Set the picking category for the given handle. pick_category should be a string containing the category to pick (e.g. <script name>_spheres)

schrodinger.maestro.maestro.start_picking(help, callback_func, pick_category)

Start picking items in the picking category.

Parameters:pick_category (str) – A picking category defined in mm_graphicspick.cxx string_pick_map.
schrodinger.maestro.maestro.stop_picking()

Stop picking

schrodinger.maestro.maestro.get_ligand_asl()

:deprecated maestro now uses the ligand keyword

schrodinger.maestro.maestro.set_project_command(name, command)

Sets a command to add to the project-open command script when the project is closed, or when a saved project scene is re-applied. :param name is typically the name of the invoking script :param command is a single Maestro command

schrodinger.maestro.maestro.append_project_command(name, command)

Appends the given command to the set of commands to add to the project-open command script when the project is closed or project scene is re-applied. :param name is typically the name of the invoking script :param command is a single Maestro command

schrodinger.maestro.maestro.delete_project_commands(name)

Deletes all of the project commands associated with the given name. :param name is typically the name of the invoking script

schrodinger.maestro.maestro.get_maestro_toplevel_window()

Returns the maestro top level window from the list of available top level windows in the maestro application. The exact window returned depends on whether docking is enabled or not.

schrodinger.maestro.maestro.set_docking_configuration(w, dockable, dock_area=2)
Parameters:
  • w (QWidget) – Widget for which we need to set the docking configuration
  • dockable (bool) – Whether or not this widget is dockable
  • dock_area (Qt.QFlags) – Area where the widget is to be docked (if it is dockable)

This routine takes the specified widget and configures the widget docking settings based on Maestro’s preferences and whether the widget itself is dockable.

schrodinger.maestro.maestro.raise_main_window()

Raises the Maesto main window to the top of the parent widget’s stack This function is used mainly by the python scripts which operates directly in Maestro workspace, so that maestro mainwindow is visible and stays on the top of the widget stack

At present, this function is uncallable. Fix it, define getMaestroTopLevelWindow and remove the first line of the function

schrodinger.maestro.maestro.show_docking_panels_window()

Show the Docking Panels window. There can be cases where we’ve added widgets to this panel, but it isn’t visible and we want it to be visible.

schrodinger.maestro.maestro.sendemail(from_addr, to_addr, server, port, security, message, passwd='', debug=False)

Try to send an email.

Parameters:
  • from_addr (str) – The From Email address
  • to_addr (str) – The address to which we are sending
  • server (str) – SMTP server. Only supports SMTP.
  • port (int) – Port to which we will attach
  • security (str) – What type of security if any. Valid values are: none, starttls, ssltls.
  • message (str) – Body of the message to send.
  • passwd (str) – Password. If blank, then assumes no login is needed.
  • debug (bool) – If True, debugging is printed.

:return nothing

schrodinger.maestro.maestro.get_job_status_color(job_status)

Access the color associated with a particular job status in the job monitor panel.

Parameters:job_status (str) – The job status as used in job records.

:return the color associated with this job_status as a hex triplet #XXXXXX

schrodinger.maestro.maestro.get_jobs(view_name, current_project_only)

Get a list of current job names, job ids and job statuses known to Maestro.

Parameters:
  • view_name (str) – Only return jobs matching this ‘viewname’
  • current_project_only (bool) – If true restrict list to jobs associated with the currently open project
:return a tuple consisting of a boolean which will be true for success,
false for error, a list of job names, a list of job ids and a list of job statuses.
schrodinger.maestro.maestro.job_started(job_id)

Notify Maestro job monitoring that a job has been started.

Parameters:job_id (str) – The job id returned from mmjob when the job was launched
schrodinger.maestro.maestro.tabify_docking_window(panel_name)
Parameters:panel_name – Panel which needs to be docked under tab if there are existing docked panels.
schrodinger.maestro.maestro.get_main_window()

Gets main window instance

Return type:QMainWindow
Returns:instance for Maestro’s main window
Raises:Exception if maestro main window not found
schrodinger.maestro.maestro.ignore_workspace_changed(callback_func)

A decorator for ignoring workspace changes. Note: This will only work to ignore class-methods and global methods. Instance-methods will need to use the context manager IgnoreWorkspaceChanged.

Example:

@maestro.ignore_workspace_changed(MyClass.my_ws_changed):
def my_func():
    #Any WS changes inside this function won't trigger my_ws_changed,
    #even if it's been registered with workspace_changed_function_add
schrodinger.maestro.maestro.ignore_project_close(callback_func)

See ignore_workspace_changed for docs/example

schrodinger.maestro.maestro.ignore_project_update(callback_func)

See ignore_workspace_changed for docs/example

class schrodinger.maestro.maestro.IgnoreWorkspaceChanged(callback_func)

Bases: schrodinger.maestro.maestro._IgnoreCallback

Context manager to ignore Workspace Changed callbacks.

Example:

maestro.workspace_changed_function_add(self.my_ws_changed)
with maestro.IgnoreWorkspaceChanged(self.my_ws_changed):
    #WS changes in this block won't trigger self.my_ws_changed
#Outside of the block WS changes will again call self.my_ws_changed
__init__(callback_func)

See _IgnoreCallback.__init__

class schrodinger.maestro.maestro.IgnoreProjectClose(callback_func)

Bases: schrodinger.maestro.maestro._IgnoreCallback

See IgnoreWorkspaceChanged for docs/example.

__init__(callback_func)
Parameters:
  • callback_type (str) – What callback you’re working with, these are the keys to the _callbacks dict.
  • callback_func (A function) – The method we want to disconnect (if connected) from the given callback
class schrodinger.maestro.maestro.IgnoreProjectUpdate(callback_func)

Bases: schrodinger.maestro.maestro._IgnoreCallback

See IgnoreWorkspaceChanged for docs/example.

__init__(callback_func)
Parameters:
  • callback_type (str) – What callback you’re working with, these are the keys to the _callbacks dict.
  • callback_func (A function) – The method we want to disconnect (if connected) from the given callback
schrodinger.maestro.maestro.get_entry_structure_image(entry_id, width, height)

Returns 2D structure QImage for specified entry ID.

Parameters:
  • entry_id (str) – Entry ID.
  • width (int) – Image width.
  • height (int) – Image height.
Returns:

2D structure image of the specified entry, or None if the image could not be created.

Return type:

QImage or NoneType

schrodinger.maestro.maestro.get_growth_space()

Returns the growth space from Maestro. This function assumes that the growth space has already been created through maestro.command(“creategrowthspace”)

This growth space will not include any of the solvent-accessible spheres. See get_solvent_accessible_growth_space()

Returns:A list of spheres, with each sphere being a list:

[x, y, z, radius] :rtype: list

schrodinger.maestro.maestro.get_solvent_accessible_growth_space()

Returns the solvent-accessible growth space from Maestro. This function assumes that the growth space has already been created through maestro.command(“creategrowthspace”)

This growth space will not include any spheres which are not solvent-accessible. See get_growth_space()

Returns:A list of spheres, with each sphere being a list:

[x, y, z, radius] :rtype: list

schrodinger.maestro.maestro.get_growth_space_sphere(sphere_id)

Returns the growth space sphere corresponding to the given id from Maestro. This function assumes that the growth space has already been created through maestro.command(“creategrowthspace”)

Parameters:sphere_id – The pick ID returned from maestro.start_picking()
Returns:The sphere as a list:

[x, y, z, radius] :rtype: list

schrodinger.maestro.maestro.get_entry_2d_tooltip(entry_id, row)

Returns a row column tooltip for specified entry ID that includes 2D structure image. The row argument is used to generate a tooltip string in case the image could not be created.

Parameters:
  • entry_id (str) – Entry ID.
  • row – Project table row.
Returns:

Tooltip expressed as rich text string.

Return type:

str

schrodinger.maestro.maestro.set_rightclick_on_pick_category(pick_category, pymodule, pyfunc)

Set a right click handler on a specified pick category. When user right clicks on any graphics object which belongs from given pick category, a python function of a given module is called.

Parameters:
  • pick_category (str) – Pick category of graphics objects.
  • pymodule (str) – Python module name.
  • pyfunc (str) – Python function name.
schrodinger.maestro.maestro.workspace_transform_local_scope(local_asl)

Utility function for panels that use the Maestro command ‘transform scope=local’, which works operates on Workspace selection.

See PANEL-8273 for details.

Parameters:local_asl (str) – ASL defining the local scope for the transform