OEWriteReceptorToBytesΒΆ

byte[] OEWriteReceptorToBytes(String format, OEMolBase mol)
byte[] OEWriteReceptorToBytes(int format, int flavor, boolean gzip, OEMolBase mol)

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 a non-empty byte[] if the molecule to encode is identified as a receptor and encoding was successful.

byte[] bytes = OEDocking.OEWriteReceptorToBytes(".oeb", receptor);
OEGraphMol receptorIO = new OEGraphMol();
bool status = OEDocking.OEReadReceptorFromBytes(receptorIO, ".oeb", bytes);
byte[] bytes = OEDocking.OEWriteReceptorToBytes(".oeb.gz", receptor);
OEGraphMol receptorIO = new OEGraphMol();
bool status = OEDocking.OEReadReceptorFromBytes(receptorIO, ".oeb.gz", bytes);
byte[] bytes = OEDocking.OEWriteReceptorToBytes(".json", receptor);
OEGraphMol receptorIO = new OEGraphMol();
bool status = OEDocking.OEReadReceptorFromBytes(receptorIO, ".json", bytes);
byte[] bytes = OEDocking.OEWriteReceptorToBytes(".json.gz", receptor);
OEGraphMol receptorIO = new OEGraphMol();
bool status = OEDocking.OEReadReceptorFromBytes(receptorIO, ".json.gz", bytes);
bool gzip = false;
byte[] bytes = OEDocking.OEWriteReceptorToBytes(OEFormat.OEB, OEChem.OEGetDefaultOFlavor(OEFormat.OEB), gzip, receptor);
OEGraphMol receptorIO = new OEGraphMol();
bool status = OEDocking.OEReadReceptorFromBytes(receptorIO, OEFormat.OEB, OEChem.OEGetDefaultIFlavor(OEFormat.OEB), gzip, bytes);
bool gzip = true;
byte[] bytes = OEDocking.OEWriteReceptorToBytes(OEFormat.OEB, OEChem.OEGetDefaultOFlavor(OEFormat.OEB), gzip, receptor);
OEGraphMol receptorIO = new OEGraphMol();
bool status = OEDocking.OEReadReceptorFromBytes(receptorIO, OEFormat.OEB, OEChem.OEGetDefaultIFlavor(OEFormat.OEB), gzip, bytes);
bool gzip = false;
byte[] bytes = OEDocking.OEWriteReceptorToBytes(OEFormat.JSON, OEChem.OEGetDefaultOFlavor(OEFormat.JSON), gzip, receptor);
OEGraphMol receptorIO = new OEGraphMol();
bool status = OEDocking.OEReadReceptorFromBytes(receptorIO, OEFormat.JSON, OEChem.OEGetDefaultIFlavor(OEFormat.JSON), gzip, bytes);
bool gzip = true;
byte[] bytes = OEDocking.OEWriteReceptorToBytes(OEFormat.JSON, OEChem.OEGetDefaultOFlavor(OEFormat.JSON), gzip, receptor);
OEGraphMol receptorIO = new OEGraphMol();
bool status = OEDocking.OEReadReceptorFromBytes(receptorIO, OEFormat.JSON, OEChem.OEGetDefaultIFlavor(OEFormat.JSON), gzip, bytes);