schrodinger.application.livedesign.data_classes module

class schrodinger.application.livedesign.data_classes.LDData(data_name=None, family_name=None, user_name=None, requires_3d=False, requires_ffc=False)

Bases: schrodinger.models.json.JsonableClassMixin

Class for storing information about Maestro-level data that may be exported to LiveDesign. (Objects from this class should only store Maestro-level data, not LiveDesign data.)

Specifically, this class is not meant to store the values of the data to be exported, but rather to serve as a “view” to that data. It should:

  1. provide identifying information to the user about the data that is available for export (e.g. by providing user-friendly property names to tables and other view widgets), and

  2. provide an internal “pointer” to data to be exported (by uniquely identifying exactly what data should be exported, as selected by the user)

This class is meant to be general enough to store information about both structure property data and attachment data (e.g. 3D, images, files).

__init__(data_name=None, family_name=None, user_name=None, requires_3d=False, requires_ffc=False)

Instances representing structure properties should be initialized with the property data name (e.g. data_name="s_m_title").

If there is no data name, e.g. for image and attachment data, instances should be initialized with both the family name and the user name (e.g. “Atom Properties”, “Hot Atoms”).

If the family or user name is supplied along with the data name, these will be used for display purposes within the panel rather than the values derived from the data name.

Raises

ValueError – if insufficient information is supplied on initialization to fully specify a unique instance

property family_name

Return the family name if provided on initialization. Otherwise, determine family name from the data name.

Returns

family name for display

Return type

str

property user_name

Return the user name if provided on initialization. Otherwise, determine user name from the data name.

Returns

user name for display

Return type

str

property data_name

Return data name if provided on initialization.

Returns

data name or None

Return type

str or None

property requires_3d
Returns

whether the export of this data requires the export of 3D data

Return type

bool

property requires_ffc
Returns

whether this data needs to be export as a freeform column

Return type

bool

toJsonImplementation()

Abstract method that must be defined by all derived classes. Converts an instance of the derived class into a jsonifiable object.

Returns

A dict made up of JSON native datatypes or Jsonable objects. See the link below for a table of such types. https://docs.python.org/2/library/json.html#encoders-and-decoders

classmethod fromJsonImplementation(json_dict)

Abstract method that must be defined by all derived classes. Takes in a dictionary and constructs an instance of the derived class.

Parameters

json_dict (dict) – A dictionary loaded from a JSON string or file.

Returns

An instance of the derived class.

Return type

cls

classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

class schrodinger.application.livedesign.data_classes.ReceptorLigandPair(receptor=None, ligand=None)

Bases: object

Data class for storing a receptor structure and a ligand structure.

__init__(receptor=None, ligand=None)
class schrodinger.application.livedesign.data_classes.ReceptorLigandGroup(receptor=None, ligand=None, alt_ligand=None, add_rl_pairs=None)

Bases: object

Data class for unambiguously storing a group of receptor and ligand structures. In addition to the primary ligand, this class also supports storing an “alternate” ligand meant for 3D upload in place of the primary ligand and “additional” ligands meant for 3D upload in addition to the primary ligand.

The alternate ligand may have a distinct ligand pose, or it may have a different structure entirely. For example, the primary ligand may be a ligand after covalently binding to a receptor, and the alternate ligand may be the independent ligand molecule prior to complexing.

Each of these structures is optional; a ReceptorLigandGroup instance will not always need to contain a receptor and a ligand, or any other structures.

__init__(receptor=None, ligand=None, alt_ligand=None, add_rl_pairs=None)
Parameters
  • receptor (structure.Structure or None) – a receptor structure or None

  • ligand (structure.Structure or None) – a ligand structure or None

  • alt_ligand (structure.Structure or None) – extra structure data associated with the ligand, e.g. to be used as 3D data for certain LiveDesign uploads

  • add_rl_pairs (list(ReceptorLigandPair) or None) – additional ligand/receptor structures to be uploaded as 3D data in addition to the conventional (ligand or alternate ligand) 3D uploads

class schrodinger.application.livedesign.data_classes.ReceptorLigandMap

Bases: collections.defaultdict

A specialized dictionary for organizing receptor and ligand structures. Each key points to a list of receptor-ligand groups associated with that key. For convenience, this class also features several generators.

__init__()

Initialize as a list-based collections.defaultDict.

property num_rl_groups
Returns

the number of receptor-ligand groups stored in this object.

Return type

int

property rl_group_items
Returns

an iterator for (key, receptor-ligand group) pairs stored in this map. Note that each key can correspond to multiple receptor- ligand groups.

Return type

iterator((str, ReceptorLigandGroup))

property rl_groups
Returns

an iterator for receptor-ligand group objects stored in this map.

Return type

iterator(ReceptorLigandGroup)

property ligand_items
Returns

an iterator for (key, ligand) pairs stored in this map

Return type

iterator((str, structure.Structure))

property ligands
Returns

an iterator for ligand structures stored in this map

Return type

iterator(structure.Structure)

property alt_ligand_items
Returns

an iterator for (key, alternative ligand) pairs stored in this map

Return type

iterator((str, structure.Structure))

property alt_ligands
Returns

an iterator for alternative ligand structures stored in this map

Return type

iterator(structure.Structure)

property add_rl_pair_items
Returns

an iterator for (key, additional receptor-ligand pair) 2-tuples stored in this map

Return type

iterator((str, ReceptorLigandPair))

property add_rl_pairs
Returns

an iterator for additional receptor-ligand pairs stored on this map

Return type

iterator(ReceptorLigandPair)

property receptor_items
Returns

an iterator for (key, receptor) pairs stored in this map

Return type

iterator((str, structure.Structure))

property receptors
Returns

an iterator for receptor structures stored in this map

Return type

iterator(structure.Structure)

property structures
Returns

an iterator for all structures stored in this map

Return type

iterator(structure.Structure)

__contains__(key, /)

True if the dictionary has the specified key, else False.

__len__()

Return len(self).

clear() None.  Remove all items from D.
copy() a shallow copy of D.
default_factory

Factory for default value called by __missing__().

fromkeys(value=None, /)

Create a new dictionary with keys from iterable and values set to value.

get(key, default=None, /)

Return the value for key if key is in the dictionary, else default.

items() a set-like object providing a view on D’s items
keys() a set-like object providing a view on D’s keys
pop(k[, d]) v, remove specified key and return the corresponding value.

If key is not found, d is returned if given, otherwise KeyError is raised

popitem()

Remove and return a (key, value) pair as a 2-tuple.

Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.

setdefault(key, default=None, /)

Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.

update([E, ]**F) None.  Update D from dict/iterable E and F.

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values() an object providing a view on D’s values
schrodinger.application.livedesign.data_classes.get_long_family_name(short_family_name)

Given the short family name of a structure property (e.g. “m”), return the corresponding long family name (e.g. “Maestro”). If no long family name is defined, return the short family name argument.

Parameters
  • short_family_name – the short family name of a structure property

  • short_family_name – str

Returns

the corresponding long family name if one exists, otherwise the short family name

Return type

str