nanome.beta.redis_interface module

class PluginInstanceRedisInterface(redis_host, redis_port, redis_password, redis_channel=None)[source]

Bases: object

Provides interface for publishing PluginInstance RPC requests over Redis.

The idea is to feel like you’re using the standard PluginInstance, but all calls are being made through Redis.

add_to_workspace(complex_list: List[nanome.api.structure.complex.Complex])[source]

Add a list of complexes to the current workspace.

apply_color_scheme(color_scheme: nanome.util.enums.ColorScheme, target: nanome.util.enums.ColorSchemeTarget, only_carbons: bool = False)[source]

Applies a color scheme to selected atoms.

center_on_structures(structures: Union[nanome.api.structure.complex.Complex, nanome.api.structure.molecule.Molecule, nanome.api.structure.chain.Chain, nanome.api.structure.residue.Residue, nanome.api.structure.atom.Atom, nanome.api.structure.bond.Bond])[source]

Repositions the workspace such that the provided structure(s) will be in the center of the world.

connect()[source]

Ping Redis, and then get data from plugin required for serialization.

create_writing_stream(indices_list: List[int], stream_type: nanome.util.enums.StreamType) → nanome.api.streams.stream.Stream[source]

Create a stream allowing the plugin to continuously update properties of many objects.

destroy_stream(stream: nanome.api.streams.stream.Stream)[source]

Delete an existing stream.

get_plugin_data() → dict[source]

Custom function to get data necessary for serialization from the remote plugin.

open_url(url: str, desktop_browser: bool = False) → None[source]

Open a URL in the user’s browser.

request_complex_list() → List[nanome.api.structure.complex.Complex][source]

Request the list of all complexes in the workspace, in shallow mode.

request_complexes(id_list: List[int]) → List[nanome.api.structure.complex.Complex][source]

Requests a list of complexes by their indices.

Complexes returned contains the full structure (atom/bond/residue/chain/molecule)

request_controller_transforms()[source]

Requests presenter controller info.

(head position, head rotation, left controller position, left controller rotation, right controller position, right controller rotation)

request_menu_transform(index: int)[source]

Requests spatial information of the plugin menu (position, rotation, scale).

request_presenter_info() → nanome.api.user.presenter_info.PresenterInfo[source]

Get info about the presenter.

request_workspace() → nanome.api.structure.workspace.Workspace[source]

Request the entire workspace, in deep mode

send_files_to_load(files_list: List[str]) → nanome.util.file.LoadInfoDone[source]

Send a molecular structure file (PDB, SDF, etc.) to the workspace to render.

send_notification(notification_type: nanome.util.enums.NotificationTypes, message: str)[source]

Send a notification to the user

set_menu_transform(index: int, position: nanome.util.vector3.Vector3, rotation: nanome.util.quaternion.Quaternion, scale: nanome.util.vector3.Vector3)[source]

Update the position, scale, and rotation of the menu.

update_content(*content) → None[source]

Update specific UI elements (button, slider, list…)

update_node(*nodes) → None[source]

Updates layout nodes and their children.

update_stream(stream: nanome.api.streams.stream.Stream, data: List[T])[source]

Feed new data into an existing stream.

update_structures_deep(struct_list: List[Union[nanome.api.structure.complex.Complex, nanome.api.structure.molecule.Molecule, nanome.api.structure.chain.Chain, nanome.api.structure.residue.Residue, nanome.api.structure.atom.Atom, nanome.api.structure.bond.Bond]])[source]

Update the specific molecular structures in the scene to match the structures in parameter.

Will also update descendent structures and can be used to remove descendent structures.

update_structures_shallow(structures: List[Union[nanome.api.structure.complex.Complex, nanome.api.structure.molecule.Molecule, nanome.api.structure.chain.Chain, nanome.api.structure.residue.Residue, nanome.api.structure.atom.Atom, nanome.api.structure.bond.Bond]])[source]

Update the specific molecular structures in the scene to match the structures in parameter.

Only updates the structure’s data, will not update children or other descendents.

upload_shapes(shape_list: List[nanome.api.shapes.shape.Shape])[source]

Upload a list of shapes to the server.

Arg:shape_list: List of shapes to upload.
Return type:list. List of shape IDs.
zoom_on_structures(structures: Union[nanome.api.structure.complex.Complex, nanome.api.structure.molecule.Molecule, nanome.api.structure.chain.Chain, nanome.api.structure.residue.Residue, nanome.api.structure.atom.Atom, nanome.api.structure.bond.Bond]) → None[source]

Repositions and resizes the workspace such that the provided structure(s) will be in the

center of the users view.