OEWriteMolToBytesΒΆ

OEWriteMolToBytes(format, oemol) -> bytes
OEWriteMolToBytes(format, gzip, oemol) -> bytes

OEWriteMolToBytes(format, oemcmol) -> bytes
OEWriteMolToBytes(format, gzip, oemcmol) -> bytes

Encodes a molecule in terms of ‘format’. ‘format’ must be a file extension that is writeable by OpenEye. For example: ”.oeb.gz”. Overloads with a Boolean gzip parameter expect format to be specified by a constant in OEFormat.

Returns bytes if encoding was successful, otherwise ‘’None’‘.

mol = OEGraphMol()
OESmilesToMol(mol, "c1ccccc1")
molbytes = OEWriteMolToBytes(".smi", mol)
mol = OEGraphMol()
OESmilesToMol(mol, "c1ccccc1")
molbytes = OEWriteMolToBytes(OEFormat_SMI, False, mol)