schrodinger.models.jsonable module¶
A module for defining jsonable versions of classes (typically classes defined in third-party modules).
You can also find the registry of classes that are supported by the load(s) and
dump(s) functions in schrodinger.model.json
. Any object that is an instance
of one of the registered classes will be automatically jsonable using dump
and dumps
. To deserialize, you must specify the registered class to
load
or loads
. Example:
from schrodinger.models import json
my_set = set(range(1,2,3))
my_set_jsonstr = json.dumps(my_set)
new_set = json.loads(my_set_jsonstr, DataClass=set)
assert new_set == my_set
assert isinstance(new_set, set)
- Currently registered DataClasses:
- structure.Structure
- set
- tuple
- rdkit.Chem.rdchem.Mol
-
class
schrodinger.models.jsonable.
JsonableSet
¶ Bases:
schrodinger.models.json.JsonableClassMixin
,set
-
ENCODING_KEY
= '_python_set_'¶
-
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_list)¶ 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. :rtype : cls
-
copy
()¶ Return a shallow copy of a set.
-
__contains__
()¶ x.__contains__(y) <==> y in x.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
__len__
¶ Return len(self).
-
add
()¶ Add an element to a set.
This has no effect if the element is already present.
-
clear
()¶ Remove all elements from this set.
-
difference
()¶ Return the difference of two or more sets as a new set.
(i.e. all elements that are in this set but not the others.)
-
difference_update
()¶ Remove all elements of another set from this set.
-
discard
()¶ Remove an element from a set if it is a member.
If the element is not a member, do nothing.
-
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. :rtype : 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.
-
intersection
()¶ Return the intersection of two sets as a new set.
(i.e. all elements that are in both sets.)
-
intersection_update
()¶ Update a set with the intersection of itself and another.
-
isdisjoint
()¶ Return True if two sets have a null intersection.
-
issubset
()¶ Report whether another set contains this set.
-
issuperset
()¶ Report whether this set contains another set.
-
pop
()¶ Remove and return an arbitrary set element. Raises KeyError if the set is empty.
-
remove
()¶ Remove an element from a set; it must be a member.
If the element is not a member, raise a KeyError.
-
symmetric_difference
()¶ Return the symmetric difference of two sets as a new set.
(i.e. all elements that are in exactly one of the sets.)
-
symmetric_difference_update
()¶ Update a set with the symmetric difference of itself and another.
-
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
-
union
()¶ Return the union of sets as a new set.
(i.e. all elements that are in either set.)
-
update
()¶ Update a set with the union of itself and others.
-
-
class
schrodinger.models.jsonable.
JsonableStructure
(handle, error_handler=None)¶ Bases:
schrodinger.models.json.JsonableClassMixin
,schrodinger.structure._structure.Structure
-
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_str)¶ 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. :rtype : cls
-
__init__
(handle, error_handler=None)¶ Initialize an object with an existing MMCT handle or a C++ Structure object.
-
addAtom
(element, x, y, z, color=None, atom_type=None)¶ Add a new atom to the structure. Return the created
_StructureAtom
object.
-
addAtoms
(num_atoms)¶ Add the specified number of atoms to this structure.
The following atom attributes will have to be set for each atom afterwards:
element
x
,y
,z
color
atom_type
-
addBond
(atom1, atom2, bond_type)¶ Add a bond of the specified type between the two atoms atom1 and atom2. The atom parameters can be
_StructureAtom
objects or integer indices from 1 to the number of atoms in the structure. If the two atoms are already bound then the bond type is just changed.:param bond_type bond type (legacy integer 0-3 bond order)
-
addBonds
(bonds_list)¶ Add multiple bonds to this structure. This is much faster than multiple calls to addBond() method when many bonds need to be added. Bonds are specified by a list of integer lists: (atom1, atom2, bond_type).
- Example::
- st.addBonds([(10, 11, 1), (12, 13, 2)])
This will add a single-order bond between atoms 10 and 11, and a double-order bond between atoms 12 and 13.
-
adjust
(value, atom1, atom2, atom3=None, atom4=None)¶ Adjust a distance, angle or dihedral angle. If atom3 is None then the distance between atom1 and atom2 will be set to value, atom2 and all atoms attached to that atom will be moved. If atom4 is None then the angle between atom1, atom2 and atom3 will set to value, atom3 and all other atoms attached to that will be moved. If all atoms are specified then the dihedral angle made by atom1, atom2, atom3 and atom4 will be set to value and atom4 and all other atoms attached to that will be moved. All distances are specified in Angstroms, all angles in degrees.
All atom arguments can be integers or _StructureAtom objects. There is no return value for this function.
Raises: AtomsInRingError – if specified atoms are within a ring system. If ring distortion from an adjustment is not an issue, then the moving bitset can be manually created and passed to mmct_atom_set_distance(), mmct_atom_set_bond_angle(), or mmct_atom_set_dihedral_angle().
-
append
(filename, format=None)¶ Deprecated: Use the StructureWriter context manager instead
-
applyCPKStyle
(atom_list=None)¶ Applies CPK styles to the atoms and bonds of the entire structure (by default) or to the atoms (and their bonds) given in atom_list.
Parameters: atom_list (iterable) – An iterable of atom objects or atom indices to apply the given styles to. If not included the styles are applied to all atoms in the structure.
-
applyStyle
(atoms=3, bonds=3, atom_list=None)¶ Applies the given display styles to the atoms and bonds of the entire structure (by default) or to the atoms (and their bonds) given in atom_list.
Parameters: - atoms (int) – Display style for atoms, given by structure module constants ATOM_NOSTYLE, ATOM_CIRCLE, ATOM_CPK, ATOM_BALLNSTICK. Default is ATOM_BALLNSTICK.
- atoms – Display style for bonds, given by structure module constants BOND_NOSTYLE, BOND_WIRE, BOND_TUBE, BOND_BALLNSTICK. Default is BOND_BALLNSTICK.
- atom_list (iterable) – An iterable of atom objects or atom indices to apply the given styles to. If not included the styles are applied to all atoms in the structure. Possible examples include:: [1, 3, 5] ring.atom schrodinger.structutils.analyze.evalulate_asl(asl_expr) [structure.atom[x] for x in xrange(50)] maestro.selected_atoms_get()
-
applyTubeStyle
(atom_list=None)¶ Applies CPK styles to the atoms and bonds of the entire structure (by default) or to the atoms (and their bonds) given in atom_list.
Parameters: atom_list (iterable) – An iterable of atom objects or atom indices to apply the given styles to. If not included the styles are applied to all atoms in the structure.
-
applyWireStyle
(atom_list=None)¶ Applies wire styles to the atoms and bonds of the entire structure (by default) or to the atoms (and their bonds) given in atom_list.
Parameters: atom_list (iterable) – An iterable of atom objects or atom indices to apply the given styles to. If not included the styles are applied to all atoms in the structure.
-
areBound
(atom1, atom2)¶ Returns True if atom1 and atom2 have a bond of any order between them and False is there is no bond.
-
atom
¶ An iterable of structure atoms, each of which is a
_StructureAtom
instance.Example usage, where
st
is a Structure instance:# Access an atom (indices start at 1) atomobj = st.atom[n] # Delete an atom del st.atom[n] # Find the number of atoms len(st.atom) # Iterate over all atoms for atom in st.atom: take_some_action(atom)
Note: As with many other collections, the contents of the atom list should not be modified through additions or deletions while you are iterating over it.
-
atom_total
¶ Get total number of atoms in this structure
-
bond
¶ An iterable of structure bonds, each of which is a
_StructureBond
instance.To iterate over bonds:
for bond in st.bond: take_some_action(bond)
Note: Atoms and bonds should not be added or deleted while you are iterating over bonds. Note: Bonds are not accessible by index.
-
chain
¶ An iterable of chains in the structure, each of which is a
_Chain
instance.Example usage:
# Find the number of chains in the structure len(st.chain) # Retrieve a _Chain instance by letter chain = st.chain[letter] # Iterate over chains for chain in st.chain: take_some_action(chain)
Note: Atoms and bonds should not be added or deleted while you are iterating over chains.
-
closeBlockIfNecessary
(filehandle)¶ Used by the Maestro writer to leave the header block if necessary. For Structure objects this is not needed so it only returns
-
copy
()¶ Returns a copy of the structure.
-
deleteAtoms
(indices, renumber_map=False)¶ Delete multiple atoms from the Structure. The argument indices must be a sequence or an iterable, and able to be interpreted as ints.
After deletion, indices are renumbered from 1 to len(atoms). Pre-existing references to Structure atoms will not be correct, as they store index values.
If renumber_map is set to True, will return a renumbering dictionary. Keys are atom numbers before deleting, and value for each is the new atom number, or None if that atom was deleted.
-
deleteBond
(atom1, atom2)¶ Delete the bond between atom1 and atom2. Raises an Exception if there is no bond between these two.
-
extend
(other_structure)¶ Add the atoms in other_structure to the end of the current structure. The other_structure is left unchanged.
Raises: ValueError – Extending a structure with itself is not allowed.
-
extract
(indices, copy_props=False)¶ Return a new structure object which contains the atoms of the current structure that appear in the specified list. The argument indices must be a sequence or an iterable, and able to be interpreted as ints.
After extractions, indices are renumbered from 1 to len(atoms). Pre-existing references to Structure atoms will not be correct, as they store index values.
If copy_props is set to True, then the new structure object will inherit Structure-level properties from the source object.
-
findResidue
(query)¶ Returns a
_Residue
object matching the given string (e.g. “A:123”). Currently only protein residues are supported.If no residues were found that match the given string, or if the given string is of improper format, ValueError is raised.
Note: If the structure has more than one matching residue, then only the first match will be returned.
-
find_rings
(sort=True)¶ Find all rings in the structure using SSSR.
Each ring is returned in connectivity order.
Parameters: sort (bool) – Deprecated and unused Returns: A list of lists of integers corresponding to the atom indices of the rings.
-
formal_charge
¶ Get the sum of formal charges for the structure.
Accessing this property is an O(N) operation.
-
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. :rtype : cls
-
generate3dConformation
(require_stereo=True)¶ Generate new 3D coordinates for the current structure, and add hydrogens if any are missing. This method is useful for “volumizing” a 2D structure into 3D. NOTE: For 2D inputs, annotation properties must be present for chiral centers to be processed correctly.
Parameters: require_stereo (bool) – Whether to require all chiral centers to have defined stereochemistry via annotation properties. Defaults to True. UndefinedStereochemistry exception is raised if any chiral atom has ambiguous chirality. If set to False, ambiguous chiralities will be expanded arbitrarily.
-
get3dStructure
(require_stereo=True)¶ Deprecated: Use generate3dConformation() instead.
-
getAtomIndices
()¶ Return a list of all atom indices in this structure.
-
getAtomPropertyNames
(include_builtin=False)¶ Return a tuple of atom-level property names present in this CT.
Param: include_builtin: Whether to include built-in properties.
-
getBond
(atom1, atom2)¶ Returns a
_StructureBond
object for the bond between atom1 and atom2. The atom parameters can be_StructureAtom
objects or integer indices from 1 to the number of atoms in the structure.
-
getChainAtoms
(atom)¶ Return a list of atom objects that are in the same chain as ‘atom’.
-
getMoleculeAtoms
(atom)¶ Return a list of atom objects that are in the same molecule as ‘atom’.
-
getMovingAtoms
(fixed_atom, moving_atom)¶ Returns all atoms that would move if <moving_atom> is moved while <fixed_atom> is frozen. This effectively returns all atoms in the same molecule substructure as <moving_atom> (atoms in the same substructure as fixed_atom are excluded).
In other words, if the bond between the moving_atom and fixed_atom (or towards the direction of fixed_atom) were to be broken, the atoms that would be in the same molecule as moving_atom are returned. Can be used for detecting things like residue side-chain atoms, etc.
Note: If fixed_atom and moving_atom are part of different molecules, then all atoms in the moving_atom’s molecule will be returned. If fixed_atom and moving_atom are not bound directly, the intervening atoms will not be included in the result. If fixed_atom and moving_atom are connected with more than one path (are in a ring), then ValueError is raised.
Parameters: - fixed_atom (Atom index or
_StructureAtom
.) – Atom which is part of the molecule that is to be excluded from the result (frozen, not being moved). - moving_atom (Atom index or
_StructureAtom
.) – Atom of interest (atom to be moved); a set of atoms that would be moved with it (connected to it) will be returned.
Return type: Set of ints
Returns: Set of atom indices for atoms “connected” to moving_atom - those atoms that would be moved with it if it was moved. For example, if called with alpha carbon and beta carbon atoms of a protein residue, then all side-chain atoms would be returned. Atom moving_atom will also be included.
Raises ValueError if the given atoms are part of a ring (in other words, moving_atom is connected to fixed_atom via more than one path). This may happen if part of the moving_atom’s “chain” is bonded to something unexpected; e.g. ZOBed to metals, or involved in a di-sulfide bond.
- fixed_atom (Atom index or
-
getPropertyNames
()¶
-
getResidueAtoms
(atom)¶ Return a list of atom objects that are in the same residue as ‘atom’.
-
getXYZ
(copy=True)¶ Get a numpy array of the xyz coordinates of all atoms in the molecule with shape (atom_total, 3). Note that numpy arrays are indexed starting with 0.
You can avoid copying the underlying data by specifying copy=False, in which case modifying any values will modify the coordinate values in the Structure.
Note that if coordinates are retrieved with copy=False they will become invalid after their source Structure has been garbage collected. Any use of them after this point will likely cause a core dump. This is because the python numpy array provides access directly to the underlying C data.
-
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.
-
has3dCoords
()¶ Returns True if any atom in the structure has a non-zero z-coordinate.
-
isEquivalent
(struct, check_stereo=True)¶ Return True if the 2 structures are equivalent Return False if the 2 structures are different
struct: Another structure class object
check_stereo: Specifies whether or not to check stereo chemistry.
-
measure
(atom1, atom2, atom3=None, atom4=None)¶ Return the measurement for the provided atoms. If atom3 is None, return the distance between atom1 and atom2. If atom4 is None, return the angle with atoms 1 through 3, and if all atoms are provided, return the dihedral angle.
All atom arguments can be integers or
_StructureAtom
objects.If Periodic Boundary Condition CT-level properties are defined, uses the PBC measurement.
See also the structutil.measure module, which has functions to make measurements between atoms in different structures, and can also measure angles between planes.
-
merge
(other_structure, copy_props=False)¶ Return a new structure object which contains the atoms of the current structure and the atoms of other_structure.
If copy_props is True, properties from the current structure and other_structure will be added to the new structure. If the same property is specifed in both the current structure and other_structure, the current value will take precedence.
-
mol_total
¶ Get total number of molecules in this structure
-
molecule
¶ An iterable of molecules in the structure, each of which is a
_Molecule
instance.Example usage:
# Find the number of molecules in the structure len(st.molecule) # Retrieve a molecule by number (indices start at 1) mol = st.molecule[molnum] # Iterate over all molecules for mol in st.molecule: take_some_action(mol)
Note: Atoms and bonds should not be added or deleted while you are iterating over molecules.
-
property
¶ Dictionary-like container of Structure-level properties. Keys are strings of the form
type_family_name
as described in thePropertyName
documentation.
-
putToM2ioFile
(filehandle)¶ Used by the Maestro writer - put a single structure to the (already open) filehandle
-
static
read
(filename, index=1, format=None)¶ Deprecated: Use the static StructureReader.read() method instead
-
residue
¶ An iterable of residues in the structure, each of which is a
_Residue
instance.To iterate over all residues:
for residue in st.residue: take_some_action(residue)
Note: Atoms and bonds should not be added or deleted while you are iterating over residues. Note: residues are not accessible by index. See Structure.findResidue()
-
retype
()¶ Reassign all the MacroModel atom types based on the bond orders and formal charges. This function should be called after either of these have been changed.
-
ring
¶ An iterable of rings in the structure, each of which is a
_Ring
instance.To iterate over rings:
for ring in st.ring: take_some_action(ring)
Note: Atoms and bonds should not be added or deleted while you are iterating over rings.
-
setXYZ
(xyz)¶ Set all xyz coordinates for the molecule from a numpy array.
-
title
¶ Get the title for this structure
-
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
-
total_weight
¶ The sum of atomic weights for the whole structure.
The weight of implicit hydrogens is automatically included.
Accessing this property is an O(N) operation.
-
write
(filename, format=None)¶ Deprecated: Use the static StructureWriter.write() method instead
-
writeToString
(format)¶ Write the structure to a string representation and return the string. The format parameter is required.
-
-
class
schrodinger.models.jsonable.
JsonableTuple
¶ Bases:
schrodinger.models.json.JsonableClassMixin
,tuple
-
ENCODING_KEY
= '_python_tuple_'¶
-
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_list)¶ 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. :rtype : cls
-
__contains__
¶ Return key in self.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
__len__
¶ Return len(self).
-
count
(value) → integer -- return number of occurrences of value¶
-
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. :rtype : 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.
-
index
(value[, start[, stop]]) → integer -- return first index of value.¶ Raises ValueError if the value is not present.
-
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.models.jsonable.
JsonableNamedTuple
¶ Bases:
schrodinger.models.json.JsonableClassMixin
A jsonabled NamedTuple that behaves like a normal named tuple but is jsonable if its fields are jsonable. Example:
class Coordinate(JsonableNamedTuple): x: float y: float description: str coord = Coordinate(x=1, y=2, description="molecule coord") assert coord == (1, 2, "molecule coord") serialized_coord = json.dumps(c) deserialized_coord = json.loads(serialized_coord, DataClass=Coordinate) assert deserialized_coord == (1, 2, "molecule coord")
- WARNING:: Instances of subclasses of this class will not evaluate as
- instances of
JsonableNamedTuple
. This replicates the behavior oftyping.NamedTuple
.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
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. :rtype : cls
-
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. :rtype : 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
-
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
-
class
schrodinger.models.jsonable.
JsonableEnum
(*args, **kwargs)¶ Bases:
schrodinger.models.jsonable._JsonableEnumBase
,enum.Enum
An enumeration.
-
__init__
(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
fromJsonImplementation
= <bound method JsonableEnum.fromJsonImplementation of <enum 'JsonableEnum'>>¶
-
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
-
-
class
schrodinger.models.jsonable.
JsonableIntEnum
(*args, **kwargs)¶ Bases:
int
,schrodinger.models.json.JsonableClassMixin
,enum.Enum
An enumeration.
-
__init__
(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
fromJsonImplementation
= <bound method JsonableIntEnum.fromJsonImplementation of <enum 'JsonableIntEnum'>>¶
-
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
-
-
class
schrodinger.models.jsonable.
AbstractJsonSerializer
¶ Bases:
object
A class for defining how serialization should be done for a particular object. This should only be used if you’re unable to use
json.JsonableClassMixin
. This can be used in conjunction withjson.load(s)
andjson.dump(s)
.Subclasses must define
ObjectClass
andJsonableClass
and overrideobjectFromJsonable
andjsonableFromObject
.Create a subclass here to add a new class to the global default serialization registry. (Consult with relevant parties before doing so…)
Variables: - ObjectClass – The non-jsonable third-party class (e.g. set, rdkit.Mol, etc.)
- JsonableClass – The class that subclasses
ObjectClass
and mixes in JsonableClassMixin.
-
ObjectClass
= NotImplemented¶
-
JsonableClass
= NotImplemented¶
-
__init__
()¶ Initialize self. See help(type(self)) for accurate signature.
-
classmethod
objectFromJsonable
(jsonable_obj)¶ Return an instance of
ObjectClass
from an instance ofJsonableClass
-
classmethod
jsonableFromObject
(obj)¶ Return an instance of
JsonableClass
from an instance ofObjectClass
-
classmethod
objectFromJson
(json_obj)¶ DO NOT OVERRIDE.
Return an instance of ObjectClass from a json object (i.e. an object made up of json native types).
-
class
schrodinger.models.jsonable.
StructureSerializer
¶ Bases:
schrodinger.models.jsonable.AbstractJsonSerializer
-
ObjectClass
¶ alias of
schrodinger.structure._structure.Structure
-
JsonableClass
¶ alias of
JsonableStructure
-
classmethod
objectFromJsonable
(jsonable_structure)¶ Return an instance of
ObjectClass
from an instance ofJsonableClass
-
classmethod
jsonableFromObject
(structure_)¶ Return an instance of
JsonableClass
from an instance ofObjectClass
-
__init__
()¶ Initialize self. See help(type(self)) for accurate signature.
-
classmethod
objectFromJson
(json_obj)¶ DO NOT OVERRIDE.
Return an instance of ObjectClass from a json object (i.e. an object made up of json native types).
-
-
class
schrodinger.models.jsonable.
TupleSerializer
¶ Bases:
schrodinger.models.jsonable.AbstractJsonSerializer
-
ObjectClass
¶ alias of
builtins.tuple
-
JsonableClass
¶ alias of
JsonableTuple
-
classmethod
objectFromJsonable
(jsonable_tuple)¶ Return an instance of
ObjectClass
from an instance ofJsonableClass
-
classmethod
jsonableFromObject
(tuple_)¶ Return an instance of
JsonableClass
from an instance ofObjectClass
-
__init__
()¶ Initialize self. See help(type(self)) for accurate signature.
-
classmethod
objectFromJson
(json_obj)¶ DO NOT OVERRIDE.
Return an instance of ObjectClass from a json object (i.e. an object made up of json native types).
-
-
class
schrodinger.models.jsonable.
SetSerializer
¶ Bases:
schrodinger.models.jsonable.AbstractJsonSerializer
-
ObjectClass
¶ alias of
builtins.set
-
JsonableClass
¶ alias of
JsonableSet
-
classmethod
objectFromJsonable
(jsonable_set)¶ Return an instance of
ObjectClass
from an instance ofJsonableClass
-
classmethod
jsonableFromObject
(set_)¶ Return an instance of
JsonableClass
from an instance ofObjectClass
-
__init__
()¶ Initialize self. See help(type(self)) for accurate signature.
-
classmethod
objectFromJson
(json_obj)¶ DO NOT OVERRIDE.
Return an instance of ObjectClass from a json object (i.e. an object made up of json native types).
-
-
class
schrodinger.models.jsonable.
MolSerializer
¶ Bases:
schrodinger.models.jsonable.AbstractJsonSerializer
-
ObjectClass
¶ alias of
rdkit.Chem.rdchem.Mol
-
JsonableClass
¶ alias of
_JsonableMolWrapper
-
classmethod
objectFromJsonable
(jsonable_mol)¶ Return an instance of
ObjectClass
from an instance ofJsonableClass
-
classmethod
jsonableFromObject
(mol)¶ Return an instance of
JsonableClass
from an instance ofObjectClass
-
__init__
()¶ Initialize self. See help(type(self)) for accurate signature.
-
classmethod
objectFromJson
(json_obj)¶ DO NOT OVERRIDE.
Return an instance of ObjectClass from a json object (i.e. an object made up of json native types).
-
-
schrodinger.models.jsonable.
serializer
¶
-
schrodinger.models.jsonable.
get_default_serializer
(DataClass)¶