OEWriteReceptorToBytes

OEWriteReceptorToBytes(format, oemol) -> bytes
OEWriteReceptorToBytes(format, flavor, gzip, oemol) -> bytes

Encodes a receptor in terms of ‘format’. ‘format’ must be a file extension that is writeable by OpenEye, for example: “.oeb.gz”. Overloads which take an unsigned ‘format’, unsigned ‘flavor’ and Boolean ‘gzip’ parameters expect the format and flavor to be specified by one of the constants in OEFormat and OEOFlavor.

Returns bytes if the molecule to encode is identified as a receptor and encoding was successful, otherwise, ‘’None’’.

bytes = oedocking.OEWriteReceptorToBytes(".oeb", receptor)
receptorIO = oechem.OEGraphMol()
status = oedocking.OEReadReceptorFromBytes(receptorIO, ".oeb", bytes)
bytes = oedocking.OEWriteReceptorToBytes(".oeb.gz", receptor)
receptorIO = oechem.OEGraphMol()
status = oedocking.OEReadReceptorFromBytes(receptorIO, ".oeb.gz", bytes)
gzip = False
bytes = oedocking.OEWriteReceptorToBytes(oechem.OEFormat_OEB,
                                         oechem.OEGetDefaultOFlavor(oechem.OEFormat_OEB),
                                         gzip, receptor)
receptorIO = oechem.OEGraphMol()
status = oedocking.OEReadReceptorFromBytes(receptorIO, oechem.OEFormat_OEB,
                                           oechem.OEGetDefaultIFlavor(oechem.OEFormat_OEB),
                                           gzip, bytes)
gzip = True
bytes = oedocking.OEWriteReceptorToBytes(oechem.OEFormat_OEB,
                                         oechem.OEGetDefaultOFlavor(oechem.OEFormat_OEB),
                                         gzip, receptor)
receptorIO = oechem.OEGraphMol()
status = oedocking.OEReadReceptorFromBytes(receptorIO, oechem.OEFormat_OEB,
                                           oechem.OEGetDefaultIFlavor(oechem.OEFormat_OEB),
                                           gzip, bytes)